:root {
    /* Apple-inspired Light Palette */
    --bg-color: #f5f5f7;
    --card-bg: #ffffff;
    --text-main: #1d1d1f;
    --text-muted: #86868b;
    --heading-color: #1d1d1f;
    
    --primary-color: #0066cc;
    --primary-hover: #0077ed;
    
    --success-color: #008a00;
    --success-bg: #e6f6e6;
    
    --error-color: #e30000;
    --error-bg: #fde6e6;
    
    --border-color: rgba(0, 0, 0, 0.08);

    /* Apple System Typography Stack */
    --font-heading: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-body: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

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

html, body {
    overflow-x: hidden;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.47059;
    font-size: 17px;
    letter-spacing: -0.022em;
    -webkit-font-smoothing: antialiased;
    width: 100%;
}

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

h1, h2, h3, h4 {
    font-family: var(--font-heading);
    color: var(--heading-color);
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-bottom: 1rem;
    line-height: 1.15;
}

.main-header {
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    padding: 20px 0;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 15px;
}

.site-logo {
    width: 48px;
    height: 48px;
    object-fit: contain;
}

.title-section h1 {
    font-size: 1.5rem;
    margin-bottom: 0;
    font-weight: 700;
}

.title-section p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0;
}

.main-nav {
    display: flex;
    gap: 24px;
}

.nav-link {
    text-decoration: none;
    color: var(--text-main);
    font-weight: 400;
    font-size: 0.95rem;
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.nav-link:hover, .nav-link.active {
    opacity: 1;
}

/* Views */
.view-section {
    display: none;
    animation: scaleUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    margin-top: 40px;
}

.view-section.active {
    display: block;
}

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

/* Dashboard / Categories */
.intro-box {
    text-align: center;
    margin-bottom: 50px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hero-badge {
    display: inline-block;
    background-color: var(--card-bg);
    color: var(--text-main);
    font-size: 0.85rem;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 980px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
    margin-bottom: 25px;
    border: 1px solid rgba(0,0,0,0.04);
}

.intro-box h1 {
    font-size: 2.8rem;
    font-weight: 700;
    letter-spacing: -0.04em;
    margin-bottom: 12px;
}

.intro-box p {
    font-size: 1.2rem;
    color: var(--text-muted);
}

.category-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 24px;
    max-width: 900px;
    margin: 0 auto;
}

.category-card {
    flex: 0 1 calc(50% - 24px);
    min-width: 300px;
    max-width: 420px;
    background-color: var(--card-bg);
    border-radius: 28px;
    padding: 12px;
    text-align: left;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
}

.category-card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.08);
}

