/* === CSS VARIABLES === */
:root {
    --green-50:  #f0fdf4;
    --green-100: #dcfce7;
    --green-400: #4ade80;
    --green-500: #22c55e;
    --green-600: #16a34a;
    --green-700: #15803d;

    --navy-900: #0f172a;
    --navy-800: #1e293b;
    --navy-700: #2d3748;
    --navy-600: #374151;

    --gray-50:  #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-700: #374151;
    --gray-900: #0f172a;

    --red-500: #ef4444;
    --orange-500: #f97316;
    --blue-500: #3b82f6;

    --white: #ffffff;
    --shadow-sm: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
    --shadow-md: 0 4px 16px rgba(0,0,0,.10);
    --shadow-lg: 0 10px 40px rgba(0,0,0,.14);
    --shadow-xl: 0 20px 60px rgba(0,0,0,.18);
    --shadow-green: 0 8px 24px rgba(34,197,94,.25);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* === RESET & BASE === */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 72px;
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--gray-50);
    color: var(--navy-800);
    line-height: 1.6;
    min-height: 100vh;
    transition: background var(--transition), color var(--transition);
    -webkit-font-smoothing: antialiased;
}

/* Dark mode base */
body.dark-mode {
    background: var(--navy-900);
    color: #e2e8f0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* === NAVBAR === */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    height: 72px;
    background: rgba(15, 23, 42, 0.96);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 1000;
    border-bottom: 1px solid rgba(255,255,255,.08);
    box-shadow: 0 2px 20px rgba(0,0,0,.3);
}

body.dark-mode .navbar {
    background: rgba(9, 14, 28, 0.98);
}

.nav-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 700;
    color: var(--white);
    text-decoration: none;
    letter-spacing: -0.3px;
    transition: opacity var(--transition);
    white-space: nowrap;
}

.logo:hover { opacity: 0.85; }

.logo i {
    font-size: 22px;
    color: var(--green-400);
    animation: leafFloat 3s ease-in-out infinite;
}

@keyframes leafFloat {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-4px); }
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 32px;
    flex: 1;
    justify-content: center;
}

.nav-links a {
    color: rgba(255,255,255,.78);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color var(--transition);
    position: relative;
    padding-bottom: 2px;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--green-400);
    transition: width var(--transition);
    border-radius: 2px;
}

.nav-links a:hover { color: var(--white); }
.nav-links a:hover::after { width: 100%; }

.btn-dark {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,.1);
    border: 1px solid rgba(255,255,255,.15);
    color: var(--white);
    font-size: 16px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
    flex-shrink: 0;
}

.btn-dark:hover {
    background: rgba(34,197,94,.2);
    border-color: rgba(34,197,94,.4);
    transform: scale(1.05);
}

/* === HERO SECTION === */
.hero {
    margin-top: 72px;
    min-height: calc(100vh - 72px);
    background: linear-gradient(135deg, var(--navy-900) 0%, #1a2744 55%, #0f3320 100%);
    color: var(--white);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 80px 24px;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 70% 60% at 15% 40%, rgba(34,197,94,.12) 0%, transparent 60%),
        radial-gradient(ellipse 50% 50% at 85% 70%, rgba(59,130,246,.08) 0%, transparent 60%);
    z-index: 1;
}

.hero-decoration {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.22;
    animation: blobMove 10s ease-in-out infinite;
}

.blob-1 {
    width: 480px; height: 480px;
    background: var(--green-600);
    top: -80px; right: -120px;
    animation-delay: 0s;
}

.blob-2 {
    width: 320px; height: 320px;
    background: #1d4ed8;
    bottom: 80px; left: -60px;
    animation-delay: 3s;
}

.blob-3 {
    width: 360px; height: 360px;
    background: var(--green-700);
    bottom: 120px; right: 100px;
    animation-delay: 6s;
}

@keyframes blobMove {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33%       { transform: translate(24px, -40px) scale(1.08); }
    66%       { transform: translate(-16px, 18px) scale(0.94); }
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 720px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 48px;
}

.hero-text {
    text-align: center;
    animation: fadeDown 0.8s ease-out both;
}

.hero-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -1px;
    margin-bottom: 18px;
}

