/* Root variables for color scheme - Light Mode (Blue Theme) */
:root {
    /* Primary Blues - Light Mode */
    --primary-color: #2563EB;
    --primary-dark: #1E40AF;
    --primary-light: #3B82F6;
    --primary-lighter: #60A5FA;
    --primary-lightest: #93C5FD;

    /* Secondary Blues */
    --secondary-color: #0EA5E9;
    --secondary-dark: #0284C7;
    --secondary-light: #38BDF8;

    /* Accent Colors */
    --accent-color: #06B6D4;
    --accent-light: #22D3EE;
    --success-color: #3B82F6;
    --warning-color: #60A5FA;

    /* Text Colors - Light Mode */
    --text-primary: #0F172A;
    --text-secondary: #475569;
    --text-tertiary: #64748B;
    --text-muted: #94A3B8;

    /* Background Colors - Light Mode */
    --bg-primary: #FFFFFF;
    --bg-secondary: #F8FAFC;
    --bg-tertiary: #F1F5F9;
    --bg-elevated: #FFFFFF;

    /* Border Colors - Light Mode */
    --border-color: #E2E8F0;
    --border-light: #F1F5F9;
    --border-focus: #3B82F6;

    /* Shadow Colors */
    --shadow-sm: rgba(15, 23, 42, 0.04);
    --shadow-md: rgba(15, 23, 42, 0.08);
    --shadow-lg: rgba(15, 23, 42, 0.12);

    /* Gradient Background */
    --gradient-start: #DBEAFE;
    --gradient-mid: #BFDBFE;
    --gradient-end: #93C5FD;

    /* Category colors - Light Mode */
    --analysts-color: #6366F1;
    --analysts-light: #818CF8;
    --diplomats-color: #0EA5E9;
    --diplomats-light: #38BDF8;
    --sentinels-color: #2563EB;
    --sentinels-light: #3B82F6;
    --explorers-color: #06B6D4;
    --explorers-light: #22D3EE;
}

/* Dark Mode */
[data-theme="dark"] {
    /* Primary Blues - Dark Mode */
    --primary-color: #3B82F6;
    --primary-dark: #60A5FA;
    --primary-light: #2563EB;
    --primary-lighter: #1E40AF;
    --primary-lightest: #1E3A8A;

    /* Secondary Blues */
    --secondary-color: #0EA5E9;
    --secondary-dark: #38BDF8;
    --secondary-light: #0284C7;

    /* Accent Colors */
    --accent-color: #06B6D4;
    --accent-light: #22D3EE;
    --success-color: #3B82F6;
    --warning-color: #60A5FA;

    /* Text Colors - Dark Mode */
    --text-primary: #F1F5F9;
    --text-secondary: #CBD5E1;
    --text-tertiary: #94A3B8;
    --text-muted: #64748B;

    /* Background Colors - Dark Mode */
    --bg-primary: #0F172A;
    --bg-secondary: #1E293B;
    --bg-tertiary: #334155;
    --bg-elevated: #1E293B;

    /* Border Colors - Dark Mode */
    --border-color: #334155;
    --border-light: #475569;
    --border-focus: #3B82F6;

    /* Shadow Colors */
    --shadow-sm: rgba(0, 0, 0, 0.2);
    --shadow-md: rgba(0, 0, 0, 0.3);
    --shadow-lg: rgba(0, 0, 0, 0.4);

    /* Gradient Background */
    --gradient-start: #1E293B;
    --gradient-mid: #334155;
    --gradient-end: #475569;

    /* Category colors - Dark Mode */
    --analysts-color: #818CF8;
    --analysts-light: #A5B4FC;
    --diplomats-color: #38BDF8;
    --diplomats-light: #7DD3FC;
    --sentinels-color: #60A5FA;
    --sentinels-light: #93C5FD;
    --explorers-color: #22D3EE;
    --explorers-light: #67E8F9;
}

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, var(--gradient-start) 0%, var(--gradient-mid) 50%, var(--gradient-end) 100%);
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.6;
    transition: background 0.3s ease, color 0.3s ease;
}

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