.card-image-box {
    background: linear-gradient(145deg, #f8fafc, #eff6ff);
    border-radius: 20px;
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    border: 1px solid rgba(0,0,0,0.02);
}

.card-icon {
    font-size: 4.5rem;
    margin-bottom: 0;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.category-card:hover .card-icon {
    transform: scale(1.1);
}

.card-content {
    padding: 0 16px 16px;
}

.category-card h3 {
    margin-bottom: 8px;
    font-size: 1.3rem;
    font-weight: 600;
}

.category-card p {
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.4;
    margin-bottom: 0;
}

/* Buttons */
.btn {
    display: inline-block;
    font-family: var(--font-body);
    font-weight: 500;
    padding: 12px 28px;
    border-radius: 980px; /* Classic Apple pill button */
    border: none;
    cursor: pointer;
    font-size: 1.05rem;
    letter-spacing: -0.01em;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.primary-btn {
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}

.primary-btn:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.secondary-btn {
    background-color: rgba(0, 0, 0, 0.05);
    color: var(--text-main);
}

.secondary-btn:hover {
    background-color: rgba(0, 0, 0, 0.08);
}

/* Quiz Interface */
.quiz-header {
    margin-bottom: 30px;
    text-align: center;
}

.quiz-header h2 {
    margin-bottom: 5px;
}

.progress-container {
    max-width: 600px;
    margin: 20px auto 0;
}

.progress-text {
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.progress-bar-bg {
    width: 100%;
    height: 6px;
    background-color: rgba(0, 0, 0, 0.08);
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background-color: var(--primary-color);
    width: 0%;
    transition: width 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.question-card {
    background-color: var(--card-bg);
    border-radius: 24px;
    padding: 40px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.04);
    margin-bottom: 30px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.question-text {
    font-size: 1.35rem;
    margin-bottom: 35px;
    font-weight: 500;
    line-height: 1.4;
}

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

.option-btn {
    text-align: left;
    padding: 18px 24px;
    background-color: rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 16px;
    font-size: 1.05rem;
    font-family: var(--font-body);
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.2s ease;
}

.option-btn:hover:not(:disabled) {
    background-color: rgba(0, 0, 0, 0.04);
}

.option-btn.selected {
    border-color: var(--primary-color);
    background-color: rgba(0, 102, 204, 0.05);
}

.option-btn.correct {
    background-color: var(--success-bg);
    border-color: rgba(0, 138, 0, 0.2);
    color: var(--success-color);
}

.option-btn.incorrect {
    background-color: var(--error-bg);
    border-color: rgba(227, 0, 0, 0.2);
    color: var(--error-color);
}

.option-btn:disabled {
    cursor: default;
}

.feedback-container {
    margin-top: 30px;
    padding: 24px;
    border-radius: 16px;
    font-weight: 400;
    animation: scaleUp 0.3s ease;
}

.feedback-container.correct {
    background-color: var(--success-bg);
    color: var(--success-color);
}

.feedback-container.incorrect {
    background-color: var(--error-bg);
    color: var(--error-color);
}

.feedback-text {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.explanation-text {
    font-size: 1rem;
    color: var(--text-main);
    line-height: 1.5;
}

.hidden {
    display: none !important;
}

.quiz-footer {
    display: flex;
    justify-content: center;
    margin-bottom: 60px;
}

/* Results View */
.results-card {
    background-color: var(--card-bg);
    border-radius: 24px;
    padding: 60px 40px;
    text-align: center;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.04);
    max-width: 800px;
    margin: 0 auto;
}

.results-card h2 {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.04em;
}

.score-display {
    margin: 30px 0;
}

.score-number {
    font-size: 6rem;
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--primary-color);
    letter-spacing: -0.05em;
    line-height: 1;
}

.score-total {
    font-size: 2rem;
    color: var(--text-muted);
    font-weight: 500;
}

.results-message {
    font-size: 1.2rem;
    margin-bottom: 40px;
    color: var(--text-muted);
}

/* Footer Styles */
.main-footer {
    background-color: #f5f5f7;
    border-top: 1px solid var(--border-color);
    padding: 40px 0;
    margin-top: 80px;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 20px;
}

.footer-links {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s;
    font-size: 0.9rem;
}

.footer-links a:hover {
    color: var(--text-main);
}

.footer-disclaimer {
    color: var(--text-muted);
    font-size: 0.8rem;
    max-width: 800px;
    line-height: 1.5;
}

.footer-copyright {
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* Static Pages Styles */
.page-content {
    background-color: var(--card-bg);
    padding: 60px;
    border-radius: 24px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.04);
    max-width: 800px;
    margin: 60px auto 80px;
}

.page-content h2 {
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: -0.04em;
    margin-bottom: 30px;
}

.page-content h3 {
    font-size: 1.4rem;
    margin-top: 30px;
    margin-bottom: 15px;
}

.page-content p {
    margin-bottom: 15px;
    color: var(--text-muted);
    line-height: 1.6;
}

/* ------------------------------------- */
/* Mobile Offcanvas Navigation           */
/* ------------------------------------- */
.nav-toggle-label {
    display: none;
}
.nav-overlay {
    display: none;
}

@media (max-width: 1024px) {
    .nav-toggle-label {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        width: 24px;
        height: 18px;
        cursor: pointer;
        z-index: 1000;
        margin-left: auto;
    }
    
    .nav-toggle-label span {
        display: block;
        height: 2px;
        width: 100%;
        background-color: var(--text-main);
        border-radius: 2px;
        transition: all 0.3s ease;
    }
    
    .main-nav {
        position: fixed;
        top: 0;
        right: -280px;
        width: 260px;
        height: 100vh;
        background-color: rgba(255, 255, 255, 0.95);
        backdrop-filter: saturate(180%) blur(20px);
        -webkit-backdrop-filter: saturate(180%) blur(20px);
        flex-direction: column;
        align-items: flex-start;
        padding: 80px 30px;
        box-shadow: -4px 0 24px rgba(0,0,0,0.1);
        transition: right 0.3s ease;
        z-index: 999;
        margin: 0;
    }
    
    .main-nav a.nav-link {
        font-size: 1.2rem;
        width: 100%;
        padding: 10px 0;
        border-bottom: 1px solid var(--border-color);
        opacity: 1;
    }

    .nav-toggle:checked ~ .main-nav {
        right: 0;
    }

    /* Transform hamburger into X */
    .nav-toggle:checked ~ .nav-toggle-label span:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }
    .nav-toggle:checked ~ .nav-toggle-label span:nth-child(2) {
        opacity: 0;
    }
    .nav-toggle:checked ~ .nav-toggle-label span:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }
    
    /* Overlay */
    .nav-toggle:checked ~ .nav-overlay {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.4);
        z-index: 998;
        cursor: pointer;
    }
}
