/* ==========================================
   AI DOCTOR+ — DRAIPLUS THEME
   Light Blue Glassmorphism (matching DR.AI+)
   ========================================== */

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

:root {
    --primary: #3B82F6;
    --primary-dark: #1E3A5F;
    --accent: #93C5FD;
    --bg: #EEF4FF;
    --bg-gradient: linear-gradient(135deg, #dbeafe, #eff6ff, #e0f2fe);
    --text-main: #1E3A5F;
    --text-sub: #64748B;
    --text-light: #94a3b8;
    --glass-bg: rgba(255,255,255,0.45);
    --glass-bg-hover: rgba(255,255,255,0.6);
    --glass-border: rgba(255,255,255,0.6);
    --glass-shadow: 0 8px 32px rgba(59,130,246,0.12);
    --glow: rgba(59,130,246,0.4);
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --rose: #f43f5e;
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 18px;
    --radius-xl: 24px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color-scheme: light;

    /* Theme Toggle */
    --theme-toggle-bg: rgba(59, 130, 246, 0.08);
    --theme-toggle-border: rgba(59, 130, 246, 0.2);
    --theme-toggle-bg-hover: rgba(59, 130, 246, 0.15);
    --theme-toggle-border-hover: rgba(59, 130, 246, 0.3);

    /* Grid dot */
    --grid-dot-color: rgba(59, 130, 246, 0.05);

    /* Header */
    --header-bg: rgba(255, 255, 255, 0.7);
    --header-border: rgba(59, 130, 246, 0.12);
    --header-shadow: 0 4px 30px rgba(59, 130, 246, 0.06);

    /* Input */
    --input-bg: rgba(255, 255, 255, 0.6);
    --input-bg-focus: rgba(255, 255, 255, 0.8);
    --input-border: rgba(59, 130, 246, 0.15);

    /* Buttons */
    --btn-upload-bg: rgba(59, 130, 246, 0.08);
    --btn-upload-text: var(--primary);
    --btn-upload-border: rgba(59, 130, 246, 0.2);

    --btn-cam-start-bg: rgba(16, 185, 129, 0.08);
    --btn-cam-start-text: #059669;
    --btn-cam-start-border: rgba(16, 185, 129, 0.2);

    --btn-cam-stop-bg: rgba(239, 68, 68, 0.08);
    --btn-cam-stop-text: #dc2626;
    --btn-cam-stop-border: rgba(239, 68, 68, 0.2);

    --btn-capture-bg: rgba(245, 158, 11, 0.08);
    --btn-capture-text: #d97706;
    --btn-capture-border: rgba(245, 158, 11, 0.2);

    --btn-save-bg: rgba(255, 255, 255, 0.5);
    --btn-save-bg-hover: rgba(255, 255, 255, 0.7);
    --btn-save-border: rgba(59, 130, 246, 0.12);
    --btn-save-text: var(--text-sub);
    --btn-save-text-hover: var(--text-main);

    /* Model Options */
    --model-option-hover: rgba(59, 130, 246, 0.05);
    --model-option-selected: rgba(59, 130, 246, 0.08);
    --model-option-border: rgba(59, 130, 246, 0.2);

    /* Image Panel */
    --image-display-bg: rgba(255, 255, 255, 0.2);

    /* Result Panel */
    --result-warning-bg: rgba(255, 251, 235, 0.5);
    --result-critical-bg: rgba(254, 242, 242, 0.5);
    --result-normal-bg: rgba(236, 253, 245, 0.5);

    /* Diagnosis Section */
    --diagnosis-section-bg: rgba(255, 255, 255, 0.4);
    --diagnosis-section-border: rgba(59, 130, 246, 0.08);
    --rec-hover-bg: rgba(59, 130, 246, 0.04);

    /* Medical Disclaimer */
    --disclaimer-bg: rgba(245, 158, 11, 0.05);
    --disclaimer-border: rgba(245, 158, 11, 0.2);

    /* Logo Gradient stops */
    --logo-grad-start: #1E3A5F;
    --logo-grad-end: #3B82F6;

    /* Card Hovers */
    --card-hover-border: rgba(59, 130, 246, 0.2);
    --card-hover-shadow: 0 12px 40px rgba(59, 130, 246, 0.12);

    /* Toasts */
    --toast-success-bg: rgba(236, 253, 245, 0.9);
    --toast-success-border: rgba(16, 185, 129, 0.25);
    --toast-success-text: #059669;

    --toast-error-bg: rgba(254, 242, 242, 0.9);
    --toast-error-border: rgba(239, 68, 68, 0.25);
    --toast-error-text: #dc2626;

    --toast-info-bg: rgba(239, 246, 255, 0.9);
    --toast-info-border: rgba(59, 130, 246, 0.2);
    --toast-info-text: var(--primary);
}

body.dark-mode {
    color-scheme: dark;
    --primary: #3B82F6;
    --primary-dark: #60a5fa;
    --accent: #1e3a8a;
    --bg: #090d16;
    --bg-gradient: linear-gradient(135deg, #090d16, #0d1527, #070a12);
    --text-main: #f1f5f9;
    --text-sub: #cbd5e1;
    --text-light: #94a3b8;
    
    --glass-bg: rgba(15, 23, 42, 0.45);
    --glass-bg-hover: rgba(15, 23, 42, 0.6);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.37);
    --glow: rgba(59, 130, 246, 0.2);

    /* Theme Toggle */
    --theme-toggle-bg: rgba(255, 255, 255, 0.06);
    --theme-toggle-border: rgba(255, 255, 255, 0.15);
    --theme-toggle-bg-hover: rgba(255, 255, 255, 0.12);
    --theme-toggle-border-hover: rgba(255, 255, 255, 0.25);

    /* Grid dot */
    --grid-dot-color: rgba(59, 130, 246, 0.12);

    /* Header */
    --header-bg: rgba(15, 23, 42, 0.7);
    --header-border: rgba(255, 255, 255, 0.08);
    --header-shadow: 0 4px 30px rgba(0, 0, 0, 0.2);

    /* Input */
    --input-bg: rgba(15, 23, 42, 0.5);
    --input-bg-focus: rgba(15, 23, 42, 0.7);
    --input-border: rgba(255, 255, 255, 0.12);

    /* Buttons */
    --btn-upload-bg: rgba(59, 130, 246, 0.15);
    --btn-upload-text: #60a5fa;
    --btn-upload-border: rgba(59, 130, 246, 0.35);

    --btn-cam-start-bg: rgba(16, 185, 129, 0.15);
    --btn-cam-start-text: #34d399;
    --btn-cam-start-border: rgba(16, 185, 129, 0.3);

    --btn-cam-stop-bg: rgba(239, 68, 68, 0.15);
    --btn-cam-stop-text: #f87171;
    --btn-cam-stop-border: rgba(239, 68, 68, 0.3);

    --btn-capture-bg: rgba(245, 158, 11, 0.15);
    --btn-capture-text: #fb923c;
    --btn-capture-border: rgba(245, 158, 11, 0.3);

    --btn-save-bg: rgba(30, 41, 59, 0.5);
    --btn-save-bg-hover: rgba(30, 41, 59, 0.7);
    --btn-save-border: rgba(255, 255, 255, 0.08);
    --btn-save-text: var(--text-sub);
    --btn-save-text-hover: var(--text-main);

    /* Model Options */
    --model-option-hover: rgba(255, 255, 255, 0.03);
    --model-option-selected: rgba(59, 130, 246, 0.15);
    --model-option-border: rgba(59, 130, 246, 0.3);

    /* Image Panel */
    --image-display-bg: rgba(0, 0, 0, 0.2);

    /* Result Panel */
    --result-warning-bg: rgba(245, 158, 11, 0.08);
    --result-critical-bg: rgba(239, 68, 68, 0.08);
    --result-normal-bg: rgba(16, 185, 129, 0.08);

    /* Diagnosis Section */
    --diagnosis-section-bg: rgba(15, 23, 42, 0.4);
    --diagnosis-section-border: rgba(255, 255, 255, 0.06);
    --rec-hover-bg: rgba(59, 130, 246, 0.08);

    /* Medical Disclaimer */
    --disclaimer-bg: rgba(245, 158, 11, 0.08);
    --disclaimer-border: rgba(245, 158, 11, 0.3);

    /* Logo Gradient stops */
    --logo-grad-start: #3B82F6;
    --logo-grad-end: #60a5fa;

    /* Card Hovers */
    --card-hover-border: rgba(96, 165, 250, 0.3);
    --card-hover-shadow: 0 12px 40px rgba(0, 0, 0, 0.4), 0 0 15px rgba(59, 130, 246, 0.15);

    /* Toasts */
    --toast-success-bg: rgba(6, 78, 59, 0.95);
    --toast-success-border: rgba(16, 185, 129, 0.3);
    --toast-success-text: #34d399;

    --toast-error-bg: rgba(127, 29, 29, 0.95);
    --toast-error-border: rgba(239, 68, 68, 0.3);
    --toast-error-text: #fca5a5;

    --toast-info-bg: rgba(30, 58, 138, 0.95);
    --toast-info-border: rgba(59, 130, 246, 0.3);
    --toast-info-text: #93c5fd;
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-gradient);
    background-attachment: fixed;
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

/* Dot grid overlay */
body::after {
    content: ''; position: fixed; inset: 0; z-index: 0; pointer-events: none;
    background-image: radial-gradient(circle, var(--grid-dot-color) 1px, transparent 1px);
    background-size: 32px 32px;
}

/* Grain overlay */
body::before {
    content: ''; position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: 0.02;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

/* === BACKGROUND PARTICLES === */
.bg-particles {
    position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden;
}

.particle {
    position: absolute; border-radius: 50%; filter: blur(60px); opacity: 0.12;
    animation: float 20s infinite ease-in-out;
}
.particle:nth-child(1) { background: #93C5FD; width: 350px; height: 350px; top: -10%; left: -5%; }
.particle:nth-child(2) { background: #3B82F6; width: 300px; height: 300px; top: 50%; right: -10%; animation-delay: -5s; }
.particle:nth-child(3) { background: #60a5fa; width: 280px; height: 280px; bottom: -10%; left: 30%; animation-delay: -10s; }
.particle:nth-child(4) { background: #2563EB; width: 200px; height: 200px; top: 20%; left: 60%; animation-delay: -3s; }
.particle:nth-child(5) { background: #93C5FD; width: 250px; height: 250px; bottom: 20%; right: 20%; animation-delay: -7s; }
.particle:nth-child(6) { background: #bfdbfe; width: 180px; height: 180px; top: 60%; left: 10%; animation-delay: -12s; }

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(30px, -30px) scale(1.1); }
    50% { transform: translate(-20px, 20px) scale(0.95); }
    75% { transform: translate(15px, 10px) scale(1.05); }
}

/* === HEADER === */
.app-header {
    position: sticky; top: 0; z-index: 100;
    background: var(--header-bg);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--header-border);
    box-shadow: var(--header-shadow);
}

.header-inner {
    max-width: 1400px; margin: 0 auto; padding: 12px 24px;
    display: flex; align-items: center; justify-content: space-between;
}

.logo-group { display: flex; align-items: center; gap: 10px; }

.logo-icon { flex-shrink: 0; animation: float-icon 3s ease-in-out infinite; }
@keyframes float-icon {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-4px); }
}

.logo-text {
    font-size: 1.4rem; font-weight: 900; letter-spacing: -0.5px;
    color: var(--primary-dark); text-transform: uppercase;
}
.logo-plus { color: var(--primary); }

.logo-sub {
    font-size: 0.65rem; color: var(--text-sub); font-weight: 500;
    letter-spacing: 0.5px; text-transform: uppercase;
}

.header-status {
    display: flex; align-items: center; gap: 6px;
    padding: 5px 14px;
    background: rgba(59,130,246,0.08);
    border: 1px solid rgba(59,130,246,0.2);
    border-radius: 100px;
    font-size: 9px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase;
    color: var(--primary-dark);
    animation: badge-glow 3s ease-in-out infinite;
}
@keyframes badge-glow {
    0%, 100% { box-shadow: 0 0 0px rgba(59,130,246,0); }
    50% { box-shadow: 0 0 12px rgba(59,130,246,0.3); }
}

.status-dot {
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--success); animation: blink 2s infinite;
}
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

.status-text { font-size: inherit; color: inherit; font-weight: inherit; }

/* === MAIN LAYOUT === */
.app-main {
    position: relative; z-index: 1;
    max-width: 1400px; margin: 0 auto; padding: 24px;
    display: grid; grid-template-columns: 300px 1fr; gap: 24px;
    min-height: calc(100vh - 70px);
}

/* === SIDEBAR === */
.sidebar { display: flex; flex-direction: column; gap: 14px; }

/* === GLASS CARDS === */
.card {
    background: var(--glass-bg);
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: var(--radius-lg); padding: 16px;
    transition: var(--transition); position: relative; overflow: hidden;
}

/* Shine effect */
.card::after {
    content: ''; position: absolute; top: -50%; left: -80%; width: 50%; height: 200%;
    background: linear-gradient(105deg, transparent 40%, rgba(255,255,255,0.25) 50%, transparent 60%);
    transform: skewX(-20deg); transition: left 0.6s ease; pointer-events: none; z-index: 5;
}
.card:hover::after { left: 120%; }

.card:hover {
    background: var(--glass-bg-hover);
    box-shadow: 0 0 0 2px var(--card-hover-border), var(--card-hover-shadow);
    transform: translateY(-1px);
}

.card-header {
    display: flex; align-items: center; gap: 8px; margin-bottom: 12px;
    font-size: 10px; font-weight: 800; color: var(--text-sub);
    text-transform: uppercase; letter-spacing: 1.5px;
}
.card-header svg { color: var(--primary); }

/* === INPUT === */
.input-field {
    width: 100%; padding: 10px 14px;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: var(--radius-sm);
    color: var(--text-main); font-family: inherit; font-size: 0.875rem;
    outline: none; transition: var(--transition);
}
.input-field::placeholder { color: var(--text-light); }
.input-field:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--glow);
    background: var(--input-bg-focus);
}

