/* CSS Design System - MS Diagnostic Calculator 2024 Criteria */

:root {
    /* Theme color tokens - Teal/Blue clinical palette */
    --primary-hsl: 195, 85%, 42%;
    --primary: hsl(var(--primary-hsl));
    --primary-light: hsl(195, 85%, 90%);
    --primary-dark: hsl(195, 90%, 30%);
    
    --accent-hsl: 162, 75%, 40%;
    --accent: hsl(var(--accent-hsl));
    --accent-light: hsl(162, 75%, 92%);
    
    --warning-hsl: 38, 92%, 50%;
    --warning: hsl(var(--warning-hsl));
    --warning-light: hsl(38, 92%, 92%);

    --danger-hsl: 0, 84%, 60%;
    --danger: hsl(var(--danger-hsl));
    --danger-light: hsl(0, 84%, 94%);
    
    --neutral-hsl: 210, 16%, 93%;
    --neutral-dark: hsl(210, 24%, 16%);
    
    /* System theme variables (re-mapped on dark mode) */
    --bg-app: #f4f7f6;
    --bg-card: #ffffff;
    --bg-card-hover: #f9fbfb;
    --border-color: #e2e8f0;
    --text-main: #2d3748;
    --text-muted: #718096;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.04);
    --shadow-md: 0 10px 20px rgba(0,0,0,0.06);
    --shadow-lg: 0 20px 40px rgba(0,0,0,0.1);
    
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    --border-radius: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.dark-mode {
    --bg-app: #0f172a;
    --bg-card: #1e293b;
    --bg-card-hover: #334155;
    --border-color: #334155;
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.2);
    --shadow-md: 0 10px 20px rgba(0,0,0,0.25);
    --shadow-lg: 0 20px 40px rgba(0,0,0,0.4);
    
    --primary-light: hsl(195, 50%, 20%);
    --accent-light: hsl(162, 50%, 18%);
    --warning-light: hsl(38, 50%, 18%);
    --danger-light: hsl(0, 50%, 20%);
}

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

body {
    background-color: var(--bg-app);
    color: var(--text-main);
    font-family: var(--font-body);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
}

/* App Header */
.app-header {
    background: linear-gradient(135deg, var(--primary-dark), hsl(195, 90%, 20%));
    color: #ffffff;
    padding: 1.5rem 2rem;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.app-header::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0) 70%);
    border-radius: 50%;
    pointer-events: none;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 1;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.brain-icon {
    font-size: 2.5rem;
    background: linear-gradient(135deg, #a5f3fc, #22d3ee);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 2px 8px rgba(34, 211, 238, 0.4));
    animation: pulse 3s infinite ease-in-out;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.9; }
    50% { transform: scale(1.06); opacity: 1; }
}