.gradient-text {
    display: block;
    background: linear-gradient(120deg, #ffffff 0%, #86efac 60%, #4ade80 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: clamp(0.95rem, 2vw, 1.1rem);
    color: rgba(255,255,255,.72);
    max-width: 520px;
    margin: 0 auto;
    line-height: 1.7;
}

@keyframes fadeDown {
    from { opacity: 0; transform: translateY(-20px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* === UPLOAD CONTAINER === */
.upload-container {
    width: 100%;
    animation: fadeUp 0.8s ease-out 0.15s both;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

.upload-box {
    background: rgba(255,255,255,.97);
    border-radius: var(--radius-xl);
    padding: 36px;
    box-shadow: var(--shadow-xl);
    border: 1px solid rgba(255,255,255,.9);
    color: var(--navy-800);
}

body.dark-mode .upload-box {
    background: rgba(15, 23, 42, 0.92);
    border-color: rgba(255,255,255,.08);
    color: #e2e8f0;
}

.upload-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 36px 24px;
    border: 2px dashed rgba(34,197,94,.5);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition);
    background: linear-gradient(135deg, rgba(34,197,94,.05) 0%, rgba(59,130,246,.05) 100%);
}

.upload-label:hover,
.upload-label.active {
    border-color: var(--green-500);
    background: linear-gradient(135deg, rgba(34,197,94,.1) 0%, rgba(59,130,246,.1) 100%);
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(34,197,94,.15);
}

.upload-icon-wrapper {
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, var(--green-500) 0%, var(--green-700) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: white;
    box-shadow: var(--shadow-green);
    animation: pulse 2.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); box-shadow: var(--shadow-green); }
    50%       { transform: scale(1.06); box-shadow: 0 12px 32px rgba(34,197,94,.4); }
}

.upload-text {
    font-size: 16px;
    font-weight: 600;
    color: var(--navy-800);
}

body.dark-mode .upload-text { color: #e2e8f0; }

.upload-hint {
    font-size: 13px;
    color: var(--gray-500);
}

body.dark-mode .upload-hint { color: var(--gray-400); }

/* Preview */
.preview-container {
    justify-content: center;
    align-items: center;
    margin-top: 20px;
    gap: 16px;
}

.preview-image {
    max-width: 140px;
    max-height: 140px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    object-fit: cover;
    animation: zoomIn 0.4s ease-out;
}

@keyframes zoomIn {
    from { opacity: 0; transform: scale(0.85); }
    to   { opacity: 1; transform: scale(1); }
}

.btn-remove-image {
    width: 38px;
    height: 38px;
    background: var(--red-500);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
    box-shadow: 0 4px 12px rgba(239,68,68,.3);
    flex-shrink: 0;
}

.btn-remove-image:hover {
    background: #dc2626;
    transform: scale(1.1);
}

.file-name {
    margin-top: 12px;
    font-size: 13px;
    color: var(--gray-500);
    text-align: center;
    min-height: 18px;
}

body.dark-mode .file-name { color: var(--gray-400); }

/* Submit Button */
.btn-submit {
    width: 100%;
    padding: 15px;
    margin-top: 20px;
    background: linear-gradient(135deg, var(--green-500) 0%, var(--green-700) 100%);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    box-shadow: var(--shadow-green);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-family: inherit;
    letter-spacing: 0.2px;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 36px rgba(34,197,94,.45);
    background: linear-gradient(135deg, var(--green-600) 0%, #14532d 100%);
}

.btn-submit:active { transform: translateY(0); }

/* === SECTIONS === */
.section {
    padding: 96px 24px;
}

.section-light {
    background: var(--gray-50);
}

body.dark-mode .section-light {
    background: var(--navy-900);
}

.section-dark {
    background: linear-gradient(160deg, var(--navy-800) 0%, #1a2744 100%);
    color: #e2e8f0;
}

body.dark-mode .section-dark {
    background: linear-gradient(160deg, #0a0e1a 0%, #101828 100%);
}

.section-header {
    text-align: center;
    margin-bottom: 64px;
}

.section-title {
    font-size: clamp(1.6rem, 3.5vw, 2.4rem);
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 12px;
    color: var(--navy-800);
}

body.dark-mode .section-title { color: #f1f5f9; }

.section-dark .section-title {
    color: var(--white);
}

/* Accent underline */
.section-header::after {
    content: '';
    display: block;
    width: 48px;
    height: 4px;
    background: linear-gradient(90deg, var(--green-500), var(--green-400));
    border-radius: 2px;
    margin: 16px auto 0;
}

.section-subtitle {
    font-size: 16px;
    color: var(--gray-500);
    max-width: 560px;
    margin: 0 auto;
    line-height: 1.7;
}

body.dark-mode .section-subtitle { color: var(--gray-400); }
.section-dark .section-subtitle   { color: rgba(255,255,255,.6); }

/* === FEATURE CARDS (ABOUT) === */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 28px;
}

.card-feature {
    background: var(--white);
    padding: 40px 32px;
    border-radius: var(--radius-lg);
    text-align: center;
    box-shadow: var(--shadow-md);
    transition: all var(--transition);
    border: 1px solid var(--gray-100);
    position: relative;
    overflow: hidden;
}

.card-feature::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--green-500), var(--green-400));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
}

.card-feature:hover::before { transform: scaleX(1); }

body.dark-mode .card-feature {
    background: rgba(30, 41, 59, 0.8);
    border-color: rgba(255,255,255,.06);
}

.card-feature:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 48px rgba(0,0,0,.12);
}

.card-icon {
    width: 72px;
    height: 72px;
    background: var(--green-50);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 30px;
    color: var(--green-600);
    border: 2px solid var(--green-100);
    transition: all var(--transition);
}

body.dark-mode .card-icon {
    background: rgba(34,197,94,.1);
    border-color: rgba(34,197,94,.2);
    color: var(--green-400);
}

.card-feature:hover .card-icon {
    background: var(--green-500);
    color: white;
    border-color: var(--green-500);
}

.card h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--navy-800);
}

