:root {
    --bg-dark: #050505;
    --text-light: #fdf8f5;
    --text-muted: #a39b98;
    --primary: #f59e0b;
    /* Amber/Gold */
    --primary-hover: #d97706;
    --secondary: #27272a;
    --secondary-hover: #3f3f46;
    --success: #10b981;
    --danger: #be123c;
    /* Crimson */
    --danger-hover: #9f1239;
    --glass-bg: rgba(15, 15, 15, 0.70);
    --glass-border: rgba(245, 158, 11, 0.2);
    --card-shadow: 0 15px 40px -10px rgba(0, 0, 0, 0.8);
    --heading-font: 'Playfair Display', serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

h1,
h2,
h3,
h4,
h5,
h6,
.brand-icon {
    font-family: var(--heading-font);
    font-weight: 500;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-light);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    position: relative;
}

/* Site Background Image */
.site-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    background-image: url('img/bg.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    filter: brightness(0.4) saturate(1.2);
}

/* Glassmorphism Classes */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    box-shadow: var(--card-shadow);
}

/* Navbar */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    margin: 1rem;
    position: sticky;
    top: 1rem;
    z-index: 100;
}

.nav-brand {
    font-size: 1.5rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary);
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
}

.nav-links {
    display: flex;
    gap: 0.5rem;
}

.nav-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.nav-btn:hover {
    color: var(--text-light);
    background: rgba(255, 255, 255, 0.05);
}

.nav-btn.active {
    color: var(--primary);
    background: rgba(245, 158, 11, 0.1);
    font-weight: 600;
}

/* Main Container */
.container {
    max-width: 1000px;
    margin: 0 auto;
    width: 100%;
    padding: 2rem 1rem;
    flex-grow: 1;
}

/* Views */
.view-section {
    display: none;
    animation: fadeIn 0.4s ease forwards;
}

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

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.view-header {
    text-align: center;
    margin-bottom: 2rem;
}

.view-header h2 {
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
}

.view-header p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    letter-spacing: 0.5px;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

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

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(245, 158, 11, 0.4);
}

.btn-secondary {
    background: var(--secondary);
    color: white;
    border: 1px solid var(--glass-border);
}

.btn-secondary:hover {
    background: var(--secondary-hover);
    transform: translateY(-2px);
}

.btn-alert {
    background: var(--danger);
    color: white;
}

.btn-alert:hover {
    background: var(--danger-hover);
    box-shadow: 0 4px 20px rgba(190, 18, 60, 0.5);
}

/* Home View */
.hero-card {
    text-align: center;
    padding: 4rem 2rem;
    margin-bottom: 2rem;
}

.hero-card h1 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--primary);
    text-shadow: 0 0 25px rgba(245, 158, 11, 0.2);
}

.hero-card p {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.hero-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.stats-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.stat-card {
    padding: 2rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-icon {
    width: 32px;
    height: 32px;
    color: var(--primary);
    margin-bottom: 1rem;
}

.stat-card h3 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.stat-card p {
    color: var(--text-muted);
}

/* Flashcard */
.flashcard {
    padding: 3rem 2rem;
    text-align: center;
    min-height: 400px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    transition: transform 0.3s;
}

.question-text {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    line-height: 1.4;
}

.options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    width: 100%;
}

.option-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-light);
    padding: 1rem;
    border-radius: 12px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.option-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.02);
}

.option-btn.correct {
    background: rgba(16, 185, 129, 0.15);
    border-color: var(--success);
    color: var(--success);
}

.option-btn.incorrect {
    background: rgba(190, 18, 60, 0.15);
    border-color: var(--danger);
    color: #fda4af;
}

.flashcard-controls {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
}

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

@media (max-width: 768px) {
    .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 4.5rem;
        right: 1rem;
        background: var(--glass-bg);
        backdrop-filter: blur(12px);
        border: 1px solid var(--glass-border);
        padding: 1rem;
        border-radius: 12px;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    }

    .nav-links.show {
        display: flex;
    }

    .mobile-menu-btn {
        display: block;
    }
}

/* Exam General */
.exam-rules {
    padding: 2rem;
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.exam-rules ul {
    list-style: none;
    text-align: left;
    margin: 2rem auto;
    display: inline-block;
}

.exam-rules li {
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 1.1rem;
}

/* Active Exam */
.floating-header {
    position: sticky;
    top: 5.5rem;
    z-index: 90;
    display: flex;
    justify-content: space-between;
    padding: 1rem 2rem;
    margin-bottom: 2rem;
    font-size: 1.25rem;
    font-weight: bold;
}

.exam-timer {
    color: var(--primary);
    font-family: monospace;
    font-size: 1.5rem;
}

.exam-timer.warning {
    color: var(--danger);
    animation: flash 1s infinite;
}

@keyframes flash {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.exam-q-box {
    margin-bottom: 2rem;
    padding: 2rem;
}

.exam-q-box h4 {
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
}

.exam-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.exam-opt-label {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.exam-opt-label:hover {
    background: rgba(255, 255, 255, 0.1);
}

.exam-opt-label input {
    width: 20px;
    height: 20px;
    accent-color: var(--primary);
}

.exam-opt-label.selected-correct {
    background: rgba(16, 185, 129, 0.15);
    border-color: var(--success);
}

.exam-opt-label.selected-incorrect {
    background: rgba(190, 18, 60, 0.15);
    border-color: var(--danger);
}

.exam-opt-label.missed-correct {
    border-color: var(--success);
    color: var(--success);
}

.exam-footer {
    padding: 2rem;
    text-align: center;
    margin-top: 2rem;
}

/* Exam Results */
.result-card {
    padding: 3rem;
    text-align: center;
    max-width: 600px;
    margin: 0 auto 2rem auto;
}

.result-score {
    font-size: 4rem;
    font-weight: 800;
    margin: 1rem 0;
    color: var(--primary);
}

.result-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 2rem;
    text-align: left;
    background: rgba(0, 0, 0, 0.2);
    padding: 1.5rem;
    border-radius: 12px;
}

.result-details div {
    font-size: 1.1rem;
}

.result-grade {
    font-size: 2rem;
    font-weight: 800;
}

.grade-1 {
    color: var(--danger);
}

.grade-2 {
    color: #f59e0b;
}

.grade-3 {
    color: #eab308;
}

.grade-4 {
    color: #84cc16;
}

.grade-5 {
    color: var(--success);
}

/* History View */
.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    margin-bottom: 1rem;
    transition: transform 0.2s;
}

.history-item:hover {
    transform: translateX(10px);
}

.hist-info h4 {
    font-size: 1.2rem;
    margin-bottom: 0.25rem;
}

.hist-info p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.hist-score {
    font-size: 1.5rem;
    font-weight: 600;
}

.hidden {
    display: none !important;
}