/* === MODEL SELECTION === */
.model-list { display: flex; flex-direction: column; gap: 5px; }

.model-option {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; border-radius: var(--radius-sm);
    cursor: pointer; transition: var(--transition);
    border: 1px solid transparent; position: relative;
}
.model-option input[type="radio"] { display: none; }

.model-radio-dot {
    width: 16px; height: 16px; border-radius: 50%;
    border: 2px solid var(--text-light);
    transition: var(--transition); flex-shrink: 0; position: relative;
}
.model-radio-dot::after {
    content: ''; position: absolute; inset: 3px; border-radius: 50%;
    background: var(--primary); transform: scale(0); transition: var(--transition);
}

.model-option:hover { background: var(--model-option-hover); }

.model-option.selected {
    background: var(--model-option-selected);
    border-color: var(--model-option-border);
}
.model-option.selected .model-radio-dot { border-color: var(--primary); }
.model-option.selected .model-radio-dot::after { transform: scale(1); }

.model-icon { font-size: 1.2rem; flex-shrink: 0; }
.model-info { display: flex; flex-direction: column; gap: 1px; }
.model-name { font-size: 0.82rem; font-weight: 700; color: var(--text-main); }
.model-tag { font-size: 0.6rem; color: var(--text-sub); text-transform: uppercase; letter-spacing: 1px; font-weight: 600; }