body.dark-mode .card h3 { color: #f1f5f9; }

.card p {
    font-size: 14px;
    color: var(--gray-500);
    line-height: 1.75;
}

body.dark-mode .card p { color: var(--gray-400); }

/* === DISEASE CARDS === */
.diseases-grid-single-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

@media (min-width: 1100px) {
    .diseases-grid-single-row {
        grid-template-columns: repeat(4, 1fr);
    }
}

.disease-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: all var(--transition);
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(255,255,255,.5);
}

body.dark-mode .disease-card {
    background: rgba(30, 41, 59, 0.85);
    border-color: rgba(255,255,255,.05);
}

.disease-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-xl);
}

.disease-header {
    position: relative;
    overflow: hidden;
    background: #f0f4f0;
    aspect-ratio: 4 / 3;
}

body.dark-mode .disease-header {
    background: rgba(15, 23, 42, 0.6);
}

/* === CAROUSEL === */
.disease-carousel {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.carousel-track {
    display: flex;
    width: 100%;
    height: 100%;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.carousel-track img {
    min-width: 100%;
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 8px;
    flex-shrink: 0;
    background: #f0f4f0;
}

body.dark-mode .carousel-track img {
    background: rgba(15, 23, 42, 0.6);
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    background: rgba(0,0,0,.45);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: background var(--transition), opacity var(--transition);
    opacity: 0;
}

.disease-header:hover .carousel-btn {
    opacity: 1;
}

.carousel-prev { left: 6px; }
.carousel-next { right: 6px; }

.carousel-btn:hover {
    background: rgba(34,197,94,.8);
}

.carousel-dots {
    position: absolute;
    bottom: 6px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 5px;
    z-index: 10;
}

.dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255,255,255,.5);
    transition: all var(--transition);
    cursor: pointer;
}

.dot.active {
    background: var(--white);
    width: 16px;
    border-radius: 3px;
}

.disease-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 5px 10px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 700;
    color: white;
    display: flex;
    align-items: center;
    gap: 5px;
    box-shadow: 0 2px 8px rgba(0,0,0,.25);
    backdrop-filter: blur(8px);
}

.badge-success { background: rgba(22,163,74,.9); }
.badge-danger  { background: rgba(220,38,38,.9); }
.badge-warning { background: rgba(234,88,12,.9); }
.badge-info    { background: rgba(37,99,235,.9); }