.brand-logo h1 {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.version-tag {
    font-size: 0.75rem;
    background-color: var(--accent);
    color: white;
    padding: 2px 8px;
    border-radius: 99px;
    font-weight: 600;
    vertical-align: middle;
}

.subtitle {
    font-size: 0.9rem;
    color: #e2e8f0;
    font-weight: 400;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Disclaimer Banner */
.disclaimer-banner {
    max-width: 1400px;
    margin: 1.5rem auto 0;
    background-color: var(--warning-light);
    border-left: 5px solid var(--warning);
    border-radius: 8px;
    padding: 1rem 1.5rem;
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    box-shadow: var(--shadow-sm);
}

.disclaimer-icon {
    font-size: 1.25rem;
    color: var(--warning);
}

.disclaimer-text {
    font-size: 0.85rem;
    color: var(--text-main);
}

/* Container & Layout */
.app-container {
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding: 0 1.5rem 3rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.layout-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 2rem;
    margin-top: 1.5rem;
}

@media (max-width: 1024px) {
    .layout-grid {
        grid-template-columns: 1fr;
    }
}

/* Cards */
.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.card:hover {
    box-shadow: var(--shadow-lg);
}

.card-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.card-header h2 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    color: var(--primary);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.header-icon {
    font-size: 1.2rem;
}

/* Progress bar inside form card header */
.progress-bar-container {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background-color: var(--border-color);
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Form Sections styling */
.calc-form {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.form-section {
    padding: 2rem 1.5rem;
    display: none;
    flex-direction: column;
    gap: 1.5rem;
    animation: fadeIn 0.4s ease-in-out;
}

.form-section.active {
    display: flex;
}

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

.section-title {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 600;
}

.section-instruction {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: -1rem;
}

/* Custom Radio Cards */
.radio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

.radio-card {
    cursor: pointer;
    position: relative;
}

.radio-card input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.radio-card-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1.5rem 1rem;
    background-color: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    height: 100%;
    transition: var(--transition);
    gap: 0.5rem;
}

.radio-card-content i {
    font-size: 2rem;
    color: var(--text-muted);
    transition: var(--transition);
}

.radio-card-content strong {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    color: var(--text-main);
}

.radio-card-content .desc {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Radio States */
.radio-card input:checked + .radio-card-content {
    border-color: var(--primary);
    background-color: var(--primary-light);
}

.radio-card input:checked + .radio-card-content i {
    color: var(--primary);
    transform: scale(1.1);
}

/* Checkbox item lists */
.checkbox-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.checkbox-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition);
}

.checkbox-item:hover {
    background-color: var(--bg-card-hover);
    border-color: var(--primary);
}

.checkbox-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    border-radius: 6px;
    border: 2px solid var(--border-color);
    accent-color: var(--primary);
    cursor: pointer;
    margin-top: 2px;
}

.checkbox-label-content {
    display: flex;
    flex-direction: column;
}

.checkbox-label-content strong {
    font-size: 0.95rem;
}

.checkbox-label-content .desc {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.text-highlight-2024 {
    border-left: 4px solid var(--accent);
}

.new-tag {
    background-color: var(--accent);
    color: white;
    font-size: 0.65rem;
    padding: 1px 6px;
    border-radius: 4px;
    margin-left: 0.5rem;
    text-transform: uppercase;
    font-weight: 700;
}

.badge-2024 {
    background-color: var(--accent-light);
    color: var(--accent);
    font-size: 0.8rem;
    padding: 2px 8px;
    border-radius: 6px;
    font-weight: 600;
}

/* Form Controls */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.form-group label {
    font-size: 0.95rem;
    font-weight: 600;
}

.form-control {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid var(--border-color);
    background-color: var(--bg-card);
    color: var(--text-main);
    border-radius: 8px;
    font-family: var(--font-body);
    font-size: 0.95rem;
    outline: none;
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(34, 150, 189, 0.2);
}

.help-text {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    gap: 0.25rem;
    align-items: flex-start;
}

.sub-options {
    background-color: var(--bg-card-hover);
    padding: 1.25rem;
    border-radius: 12px;
    border: 1px dashed var(--border-color);
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.hidden {
    display: none !important;
}

/* Checklist Safety Section */
.checklist-safety {
    background-color: var(--danger-light);
    border: 1px solid hsl(0, 50%, 80%);
    border-radius: 12px;
    padding: 1.25rem;
}

.safety-item {
    display: flex;
    gap: 1rem;
    cursor: pointer;
}

.safety-item input {
    margin-top: 4px;
    width: 18px;
    height: 18px;
    accent-color: var(--danger);
}

.safety-text {
    display: flex;
    flex-direction: column;
}

.safety-text strong {
    color: hsl(0, 70%, 40%);
    font-size: 0.95rem;
}

.safety-text .desc {
    font-size: 0.8rem;
    color: var(--text-main);
}

/* Navigation Buttons */
.form-navigation {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    background-color: var(--bg-card-hover);
    margin-top: auto;
}

.btn-primary, .btn-secondary, .btn-icon {
    font-family: var(--font-body);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: var(--transition);
}

.btn-primary {
    background-color: var(--primary);
    color: white;
    font-weight: 600;
    padding: 0.8rem 1.75rem;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(22, 149, 189, 0.3);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(22, 149, 189, 0.4);
}

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

.btn-primary:disabled {
    background-color: var(--border-color);
    color: var(--text-muted);
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.btn-secondary {
    background-color: var(--border-color);
    color: var(--text-main);
    font-weight: 600;
    padding: 0.8rem 1.75rem;
    border-radius: 10px;
}

.btn-secondary:hover:not(:disabled) {
    background-color: var(--text-muted);
    color: white;
}

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

.btn-icon {
    background-color: var(--border-color);
    color: var(--text-main);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.1rem;
}

.btn-icon:hover {
    background-color: var(--primary);
    color: white;
    transform: scale(1.05);
}

/* Results Column styling */
.result-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Outcome Card Container */
.outcome-container {
    padding: 1.5rem;
    border-radius: 14px;
    transition: var(--transition);
    border-left: 6px solid var(--text-muted);
}

.outcome-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.outcome-label {
    text-transform: uppercase;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--text-muted);
}

.outcome-container h3 {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 800;
    line-height: 1.25;
}

.outcome-container p {
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

/* Result Status Variants */
.status-neutral {
    background-color: var(--bg-app);
    border-left-color: var(--text-muted);
}

.status-positive {
    background-color: var(--accent-light);
    border-left-color: var(--accent);
}
.status-positive h3 {
    color: var(--accent);
}

.status-possible {
    background-color: var(--warning-light);
    border-left-color: var(--warning);
}
.status-possible h3 {
    color: var(--warning);
}

.status-negative {
    background-color: var(--danger-light);
    border-left-color: var(--danger);
}
.status-negative h3 {
    color: var(--danger);
}

/* Result Checklist */
.result-checklist h4, 
.brain-visualizer h4, 
.result-details h4, 
.clinical-recommendations h4 {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    color: var(--text-main);
    font-weight: 700;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.result-checklist ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.result-checklist li {
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.icon-gray { color: var(--text-muted); }
.icon-success { color: var(--accent); }
.icon-warning { color: var(--warning); }
.icon-danger { color: var(--danger); }

/* Brain Graphic Container */
.brain-visualizer {
    background-color: var(--bg-card-hover);
    padding: 1.25rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.brain-map-container {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

@media (max-width: 480px) {
    .brain-map-container {
        flex-direction: column;
        align-items: stretch;
    }
}

.brain-graphic {
    flex: 1.2;
    max-width: 180px;
}

.brain-legend {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.legend-color {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 3px;
    vertical-align: middle;
    margin-right: 4px;
    border: 1px solid rgba(0,0,0,0.1);
}

.pv { background-color: #38bdf8; }
.ct { background-color: #818cf8; }
.it { background-color: #fb923c; }
.sc { background-color: #f87171; }
.on { background-color: #34d399; }

.new-text {
    background-color: var(--accent);
    color: white;
    font-size: 0.55rem;
    padding: 0px 4px;
    border-radius: 3px;
    font-weight: 600;
}

/* SVG Brain Map Interactive Nodes */
.map-node {
    fill: #94a3b8;
    stroke: #ffffff;
    stroke-width: 1.5px;
    transition: var(--transition);
}

.map-text {
    fill: #ffffff;
    font-size: 7px;
    font-weight: bold;
    text-anchor: middle;
    pointer-events: none;
}

/* Node Active Colors corresponding to legend */
.map-node.active-pv { fill: #38bdf8; filter: drop-shadow(0 0 3px #38bdf8); }
.map-node.active-ct { fill: #818cf8; filter: drop-shadow(0 0 3px #818cf8); }
.map-node.active-it { fill: #fb923c; filter: drop-shadow(0 0 3px #fb923c); }
.map-node.active-sc { fill: #f87171; filter: drop-shadow(0 0 3px #f87171); }
.map-node.active-on { fill: #34d399; filter: drop-shadow(0 0 3px #34d399); }

/* Details text block */
.result-details {
    border-top: 1px solid var(--border-color);
    padding-top: 1.25rem;
}

.details-content {
    font-size: 0.85rem;
    color: var(--text-main);
    background-color: var(--bg-card-hover);
    padding: 1rem;
    border-radius: 8px;
    border-left: 3px solid var(--primary);
    white-space: pre-line;
}

/* Recommendations list */
.clinical-recommendations {
    border-top: 1px solid var(--border-color);
    padding-top: 1.25rem;
}

#recommendations-list {
    padding-left: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

#recommendations-list li {
    font-size: 0.85rem;
    color: var(--text-main);
}

/* App Footer */
.app-footer {
    background-color: var(--neutral-dark);
    color: #94a3b8;
    text-align: center;
    padding: 2rem;
    font-size: 0.8rem;
    border-top: 1px solid rgba(255,255,255,0.05);
    margin-top: auto;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.reference {
    font-size: 0.75rem;
    opacity: 0.8;
}

/* Print CSS Styles overrides */
@media print {
    body {
        background-color: #ffffff !important;
        color: #000000 !important;
        font-size: 11pt !important;
    }
    .app-header, .header-controls, .form-navigation, #print-btn, #theme-toggle, #reset-btn {
        display: none !important;
    }
    .app-container {
        padding: 0 !important;
        margin: 0 !important;
        max-width: 100% !important;
    }
    .layout-grid {
        display: block !important;
        margin-top: 0 !important;
    }
    .card {
        border: none !important;
        box-shadow: none !important;
        margin-bottom: 20px !important;
    }
    .calculator-card {
        display: none !important; /* hide inputs in print report */
    }
    .result-card {
        display: block !important;
    }
    .details-content {
        border: 1px solid #ccc !important;
        background-color: #f9f9f9 !important;
    }
    .disclaimer-banner {
        border: 1px solid #ccc !important;
        background-color: #f9f9f9 !important;
        page-break-after: avoid;
    }
    /* Add print header */
    body::before {
        content: "KLINISCH ANALYSE RAPPORT: MS MCDONALD 2024 CRITERIA EVALUATIE";
        display: block;
        font-family: var(--font-heading);
        font-size: 16pt;
        font-weight: bold;
        text-align: center;
        margin-bottom: 20px;
        border-bottom: 2px solid #000000;
        padding-bottom: 10px;
    }
}

/* Visual highlights on final evaluation trigger */
@keyframes pulseHighlight {
    0% { transform: scale(1); box-shadow: var(--shadow-md); }
    50% { transform: scale(1.02); box-shadow: 0 0 25px rgba(14, 165, 233, 0.4); border-color: var(--primary); }
    100% { transform: scale(1); box-shadow: var(--shadow-md); }
}

.pulse-highlight {
    animation: pulseHighlight 0.8s ease-in-out;
}