/* === BUTTONS === */
.btn {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    padding: 10px 16px; border: none; border-radius: var(--radius-sm);
    font-family: inherit; font-size: 0.8rem; font-weight: 700;
    cursor: pointer; transition: var(--transition); width: 100%;
    text-transform: uppercase; letter-spacing: 0.5px;
}
.btn:active { transform: scale(0.97); }

.action-buttons { display: flex; flex-direction: column; gap: 7px; }
.btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }

.btn-upload {
    background: var(--btn-upload-bg); color: var(--btn-upload-text);
    border: 1px solid var(--btn-upload-border);
}
.btn-upload:hover {
    background: rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.4);
    box-shadow: 0 0 20px var(--glow);
}

.btn-cam-start {
    background: var(--btn-cam-start-bg); color: var(--btn-cam-start-text);
    border: 1px solid var(--btn-cam-start-border);
}
.btn-cam-start:hover { background: rgba(16, 185, 129, 0.2); border-color: rgba(16, 185, 129, 0.4); }

.btn-cam-stop {
    background: var(--btn-cam-stop-bg); color: var(--btn-cam-stop-text);
    border: 1px solid var(--btn-cam-stop-border);
}
.btn-cam-stop:hover { background: rgba(239, 68, 68, 0.2); border-color: rgba(239, 68, 68, 0.4); }

