* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px;
    text-align: center;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1.1em;
    opacity: 0.9;
}

main {
    padding: 40px;
}

.upload-section {
    margin-bottom: 40px;
}

.upload-card {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 30px;
}

.upload-area {
    border: 3px dashed #667eea;
    border-radius: 10px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    margin-bottom: 20px;
}

.upload-area:hover {
    background: #f0f4ff;
    border-color: #764ba2;
}

.upload-area.dragover {
    background: #e8edff;
    border-color: #667eea;
}

.upload-icon {
    width: 80px;
    height: 80px;
    margin-bottom: 20px;
    color: #667eea;
}

.upload-text {
    font-size: 1.3em;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
}

.upload-hint {
    color: #666;
    font-size: 0.9em;
}

.file-info {
    background: white;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.file-details {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.file-name {
    font-weight: 600;
    color: #333;
}

.file-size {
    font-size: 0.85em;
    color: #666;
}

.options {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.options label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 500;
}

.options input[type="radio"] {
    width: 20px;
    height: 20px;
    accent-color: #667eea;
}

.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    width: 100%;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-clear {
    background: #dc3545;
    color: white;
    padding: 8px 15px;
    font-size: 0.9em;
}

.btn-clear:hover {
    background: #c82333;
}

.progress-container {
    margin-top: 20px;
}

.progress-bar {
    background: #e0e0e0;
    border-radius: 10px;
    height: 20px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    height: 100%;
    width: 0%;
    transition: width 0.3s;
    animation: progress-animation 1.5s ease-in-out infinite;
}

@keyframes progress-animation {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.progress-text {
    text-align: center;
    color: #666;
    font-weight: 500;
}

.results-section {
    margin-top: 40px;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.results-content {
    display: grid;
    gap: 20px;
}

.result-card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border-left: 5px solid #667eea;
}

.result-card.malnutrition {
    border-left-color: #dc3545;
}

.result-card.normal {
    border-left-color: #28a745;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.result-label {
    font-size: 1.4em;
    font-weight: 700;
    padding: 8px 16px;
    border-radius: 8px;
    color: white;
}

.result-label.malnutrition {
    background: #dc3545;
}

.result-label.normal {
    background: #28a745;
}

.result-confidence {
    font-size: 1.2em;
    font-weight: 600;
    color: #667eea;
}

.probabilities {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.probability-item {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 10px;
}

.probability-label {
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

.probability-bar {
    background: #e0e0e0;
    border-radius: 10px;
    height: 12px;
    overflow: hidden;
}

.probability-fill {
    height: 100%;
    transition: width 0.5s;
}

.probability-fill.normal {
    background: #28a745;
}

.probability-fill.malnutrition {
    background: #dc3545;
}

.probability-value {
    text-align: right;
    font-size: 0.9em;
    color: #666;
    margin-top: 5px;
}

.face-preview {
    margin-top: 20px;
}

.face-preview h4 {
    margin-bottom: 10px;
    color: #333;
}

.face-image {
    max-width: 200px;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

.video-summary {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    margin-top: 20px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #e0e0e0;
}

.summary-item:last-child {
    border-bottom: none;
}

.summary-label {
    font-weight: 600;
    color: #333;
}

.summary-value {
    color: #667eea;
    font-weight: 600;
}

.preview-section {
    margin-top: 40px;
}

.preview-content {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
}

.preview-content img,
.preview-content video {
    max-width: 100%;
    max-height: 400px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

footer {
    background: #f8f9fa;
    padding: 20px;
    text-align: center;
    color: #666;
    font-size: 0.9em;
}

.alert {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: none;
}

.alert.show {
    display: block;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

@media (max-width: 768px) {
    header {
        padding: 20px;
    }

    header h1 {
        font-size: 1.8em;
    }

    main {
        padding: 20px;
    }

    .upload-card {
        padding: 20px;
    }

    .results-header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }

    .probabilities {
        grid-template-columns: 1fr;
    }
}
