/* --- Global Styles & Enhanced Dark Theme --- */
:root {
    /* ... (Keep color variables, fonts, etc. from previous version) ... */
    --bg-color: #1a1d21;
    --bg-color-secondary: #24282f;
    --content-bg: #2f343d;
    --border-color: #4a505a;
    --text-color: #e8eaf6;
    --text-color-secondary: #aeb4c4;
    --heading-color: #ffffff;
    --accent-color-primary: #818cf8; /* Indigo */
    --accent-color-secondary: #f472b6; /* Pink */
    --highlight-bg: #3b414c;
    --success-color: #34d399;
    --warning-color: #facc15; /* Yellow for potential clashes */
    --icon-color: #aeb4c4;
    --spinner-color: var(--accent-color-primary);

    --heading-font: 'Merriweather', Georgia, serif;
    --body-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;

    --border-radius: 8px;
    --box-shadow: 0 6px 20px rgba(0, 0, 0, 0.55);
    --transition-speed: 0.25s;
}

/* ... (Keep *, html, body, container, typography, sections, spinner, buttons styles from previous version) ... */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
    font-family: var(--body-font);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.7;
    padding: 20px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
.container {
    max-width: 900px;
    margin: 30px auto;
    background-color: var(--content-bg);
    padding: 40px 50px;
    border: 1px solid var(--border-color);
    box-shadow: var(--box-shadow);
    border-radius: var(--border-radius);
}
/* Typography */
h1, h2, h3 { font-family: var(--heading-font); color: var(--heading-color); margin-bottom: 0.8em; font-weight: 700; }
h1 { font-size: 2.5em; text-align: center; letter-spacing: -0.8px; margin-bottom: 0.5em;}
h2 { font-size: 2.0em; border-bottom: 1px solid var(--border-color); padding-bottom: 0.5em; margin-top: 1.8em; }
h3 { font-size: 1.4em; color: var(--accent-color-primary); margin-bottom: 0.7em; font-weight: 600;}
.subtitle { color: var(--text-color-secondary); font-style: italic; text-align: center; margin-top: -10px; margin-bottom: 40px; font-size: 1.15em;}
p { margin-bottom: 1.4em; }
strong { color: var(--accent-color-secondary); font-weight: 600; }
a { color: var(--accent-color-primary); text-decoration: none; transition: color var(--transition-speed); }
a:hover { color: var(--accent-color-secondary); text-decoration: underline; }
/* Sections & Utility */
header { border-bottom: 1px solid var(--border-color); padding-bottom: 30px; margin-bottom: 40px; }
footer { text-align: center; margin-top: 50px; padding-top: 30px; border-top: 1px solid var(--border-color); font-size: 0.9em; color: var(--text-color-secondary); }
.hidden { display: none !important; }
/* Spinner */
.spinner { border: 4px solid rgba(255, 255, 255, 0.2); border-left-color: var(--spinner-color); border-radius: 50%; width: 30px; height: 30px; animation: spin 1s linear infinite; margin: 20px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
/* Buttons */
.btn { display: inline-block; padding: 14px 30px; font-size: 1.0rem; font-weight: 600; color: #fff; background-image: linear-gradient(to right, var(--accent-color-primary) 0%, var(--accent-color-secondary) 100%); background-size: 200% auto; border: none; border-radius: var(--border-radius); cursor: pointer; transition: all var(--transition-speed) ease; text-align: center; margin: 10px 8px; box-shadow: 0 4px 8px rgba(0,0,0,0.3); text-decoration: none; letter-spacing: 0.5px; }
.btn:hover { background-position: right center; transform: translateY(-2px); box-shadow: 0 6px 12px rgba(0,0,0,0.4); }
.btn:active { transform: translateY(0px); box-shadow: 0 2px 5px rgba(0,0,0,0.3); }
.btn-secondary { background-image: none; background-color: #52525b; color: var(--text-color); }
.btn-secondary:hover { background-color: #71717a; }
.btn:disabled, .btn.disabled { background-image: none; background-color: #4a4a4a !important; cursor: not-allowed; color: #888 !important; box-shadow: none !important; transform: none !important; }


/* --- Initial Screen --- */
#initial-screen { text-align: center; }
#initial-options { margin-top: 30px; display: flex; flex-wrap: wrap; justify-content: center; gap: 15px; position: relative; min-height: 50px; /* Space for spinner */ }
#initial-options .spinner { position: absolute; top: 0; left: 50%; transform: translateX(-50%); }


/* --- Quiz Area --- */
#progress-tracker { margin-bottom: 40px; text-align: center; }
#progress-bar-container { width: 100%; background-color: #444; border-radius: 10px; overflow: hidden; height: 14px; margin-bottom: 10px; }
#progress-bar { background: linear-gradient(to right, var(--accent-color-primary), var(--accent-color-secondary)); height: 100%; width: 0%; border-radius: 10px; transition: width 0.4s ease-out; }
#progress-text { font-size: 1.0em; color: var(--text-color-secondary); }
#question-content { position: relative; min-height: 100px; /* Space for spinner */ }
#question-content .spinner { position: absolute; top: 20px; left: 50%; transform: translateX(-50%); }
.question-block { margin-bottom: 40px; padding: 35px; border: 1px solid var(--border-color); background-color: var(--bg-color-secondary); border-radius: var(--border-radius); animation: fadeIn 0.5s ease-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.question-text { font-size: 1.3em; font-weight: 600; margin-bottom: 30px; color: var(--heading-color); line-height: 1.65; }
.answers-container label { display: block; background-color: var(--content-bg); padding: 16px 22px; margin-bottom: 14px; border: 1px solid var(--border-color); border-radius: var(--border-radius); cursor: pointer; transition: background-color var(--transition-speed), border-color var(--transition-speed), transform 0.1s ease; position: relative; }
.answers-container label:hover { background-color: var(--highlight-bg); border-color: var(--accent-color-secondary); transform: translateX(3px); }
.answers-container input[type="radio"] { margin-right: 18px; transform: scale(1.2); accent-color: var(--accent-color-primary); vertical-align: middle; }
.answers-container span { vertical-align: middle; color: var(--text-color); }
.navigation-buttons { display: flex; justify-content: space-between; margin-top: 35px; }


/* --- Results Area --- */
#results-area h2 { text-align: center; margin-bottom: 1.5em; }
#results-display { position: relative; min-height: 100px; /* Space for spinner */ }
#results-display .spinner { position: absolute; top: 20px; left: 50%; transform: translateX(-50%); }

/* Result Tabs */
.results-tabs {
    display: flex;
    justify-content: center;
    margin-bottom: 25px;
    border-bottom: 1px solid var(--border-color);
}
.tab-btn {
    padding: 12px 25px;
    cursor: pointer;
    border: none;
    background-color: transparent;
    color: var(--text-color-secondary);
    font-size: 1.1em;
    font-weight: 600;
    border-bottom: 3px solid transparent; /* Indicator line */
    transition: color var(--transition-speed), border-color var(--transition-speed);
    margin-bottom: -1px; /* Overlap border */
}
.tab-btn:hover {
    color: var(--text-color);
}
.tab-btn.active {
    color: var(--accent-color-primary);
    border-bottom-color: var(--accent-color-primary);
}

/* Result Items (Shared styles for Detailed and Simple) */
.results-list { margin-top: 25px; }
.result-item { margin-bottom: 18px; background-color: var(--bg-color-secondary); border: 1px solid var(--border-color); border-radius: var(--border-radius); overflow: hidden; transition: box-shadow var(--transition-speed); }
.result-item:hover { box-shadow: 0 0 10px rgba(129, 140, 248, 0.2); /* Use accent color */ }
.result-header { padding: 18px 25px; cursor: pointer; display: flex; align-items: center; gap: 20px; transition: background-color var(--transition-speed); }
.result-header:hover { background-color: var(--highlight-bg); }
.result-info { flex-grow: 1; }
.result-name { font-weight: 700; font-size: 1.1em; color: var(--heading-color); display: block; margin-bottom: 6px; }
.result-percentage { font-size: 0.95em; color: var(--text-color-secondary); font-weight: 500;}
.result-progress-bar-container { flex-shrink: 0; width: 140px; background-color: #444; border-radius: 7px; overflow: hidden; height: 12px; }
.result-progress-bar { background-image: linear-gradient(to right, var(--accent-color-primary) 0%, var(--accent-color-secondary) 100%); height: 100%; transition: width 0.9s cubic-bezier(0.25, 1, 0.5, 1); border-radius: 7px; }
.expand-icon { font-family: monospace; font-size: 1.8em; line-height: 1; color: var(--icon-color); font-weight: bold; transition: transform var(--transition-speed) ease-out; flex-shrink: 0; width: 25px; text-align: center; }
.result-details { padding: 0px 25px 0px 25px; max-height: 0; overflow: hidden; transition: max-height 0.4s ease-in-out, padding 0.4s ease-in-out, border-top 0.4s ease-in-out; border-top: 1px solid transparent; color: var(--text-color-secondary); font-size: 0.98em; line-height: 1.6; }
.result-details p { margin: 0 0 1em 0; padding: 0; }
.result-details p:last-child { margin-bottom: 0; }
/* Expanded State */
.result-item.expanded .result-header { background-color: var(--highlight-bg); }
.result-item.expanded .result-details { max-height: 350px; /* Increased max height */ padding: 20px 25px 25px 25px; border-top: 1px dashed var(--border-color); }
.result-item.expanded .expand-icon { transform: rotate(45deg); }

/* --- Compatibility Section --- */
#compatibility-section {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid var(--border-color);
}
#compatibility-section h3 {
     text-align: center;
     color: var(--heading-color);
     margin-bottom: 1em;
}
.compatibility-input-area {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    align-items: center;
}
.compatibility-input-area input[type="text"] {
    flex-grow: 1;
    padding: 12px 15px;
    background-color: var(--bg-color-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-color);
    font-size: 0.95em;
}
.compatibility-input-area .btn {
    flex-shrink: 0;
    margin: 0; /* Reset margin for flex item */
    padding: 12px 20px; /* Adjust padding */
}
.compatibility-output {
    background-color: var(--bg-color-secondary);
    padding: 25px;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    font-size: 0.95em;
    line-height: 1.8;
}
.compatibility-output h4 {
    color: var(--accent-color-primary);
    margin-top: 1em;
    margin-bottom: 0.5em;
    border-bottom: 1px dashed var(--border-color);
    padding-bottom: 0.3em;
}
.compatibility-output h4:first-child { margin-top: 0; }
.compatibility-output ul {
    list-style: none;
    padding-left: 0;
}
.compatibility-output li {
    margin-bottom: 0.8em;
    padding-left: 20px;
    position: relative;
}
.compatibility-output li::before { /* Custom bullet points */
    content: '•';
    color: var(--accent-color-secondary);
    position: absolute;
    left: 0;
    font-size: 1.2em;
    line-height: 1;
}
.compatibility-output .comp-highlight { /* Highlight potential complementarity */
    font-weight: 600;
    color: var(--success-color);
}
.compatibility-output .comp-clash { /* Highlight potential clashes */
    font-weight: 600;
    color: var(--warning-color);
}
.compatibility-output .comp-note { /* General notes */
     font-style: italic;
     color: var(--text-color-secondary);
     margin-top: 1em;
     display: block;
}

/* --- Action Buttons (Results Footer) --- */
.results-actions { margin-top: 40px; text-align: center; padding-top: 30px; border-top: 1px solid var(--border-color); display: flex; flex-wrap: wrap; justify-content: center; gap: 15px;}
.results-actions .btn { flex-grow: 0; }


/* --- Responsiveness --- */
/* ... (Keep media queries from previous version, adjust padding/font sizes as needed) ... */
@media (max-width: 768px) {
    .container { padding: 30px; }
    h1 { font-size: 2.1em; }
    h2 { font-size: 1.7em; }
    .result-header { flex-wrap: wrap; }
    .result-progress-bar-container { width: 100%; margin-top: 10px; order: 3; height: 10px;}
    .result-info { width: calc(100% - 45px); order: 1 }
    .expand-icon { order: 2; }
    .results-tabs { justify-content: space-around; } /* Space out tabs more */
    .tab-btn { padding: 10px 15px; font-size: 1em;}
    .compatibility-input-area { flex-direction: column; align-items: stretch; }
    .compatibility-input-area .btn { width: 100%; margin-top: 10px;}
}

@media (max-width: 520px) {
    body { padding: 8px; font-size: 15px; }
    .container { padding: 20px; margin: 10px auto; }
    h1 { font-size: 1.8em; }
    .subtitle { font-size: 1.0em; margin-bottom: 30px;}
    .navigation-buttons { flex-direction: column-reverse; }
    .navigation-buttons .btn { width: 100%; margin: 8px 0; }
    .btn { padding: 13px 22px; font-size: 1.0rem; }
    .question-text { font-size: 1.2em;}
    .answers-container label { padding: 14px 18px;}
    .result-header { padding: 15px 20px; gap: 15px;}
    .result-name { font-size: 1.0em;}
    .result-info { width: calc(100% - 40px); }
    .results-actions .btn { display: block; width: 90%; margin: 10px auto;} /* Stack action buttons */
    .tab-btn { padding: 10px 10px; font-size: 0.95em;} /* Smaller tabs */
}