.btn-capture {
    background: var(--btn-capture-bg); color: var(--btn-capture-text);
    border: 1px solid var(--btn-capture-border);
}
.btn-capture:hover { background: rgba(245, 158, 11, 0.2); border-color: rgba(245, 158, 11, 0.4); }

/* Predict button - gradient like draiplus CTA */
.btn-predict {
    padding: 0;
    background: linear-gradient(-45deg, #1E3A5F, #3B82F6, #2563EB, #1D4ED8);
    background-size: 300% 300%;
    animation: gradient-shift 8s ease infinite;
    color: white; font-size: 0.9rem; border-radius: var(--radius-md);
    position: relative; overflow: hidden;
    box-shadow: 0 6px 25px rgba(59,130,246,0.35);
}
@keyframes gradient-shift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}
.btn-predict:hover {
    box-shadow: 0 8px 35px rgba(59,130,246,0.5);
    transform: translateY(-2px);
}
.btn-predict:active { transform: translateY(0) scale(0.98); }

.btn-predict-inner, .btn-predict-loading {
    display: flex; align-items: center; justify-content: center;
    gap: 10px; padding: 14px 20px; width: 100%;
}
.btn-predict.loading .btn-predict-inner { display: none; }
.btn-predict.loading .btn-predict-loading { display: flex !important; }