.disease-content {
    padding: 18px;
    color: var(--navy-800);
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

body.dark-mode .disease-content { color: #e2e8f0; }

.disease-content h3 {
    font-size: 14px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--navy-800);
}

body.dark-mode .disease-content h3 { color: #f1f5f9; }

.disease-section {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.disease-section h4 {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--green-600);
    display: flex;
    align-items: center;
    gap: 5px;
}

body.dark-mode .disease-section h4 { color: var(--green-400); }

.disease-section h4 i { font-size: 10px; }

.disease-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.disease-section li {
    font-size: 12px;
    color: var(--gray-500);
    line-height: 1.5;
    padding-left: 14px;
    position: relative;
}

body.dark-mode .disease-section li { color: var(--gray-400); }

.disease-section li::before {
    content: '›';
    position: absolute;
    left: 0;
    color: var(--green-500);
    font-weight: 700;
    font-size: 14px;
    line-height: 1.3;
}

/* === MODEL SPECS GRID === */
.model-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
}

.model-card {
    background: var(--white);
    padding: 32px 24px;
    border-radius: var(--radius-lg);
    text-align: center;
    border: 1px solid var(--gray-100);
    transition: all var(--transition);
    box-shadow: var(--shadow-sm);
}

body.dark-mode .model-card {
    background: rgba(30, 41, 59, 0.8);
    border-color: rgba(255,255,255,.06);
}

.model-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 40px rgba(34,197,94,.15);
    border-color: rgba(34,197,94,.2);
}

.model-icon {
    font-size: 36px;
    color: var(--green-500);
    margin-bottom: 14px;
}

.model-text h3 {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

body.dark-mode .model-text h3 { color: var(--gray-400); }

.model-value {
    font-size: 20px;
    font-weight: 800;
    color: var(--navy-800);
    margin: 4px 0;
    letter-spacing: -0.5px;
}

body.dark-mode .model-value { color: #f1f5f9; }

.model-desc {
    font-size: 12px;
    color: var(--gray-400);
    margin-top: 4px;
}

/* === RESULT PAGE === */
.result-page {
    margin-top: 72px;
    padding: 48px 0 80px;
    background: var(--gray-50);
    min-height: calc(100vh - 72px);
}

body.dark-mode .result-page { background: var(--navy-900); }

.result-card {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 40px;
    background: var(--white);
    padding: 40px;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    margin-bottom: 32px;
    border: 1px solid var(--gray-100);
    animation: fadeUp 0.5s ease-out both;
}

body.dark-mode .result-card {
    background: rgba(30, 41, 59, 0.85);
    border-color: rgba(255,255,255,.06);
}

.result-image-column {
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.result-image-box {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.result-image-small {
    width: 100%;
    max-width: 280px;
    height: auto;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    object-fit: cover;
    animation: zoomIn 0.5s ease-out;
    border: 3px solid var(--gray-100);
}

body.dark-mode .result-image-small {
    border-color: rgba(255,255,255,.08);
}

.no-image {
    width: 100%;
    max-width: 280px;
    height: 260px;
    background: var(--gray-100);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--gray-400);
    gap: 12px;
    border: 2px dashed var(--gray-200);
}

body.dark-mode .no-image {
    background: rgba(0,0,0,.3);
    border-color: rgba(255,255,255,.08);
}

.no-image i { font-size: 36px; opacity: .5; }

.result-info-column {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.result-header h2 {
    font-size: 32px;
    font-weight: 800;
    color: var(--navy-800);
    letter-spacing: -0.5px;
    line-height: 1.2;
}

body.dark-mode .result-header h2 { color: #f1f5f9; }

.result-status {}

.status-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 10px;
}

.badge-result {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: var(--shadow-md);
}

.badge-result.healthy {
    background: linear-gradient(135deg, var(--green-500) 0%, var(--green-700) 100%);
    color: white;
}

.badge-result.diseased {
    background: linear-gradient(135deg, var(--red-500) 0%, #b91c1c 100%);
    color: white;
}

/* Confidence Bar */
.confidence-section {}

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

.confidence-header span:first-child {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--gray-400);
}

.confidence-value {
    font-size: 22px;
    font-weight: 800;
    color: var(--green-600);
    letter-spacing: -0.5px;
}

body.dark-mode .confidence-value { color: var(--green-400); }

.progress-box {
    width: 100%;
    height: 12px;
    background: var(--gray-100);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: 10px;
}

body.dark-mode .progress-box { background: rgba(0,0,0,.3); }

.progress {
    height: 100%;
    border-radius: var(--radius-full);
    transition: width 1.5s cubic-bezier(0.23, 1, 0.32, 1);
    position: relative;
    overflow: hidden;
}

/* Hide the inline percentage text inside the bar — it's shown via confidenceText above */
.progress #progressValue {
    display: none;
}

.confidence-indicator {
    font-size: 13px;
    color: var(--gray-500);
    display: flex;
    align-items: center;
    gap: 6px;
}

body.dark-mode .confidence-indicator { color: var(--gray-400); }

.indicator-text {
    display: flex;
    align-items: center;
    gap: 6px;
}

.indicator-text i {
    font-size: 14px;
    color: var(--green-500);
}

/* Buttons */
.action-buttons {
    display: flex;
    gap: 12px;
}

.btn {
    padding: 14px 24px;
    border-radius: var(--radius-md);
    text-decoration: none;
    text-align: center;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all var(--transition);
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
    letter-spacing: 0.2px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--green-500) 0%, var(--green-700) 100%);
    color: white;
    box-shadow: var(--shadow-green);
    flex: 1;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 36px rgba(34,197,94,.4);
}

.btn-secondary {
    display: none;
}

/* === DISEASE DETAIL SECTION === */
.disease-detail-section {
    background: var(--white);
    padding: 40px;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    margin-bottom: 32px;
    border: 1px solid var(--gray-100);
    animation: fadeUp 0.5s ease-out 0.1s both;
}

body.dark-mode .disease-detail-section {
    background: rgba(30, 41, 59, 0.85);
    border-color: rgba(255,255,255,.06);
}

.detail-header {
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--gray-100);
}