/* Header and Navigation */
.site-header {
    background: var(--bg-primary);
    padding: 20px 0;
    box-shadow: 0 4px 12px var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: background 0.3s ease;
    border-bottom: 2px solid var(--border-color);
}

.header-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.header-content {
    flex: 1;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 20px;
}

.site-header h1 {
    color: var(--primary-color);
    font-size: 2rem;
    margin-bottom: 15px;
}

nav {
    display: flex;
    gap: 15px;
}

/* Dark Mode Toggle */
.theme-toggle {
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: 50px;
    padding: 8px 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    font-size: 1rem;
    color: var(--text-primary);
    font-weight: 500;
}

.theme-toggle:hover {
    background: var(--bg-elevated);
    border-color: var(--primary-color);
    transform: scale(1.05);
}

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

.nav-link {
    padding: 10px 20px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.nav-link:hover {
    background: var(--primary-light);
    color: var(--bg-primary);
    transform: translateY(-2px);
}

.nav-link.active {
    background: var(--primary-color);
    color: var(--bg-primary);
}

/* Main containers */
main {
    background: var(--bg-primary);
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 8px 16px var(--shadow-lg);
    transition: background 0.3s ease;
    margin-top: 30px;
    margin-bottom: 30px;
}

/* Welcome screen */
.welcome-screen {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.welcome-screen h2 {
    color: var(--primary-color);
    font-size: 2.5rem;
    margin-bottom: 20px;
}

.welcome-screen p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.welcome-screen ul {
    text-align: left;
    margin: 30px auto;
    max-width: 500px;
}

.welcome-screen li {
    margin: 15px 0;
    font-size: 1.1rem;
}

/* Buttons */
.btn-primary, .btn-secondary {
    padding: 12px 32px;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 10px 5px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
}

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

.btn-primary {
    background: var(--primary-color);
    color: var(--bg-primary);
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px var(--shadow-md);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--bg-elevated);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

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

/* Quiz screen */
.quiz-screen {
    max-width: 700px;
    margin: 0 auto;
}

.hidden {
    display: none;
}

/* Progress bar */
.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
    transition: width 0.3s ease;
}

.question-counter {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 30px;
    font-size: 0.9rem;
}

/* Question card */
.question-card {
    margin: 30px 0;
}

.question-card h3 {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 30px;
    text-align: center;
}

.options {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.option-button {
    padding: 20px;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    color: var(--text-primary);
}

.option-button:hover {
    border-color: var(--primary-light);
    background: var(--bg-tertiary);
    transform: translateX(5px);
}

.option-button.selected {
    background: var(--primary-color);
    color: var(--bg-primary);
    border-color: var(--primary-dark);
}

/* Navigation buttons */
.navigation-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 40px;
}

/* Results page */
.results-container {
    max-width: 900px;
    margin: 0 auto;
}

.result-card h2 {
    text-align: center;
    color: var(--primary-color);
    font-size: 2rem;
    margin-bottom: 20px;
}

.type-badge {
    display: inline-block;
    background: var(--primary-color);
    color: var(--white);
    font-size: 3rem;
    font-weight: bold;
    padding: 20px 40px;
    border-radius: 12px;
    margin: 20px auto;
    display: block;
    width: fit-content;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.result-card h3 {
    text-align: center;
    color: var(--primary-dark);
    font-size: 2rem;
    margin-bottom: 20px;
}

.type-description {
    font-size: 1.2rem;
    color: var(--text-primary);
    line-height: 1.8;
    margin-bottom: 40px;
    text-align: center;
    padding: 20px;
    background: var(--bg-secondary);
    border-radius: 8px;
}

/* Dimensions breakdown */
.dimensions {
    margin: 40px 0;
}

.dimensions h3 {
    color: var(--primary-color);
    margin-bottom: 20px;
    text-align: left;
}

.dimension-breakdown {
    margin: 20px 0;
}

.dimension-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.dimension-name {
    font-weight: 600;
    color: var(--text-primary);
}

.dimension-result {
    font-weight: 700;
    color: var(--primary-color);
}

.dimension-bar {
    display: flex;
    height: 40px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.dimension-bar-left, .dimension-bar-right {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bg-primary);
    font-weight: 600;
    transition: width 0.5s ease;
}

.dimension-bar-left {
    background: var(--primary-color);
}

.dimension-bar-right {
    background: var(--secondary-color);
}

/* Characteristics */
.characteristics {
    margin: 40px 0;
}

.characteristics h3 {
    color: var(--primary-color);
    margin-bottom: 20px;
}

.characteristics ul {
    list-style: none;
}

.characteristics li {
    padding: 12px;
    margin: 8px 0;
    background: var(--bg-secondary);
    border-left: 4px solid var(--primary-color);
    border-radius: 4px;
}

/* Strengths and weaknesses */
.strengths-weaknesses {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin: 40px 0;
}

.strengths h4, .weaknesses h4 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.strengths ul, .weaknesses ul {
    list-style: none;
}

.strengths li, .weaknesses li {
    padding: 10px;
    margin: 8px 0;
    border-radius: 4px;
}

.strengths li {
    background: var(--bg-secondary);
    border-left: 4px solid var(--secondary-color);
}

.weaknesses li {
    background: var(--bg-secondary);
    border-left: 4px solid var(--accent-color);
}

/* Validity section */
.validity-section {
    margin: 50px 0;
    padding: 30px;
    background: var(--bg-secondary);
    border-radius: 12px;
}

.validity-section h3 {
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 30px;
    font-size: 1.8rem;
}

.validity-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.useful-section h4 {
    color: var(--secondary-color);
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.limitations-section h4 {
    color: var(--accent-color);
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.useful-section ul, .limitations-section ul {
    list-style: none;
}

.useful-section li, .limitations-section li {
    padding: 10px;
    margin: 8px 0;
    border-radius: 4px;
}

.useful-section li {
    background: var(--bg-tertiary);
    border-left: 4px solid var(--secondary-color);
}

.limitations-section li {
    background: var(--bg-tertiary);
    border-left: 4px solid var(--accent-color);
}

.important-note {
    padding: 25px;
    background: var(--bg-primary);
    border-radius: 8px;
    border: 2px solid var(--primary-color);
}

.important-note h4 {
    color: var(--primary-color);
    margin-bottom: 15px;
}

.important-note p {
    margin-bottom: 15px;
    line-height: 1.8;
}

.important-note ul {
    margin-left: 20px;
}

.important-note li {
    margin: 8px 0;
}

/* Action buttons */
.action-buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 40px;
    flex-wrap: wrap;
}

/* Infographic page */
.infographic-container h2 {
    text-align: center;
    color: var(--primary-color);
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.intro-text {
    text-align: center;
    color: var(--text-secondary);
    font-size: 1.2rem;
    margin-bottom: 40px;
}

/* Type categories */
.type-category {
    margin: 50px 0;
}

.category-title {
    font-size: 1.8rem;
    margin-bottom: 10px;
    padding: 15px;
    border-radius: 8px;
    color: var(--bg-primary);
}

.category-title.analysts {
    background: var(--analysts-color);
}

.category-title.diplomats {
    background: var(--diplomats-color);
}

.category-title.sentinels {
    background: var(--sentinels-color);
}

.category-title.explorers {
    background: var(--explorers-color);
}

.category-desc {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 20px;
    padding: 0 15px;
}

/* Type grid */
.type-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.type-card {
    background: var(--bg-primary);
    border-radius: 12px;
    padding: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 3px solid var(--border-color);
}

.type-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px var(--shadow-lg);
}

.type-card.analysts-card {
    border-color: var(--analysts-color);
}

.type-card.analysts-card:hover {
    border-color: var(--analysts-color);
    box-shadow: 0 8px 16px var(--analysts-color);
}

.type-card.diplomats-card {
    border-color: var(--diplomats-color);
}

.type-card.diplomats-card:hover {
    border-color: var(--diplomats-color);
    box-shadow: 0 8px 16px var(--diplomats-color);
}

.type-card.sentinels-card {
    border-color: var(--sentinels-color);
}

.type-card.sentinels-card:hover {
    border-color: var(--sentinels-color);
    box-shadow: 0 8px 16px var(--sentinels-color);
}

.type-card.explorers-card {
    border-color: var(--explorers-color);
}

.type-card.explorers-card:hover {
    border-color: var(--explorers-color);
    box-shadow: 0 8px 16px var(--explorers-color);
}

.type-header {
    display: flex;
    justify-content: center;
    margin-bottom: 15px;
}

.type-code {
    font-size: 1.8rem;
    font-weight: bold;
    padding: 10px 20px;
    border-radius: 8px;
    background: var(--primary-color);
    color: var(--bg-primary);
}

.type-card h4 {
    text-align: center;
    color: var(--text-primary);
    font-size: 1.3rem;
    margin-bottom: 10px;
}

.type-card p {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 15px;
    line-height: 1.6;
}

.type-traits {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.trait {
    background: var(--bg-tertiary);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--text-primary);
}

/* Dimension guide */
.dimension-guide {
    margin: 60px 0;
    padding: 40px;
    background: var(--bg-secondary);
    border-radius: 12px;
}

.dimension-guide h3 {
    text-align: center;
    color: var(--primary-color);
    font-size: 2rem;
    margin-bottom: 30px;
}

.dimensions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
}

.dimension-card {
    background: var(--bg-primary);
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 8px var(--shadow-md);
}

.dimension-card h4 {
    color: var(--primary-color);
    margin-bottom: 15px;
    text-align: center;
}

.dimension-comparison {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.dimension-comparison > div {
    padding: 15px;
    background: var(--bg-tertiary);
    border-radius: 8px;
}

.dimension-comparison strong {
    display: block;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.dimension-comparison p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Modal */
.modal {
    display: block;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background-color: var(--bg-primary);
    margin: 5% auto;
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 700px;
    max-height: 85vh;
    overflow-y: auto;
    animation: slideIn 0.3s;
    box-shadow: 0 8px 24px var(--shadow-lg);
}

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

.close-button {
    color: var(--bg-primary);
    float: right;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    padding: 10px 20px;
    transition: color 0.3s;
    opacity: 0.8;
}

.close-button:hover {
    opacity: 1;
}

.modal-header {
    background: var(--primary-color);
    color: var(--bg-primary);
    padding: 30px;
    border-radius: 12px 12px 0 0;
}

.modal-header h2 {
    margin: 0;
    font-size: 2rem;
}

.modal-nickname {
    margin-top: 10px;
    opacity: 0.9;
    font-size: 1.2rem;
}

.modal-body {
    padding: 30px;
}

.modal-description {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-primary);
    margin-bottom: 25px;
}

.modal-section {
    margin: 25px 0;
}

.modal-section h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
}

.modal-section ul {
    list-style: none;
}

.modal-section li {
    padding: 10px;
    margin: 8px 0;
    background: var(--bg-secondary);
    border-left: 4px solid var(--primary-color);
    border-radius: 4px;
}

.modal-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
}

/* Responsive design */
@media (max-width: 768px) {
    .header-wrapper {
        flex-direction: column;
        gap: 20px;
    }

    .header-content {
        width: 100%;
        text-align: center;
    }

    .header-controls {
        width: 100%;
        justify-content: center;
    }

    .site-header h1 {
        font-size: 1.5rem;
    }

    nav {
        flex-direction: column;
        justify-content: center;
    }

    main {
        padding: 20px;
    }

    .action-buttons {
        flex-direction: column;
    }

    .btn-primary, .btn-secondary {
        width: 100%;
        max-width: 300px;
    }

    .welcome-screen h2 {
        font-size: 2rem;
    }

    .strengths-weaknesses {
        grid-template-columns: 1fr;
    }

    .validity-content {
        grid-template-columns: 1fr;
    }

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

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

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

    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }

    header {
        padding: 15px 20px;
    }

    main {
        padding: 15px;
    }

    .type-badge {
        font-size: 2rem;
        padding: 15px 30px;
    }

    .navigation-buttons {
        flex-direction: column;
        gap: 10px;
    }

    .btn-primary, .btn-secondary {
        width: 100%;
    }
}