.spinner {
    width: 18px; height: 18px;
    border: 3px solid rgba(255,255,255,0.3);
    border-top-color: white; border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.btn-save {
    background: var(--btn-save-bg); color: var(--btn-save-text);
    border: 1px solid var(--btn-save-border);
}
.btn-save:hover {
    background: var(--btn-save-bg-hover);
    border-color: rgba(59,130,246,0.25);
    color: var(--btn-save-text-hover);
}

/* === MAIN CONTENT === */
.main-content { display: flex; flex-direction: column; gap: 20px; }

/* === IMAGE PANEL === */
.image-panel {
    flex: 1; display: flex; flex-direction: column;
    background: var(--glass-bg);
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: var(--radius-xl); overflow: hidden;
}

.image-panel-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 20px; border-bottom: 1px solid rgba(59,130,246,0.08);
}
.image-panel-header h2 {
    font-size: 10px; font-weight: 800; letter-spacing: 2px;
    color: var(--text-sub); text-transform: uppercase;
}

.image-badge {
    font-size: 9px; padding: 3px 10px; border-radius: 100px;
    background: rgba(59,130,246,0.06); color: var(--text-light);
    font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase;
}
.image-badge.has-image {
    background: rgba(16, 185, 129, 0.08); color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.image-display {
    flex: 1; display: flex; align-items: center; justify-content: center;
    padding: 20px; min-height: 400px; position: relative;
    background: var(--image-display-bg);
}
.image-display img, .image-display video {
    max-width: 100%; max-height: 100%; object-fit: contain;
    border-radius: var(--radius-sm);
}
.image-display video { transform: scaleX(-1); }

.image-placeholder {
    display: flex; flex-direction: column; align-items: center;
    gap: 12px; color: var(--text-light);
}
.image-placeholder svg { color: rgba(59,130,246,0.2); }
.image-placeholder p { font-size: 0.95rem; font-weight: 600; color: var(--text-sub); }
.image-placeholder span { font-size: 0.7rem; opacity: 0.6; }

/* === RESULT PANEL === */
.result-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: var(--radius-lg); padding: 20px;
    transition: var(--transition);
}

.result-panel.result-warning {
    border-color: rgba(245, 158, 11, 0.35);
    box-shadow: 0 0 30px rgba(245, 158, 11, 0.08);
    background: var(--result-warning-bg);
}
.result-panel.result-critical {
    border-color: rgba(239, 68, 68, 0.35);
    box-shadow: 0 0 40px rgba(239, 68, 68, 0.1);
    background: var(--result-critical-bg);
}
.result-panel.result-normal {
    border-color: rgba(16, 185, 129, 0.3);
    box-shadow: 0 0 30px rgba(16, 185, 129, 0.08);
    background: var(--result-normal-bg);
}

.result-header { display: flex; align-items: center; gap: 14px; }
.result-header-text { flex: 1; min-width: 0; }

.result-icon {
    width: 48px; height: 48px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: rgba(59,130,246,0.08);
    color: var(--text-light); flex-shrink: 0; transition: var(--transition);
}
.result-panel.result-warning .result-icon { background: rgba(245,158,11,0.1); color: var(--warning); }
.result-panel.result-critical .result-icon {
    background: rgba(239,68,68,0.1); color: var(--danger);
    animation: pulse-critical 2s infinite;
}
@keyframes pulse-critical {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0.25); }
    50% { box-shadow: 0 0 0 8px rgba(239,68,68,0); }
}
.result-panel.result-normal .result-icon { background: rgba(16,185,129,0.1); color: var(--success); }