body.dark-mode .detail-header { border-bottom-color: rgba(255,255,255,.06); }

.detail-header h3 {
    font-size: 24px;
    font-weight: 800;
    color: var(--navy-800);
    letter-spacing: -0.3px;
}

body.dark-mode .detail-header h3 { color: #f1f5f9; }

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.detail-card {
    background: var(--gray-50);
    padding: 24px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-100);
    transition: all var(--transition);
}

body.dark-mode .detail-card {
    background: rgba(15, 23, 42, 0.5);
    border-color: rgba(255,255,255,.05);
}

.detail-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: rgba(34,197,94,.2);
}

.detail-icon {
    font-size: 28px;
    color: var(--green-500);
    margin-bottom: 12px;
}

.detail-card h4 {
    font-size: 15px;
    font-weight: 700;
    color: var(--navy-800);
    margin-bottom: 14px;
}

body.dark-mode .detail-card h4 { color: #f1f5f9; }

.detail-list {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.detail-list li {
    font-size: 13.5px;
    color: var(--gray-500);
    padding-left: 22px;
    position: relative;
    line-height: 1.55;
}

body.dark-mode .detail-list li { color: var(--gray-400); }

.detail-list i {
    position: absolute;
    left: 0;
    top: 2px;
    color: var(--green-500);
    font-size: 12px;
}

/* === RECOMMENDATIONS SECTION === */
.recommendations-section {
    background: var(--white);
    padding: 40px;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--gray-100);
    animation: fadeUp 0.5s ease-out 0.2s both;
}

body.dark-mode .recommendations-section {
    background: rgba(30, 41, 59, 0.85);
    border-color: rgba(255,255,255,.06);
}

.recommendations-section h3 {
    font-size: 20px;
    font-weight: 800;
    color: var(--navy-800);
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: -0.3px;
}

body.dark-mode .recommendations-section h3 { color: #f1f5f9; }
.recommendations-section h3 i { color: var(--green-500); }

.recommendations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

.recommendation-item {
    background: var(--gray-50);
    padding: 24px;
    border-radius: var(--radius-lg);
    border-left: 3px solid var(--green-500);
    position: relative;
    transition: all var(--transition);
}

body.dark-mode .recommendation-item { background: rgba(15,23,42,.5); }

.recommendation-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.recom-number {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, var(--green-500) 0%, var(--green-700) 100%);
    border-radius: 50%;
    color: white;
    font-weight: 800;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.recommendation-item p {
    color: var(--navy-800);
    font-size: 14px;
    line-height: 1.6;
    margin: 0;
    padding-right: 44px;
}

body.dark-mode .recommendation-item p { color: #e2e8f0; }

/* === FOOTER === */
.footer {
    background: var(--navy-800);
    color: var(--gray-400);
    padding: 72px 24px 28px;
}

body.dark-mode .footer {
    background: var(--navy-900);
    border-top: 1px solid rgba(255,255,255,.05);
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.8fr 1fr 1.2fr;
    gap: 48px;
}

.footer-col h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.footer-col h3 i { color: var(--green-400); }

.footer-col h4 {
    font-size: 14px;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.footer-col p {
    font-size: 14px;
    line-height: 1.75;
    color: var(--gray-400);
    max-width: 360px;
}

.footer-links ul {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-links a {
    color: var(--gray-400);
    text-decoration: none;
    font-size: 14px;
    transition: all var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.footer-links a::before {
    content: '›';
    color: var(--green-500);
    font-size: 16px;
    line-height: 1;
}

.footer-links a:hover {
    color: var(--green-400);
    padding-left: 4px;
}

.footer-contact p {
    margin-bottom: 10px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.footer-contact i { color: var(--green-400); flex-shrink: 0; }

.footer-social {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}

.footer-social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255,255,255,.07);
    color: var(--white);
    font-size: 15px;
    text-decoration: none;
    transition: all var(--transition);
    border: 1px solid rgba(255,255,255,.08);
}

.footer-social a:hover {
    background: var(--green-600);
    border-color: var(--green-600);
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(34,197,94,.3);
}

.footer-bottom {
    max-width: 1200px;
    margin: 48px auto 0;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,.07);
    text-align: center;
    font-size: 13px;
    color: var(--gray-500);
}

.footer-bottom strong { color: var(--green-400); }

/* === LOADING SCREEN === */
.loading {
    position: fixed;
    inset: 0;
    background: rgba(10, 14, 26, 0.97);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    backdrop-filter: blur(8px);
}

.loader-box {
    text-align: center;
    color: white;
    animation: fadeUp 0.5s ease-out;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.spinner {
    width: 56px;
    height: 56px;
    border: 4px solid rgba(34,197,94,.2);
    border-top-color: var(--green-400);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loader-box h3 {
    font-size: 22px;
    font-weight: 700;
    color: var(--white);
}

.loader-box p {
    font-size: 14px;
    color: rgba(255,255,255,.55);
}

/* === RESPONSIVE === */

@media (max-width: 900px) {
    .result-card {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .footer-container {
        grid-template-columns: 1fr 1fr;
    }

    .footer-col.footer-brand {
        grid-column: 1 / -1;
    }
}

@media (max-width: 768px) {
    .section { padding: 64px 20px; }

    .hero {
        padding: 60px 20px;
        min-height: auto;
    }

    .hero-content { gap: 36px; }

    .upload-box { padding: 28px; }

    .upload-label { padding: 28px 20px; }

    .upload-icon-wrapper {
        width: 60px;
        height: 60px;
        font-size: 28px;
    }

    .result-card,
    .disease-detail-section,
    .recommendations-section {
        padding: 28px 20px;
    }

    .detail-grid { grid-template-columns: 1fr; }
    .recommendations-grid { grid-template-columns: 1fr; }

    .diseases-grid-single-row {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }

    .model-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .nav-links { display: none; }

    .section { padding: 56px 16px; }

    .hero { padding: 56px 16px; }

    .upload-box { padding: 20px 16px; }
    .upload-label { padding: 24px 16px; }
    .upload-icon-wrapper { width: 52px; height: 52px; font-size: 24px; }
    .upload-text { font-size: 15px; }

    .diseases-grid-single-row { grid-template-columns: 1fr; gap: 14px; }

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

    .cards-grid { gap: 16px; }
    .card-feature { padding: 28px 20px; }

    .result-card { padding: 20px 16px; }
    .result-header h2 { font-size: 24px; }

    .result-image-small { max-width: 200px; }
    .no-image { max-width: 200px; height: 200px; }

    .detail-card { padding: 18px 16px; }
    .recommendation-item { padding: 18px 16px; }
    .recommendation-item p { font-size: 13px; padding-right: 40px; }

    .footer-container {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .footer-col.footer-brand { grid-column: 1; }

    .btn { padding: 13px 20px; font-size: 13px; }
}

/* === PRINT === */
@media print {
    .navbar, .action-buttons, .loading { display: none; }
    .result-card { box-shadow: none; border: 1px solid #ddd; }
}