.result-label {
    font-size: 9px; font-weight: 800; letter-spacing: 1.5px;
    color: var(--text-light); text-transform: uppercase;
}
.result-text {
    font-size: 1.2rem; font-weight: 800; color: var(--text-sub);
    margin-top: 2px; transition: var(--transition);
}
.result-panel.result-warning .result-text { color: var(--warning); }
.result-panel.result-critical .result-text { color: var(--danger); }
.result-panel.result-normal .result-text { color: var(--success); }
.result-panel.result-analyzing .result-text { color: var(--primary); }

/* Severity Badge */
.severity-badge {
    padding: 5px 12px; border-radius: 100px;
    font-size: 9px; font-weight: 800; text-transform: uppercase;
    letter-spacing: 1px; white-space: nowrap; flex-shrink: 0;
}
.severity-badge.severity-critical {
    background: rgba(239,68,68,0.1); color: var(--danger);
    border: 1px solid rgba(239,68,68,0.25); animation: pulse-badge 2s infinite;
}
@keyframes pulse-badge { 0%, 100% { opacity: 1; } 50% { opacity: 0.6; } }
.severity-badge.severity-high {
    background: rgba(245,158,11,0.1); color: var(--warning);
    border: 1px solid rgba(245,158,11,0.25);
}
.severity-badge.severity-normal {
    background: rgba(16,185,129,0.08); color: var(--success);
    border: 1px solid rgba(16,185,129,0.2);
}
.severity-badge.severity-warning {
    background: rgba(245,158,11,0.1); color: var(--warning);
    border: 1px solid rgba(245,158,11,0.25);
}

/* Result Meta */
.result-meta {
    display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px;
    margin-top: 16px; padding-top: 16px;
    border-top: 1px solid rgba(59,130,246,0.08);
}
.meta-item { display: flex; flex-direction: column; gap: 2px; }
.meta-label {
    font-size: 9px; color: var(--text-light); text-transform: uppercase;
    letter-spacing: 1px; font-weight: 700;
}
.meta-value { font-size: 0.82rem; font-weight: 800; color: var(--text-main); }

/* === DIAGNOSIS DETAIL === */
.diagnosis-detail {
    margin-top: 20px; padding-top: 20px;
    border-top: 1px solid rgba(59,130,246,0.08);
    display: flex; flex-direction: column; gap: 16px;
    animation: fadeInUp 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes fadeInUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

.diagnosis-section {
    background: var(--diagnosis-section-bg);
    border: 1px solid var(--diagnosis-section-border);
    border-radius: var(--radius-md); padding: 16px;
    backdrop-filter: blur(8px);
}
.diagnosis-section-header {
    display: flex; align-items: center; gap: 8px; margin-bottom: 10px;
    font-size: 10px; font-weight: 800; color: var(--primary);
    text-transform: uppercase; letter-spacing: 1.2px;
}
.diagnosis-section-header svg { flex-shrink: 0; }

.diagnosis-description { font-size: 0.88rem; line-height: 1.7; color: var(--text-sub); }

/* Findings List */
.findings-list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.findings-list li {
    display: flex; align-items: flex-start; gap: 10px;
    font-size: 0.82rem; color: var(--text-sub); line-height: 1.5; padding: 5px 0;
}
.findings-list li::before {
    content: ''; width: 6px; height: 6px; border-radius: 50%;
    background: var(--primary); flex-shrink: 0; margin-top: 7px;
}
.result-panel.result-critical .findings-list li::before { background: var(--danger); }
.result-panel.result-normal .findings-list li::before { background: var(--success); }

/* Recommendations */
.section-recommendations {
    border-color: rgba(59,130,246,0.12);
    background: rgba(59,130,246,0.03);
}
.result-panel.result-critical .section-recommendations {
    border-color: rgba(239,68,68,0.12);
    background: rgba(239,68,68,0.02);
}

.recommendations-list {
    list-style: none; padding: 0; counter-reset: rec-counter;
    display: flex; flex-direction: column; gap: 8px;
}
.recommendations-list li {
    counter-increment: rec-counter;
    display: flex; align-items: flex-start; gap: 12px;
    font-size: 0.82rem; color: var(--text-sub); line-height: 1.6;
    padding: 8px 10px; border-radius: var(--radius-sm); transition: var(--transition);
}
.recommendations-list li:hover { background: var(--rec-hover-bg); }

.recommendations-list li::before {
    content: counter(rec-counter);
    display: flex; align-items: center; justify-content: center;
    min-width: 22px; height: 22px; border-radius: 50%;
    background: rgba(59,130,246,0.1); color: var(--primary);
    font-size: 0.65rem; font-weight: 800; flex-shrink: 0; margin-top: 2px;
}
.result-panel.result-critical .recommendations-list li::before {
    background: rgba(239,68,68,0.1); color: var(--danger);
}
.recommendations-list li.rec-urgent {
    background: rgba(239,68,68,0.04); border: 1px solid rgba(239,68,68,0.12);
    color: var(--danger); font-weight: 700;
}
.recommendations-list li.rec-urgent::before { background: var(--danger); color: white; }

/* Medical Disclaimer */
.medical-disclaimer {
    display: flex; gap: 14px; padding: 16px 18px;
    background: var(--disclaimer-bg);
    border: 1px solid var(--disclaimer-border);
    border-radius: var(--radius-md); align-items: flex-start;
}
.disclaimer-icon { flex-shrink: 0; color: var(--warning); margin-top: 2px; }
.disclaimer-content strong {
    display: block; font-size: 10px; font-weight: 800;
    color: var(--warning); letter-spacing: 1.2px;
    margin-bottom: 6px; text-transform: uppercase;
}
.disclaimer-content p { font-size: 0.78rem; line-height: 1.7; color: var(--text-sub); }

/* === TOAST === */
.toast-container {
    position: fixed; top: 80px; right: 24px; z-index: 1000;
    display: flex; flex-direction: column; gap: 8px;
}
.toast {
    padding: 10px 18px; border-radius: var(--radius-sm);
    font-size: 0.82rem; font-weight: 600;
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    animation: slideInRight 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    max-width: 380px; display: flex; align-items: center; gap: 8px;
}
.toast-success {
    background: var(--toast-success-bg); border: 1px solid var(--toast-success-border); color: var(--toast-success-text);
}
.toast-error {
    background: var(--toast-error-bg); border: 1px solid var(--toast-error-border); color: var(--toast-error-text);
}
.toast-info {
    background: var(--toast-info-bg); border: 1px solid var(--toast-info-border); color: var(--toast-info-text);
}

@keyframes slideInRight {
    from { transform: translateX(100px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* === DRAG & DROP === */
.image-display.drag-over {
    border: 2px dashed var(--primary);
    background: rgba(59,130,246,0.04);
}
.image-display.drag-over .image-placeholder p { color: var(--primary); }

/* === RESPONSIVE === */
@media (max-width: 1024px) {
    .app-main { grid-template-columns: 1fr; padding: 16px; }
    .sidebar { order: 2; }
    .main-content { order: 1; }
    .image-display { min-height: 300px; }
    .result-meta { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 640px) {
    .header-inner { padding: 10px 16px; }
    .header-status { display: none; }
    .logo-text { font-size: 1.1rem; }
    .btn-row { grid-template-columns: 1fr; }
    .result-meta { grid-template-columns: 1fr 1fr; }
}

/* === SCROLLBAR === */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(59,130,246,0.15); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(59,130,246,0.3); }

/* === IMAGE ANIMATION === */
.image-display img {
    animation: fadeInScale 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes fadeInScale {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

/* === THEME SWITCH & HEADER CONTROLS === */
.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-theme-toggle {
    background: var(--theme-toggle-bg);
    border: 1px solid var(--theme-toggle-border);
    border-radius: 50%;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--primary-dark);
    transition: var(--transition);
    outline: none;
    padding: 0;
}

.btn-theme-toggle:hover {
    background: var(--theme-toggle-bg-hover);
    border-color: var(--theme-toggle-border-hover);
    box-shadow: 0 0 12px var(--glow);
    transform: rotate(30deg) scale(1.05);
}

.btn-theme-toggle:active {
    transform: scale(0.95);
}

/* Light mode icon visibility */
.btn-theme-toggle .icon-sun { display: none; }
.btn-theme-toggle .icon-moon { display: block; }

/* Dark mode icon visibility */
body.dark-mode .btn-theme-toggle .icon-sun { display: block; }
body.dark-mode .btn-theme-toggle .icon-moon { display: none; }
