/* ============================================================
   Quantralux Education — Course & Quiz Styles
   Matches quantralux.com Design System v4.0
   Deep Navy + Corporate Blue + Gold
   ============================================================ */

/* ===== IMPORTS ===== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ===== VARIABLES (from quantralux styles.css) ===== */
:root {
    --primary: #0A1A2F;
    --primary-light: #153A7A;
    --accent: #D4AF37;
    --accent-dark: #B8960F;
    --accent-glow: rgba(212, 175, 55, 0.15);
    --secondary: #1B449B;
    --text-primary: #F2F4F7;
    --text-secondary: #B8C0CC;
    --text-muted: #8FA2B8;
    --border: rgba(21, 58, 122, 0.5);
    --success: #22c55e;
    --warning: #f59e0b;
    --error: #ef4444;
    --bg: #0A1A2F;
    --bg-card: #FFFFFF;
    --bg-card-hover: #F8F9FA;
    --card-text: #1a1a2e;
    --btn-primary: #1E4A7A;
    --btn-primary-hover: #1B449B;
}

body.dark-mode {
    --primary: #0a1628;
    --primary-light: #111d33;
    --accent: #00d4ff;
    --accent-dark: #0099cc;
    --accent-glow: rgba(0, 212, 255, 0.15);
    --secondary: #6366f1;
    --text-primary: #ffffff;
    --text-secondary: #94a3b8;
    --text-muted: #475569;
    --border: rgba(0, 212, 255, 0.15);
    --bg: #0a1628;
    --bg-card: #0f1f38;
    --bg-card-hover: #111d33;
    --card-text: #ffffff;
    --btn-primary: #00d4ff;
    --btn-primary-hover: #0099cc;
}

/* ===== RESET ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; font-size: 16px; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: radial-gradient(ellipse at center, #1B449B 0%, #153A7A 40%, #0A1A2F 100%);
    z-index: -1;
}

body.dark-mode::before {
    background: radial-gradient(ellipse at center, #0f1f38 0%, #111d33 40%, #0a1628 100%);
}

/* ===== COURSE HUB ===== */
.hub-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 6rem 2rem 4rem;
}

.hub-header {
    text-align: center;
    margin-bottom: 4rem;
}

.hub-header .badge {
    display: inline-block;
    padding: 0.5rem 1.2rem;
    border-radius: 50px;
    background: var(--accent-glow);
    border: 1px solid var(--border);
    font-size: 0.85rem;
    color: var(--accent);
    font-weight: 500;
    margin-bottom: 1.5rem;
}

.hub-header h1 {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 800;
    margin-bottom: 1rem;
    line-height: 1.1;
}

.hub-header h1 em {
    font-style: normal;
    color: var(--accent);
}

.hub-header p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* ===== COURSE CARDS GRID ===== */
.course-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 2rem;
}

.course-card {
    background: var(--bg-card);
    border: 2px solid var(--accent);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s ease;
    color: var(--card-text);
    display: flex;
    flex-direction: column;
}

.course-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    border-color: var(--secondary);
}

.course-card-header {
    padding: 2rem 2rem 1rem;
    position: relative;
}

.course-number {
    display: inline-block;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--accent);
    color: var(--primary);
    font-weight: 800;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.course-card h3 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.course-card .subtitle {
    color: #6b7280;
    font-size: 0.9rem;
}

.course-card-body {
    padding: 0 2rem 1.5rem;
    flex: 1;
}

.course-card-body p {
    font-size: 0.9rem;
    line-height: 1.6;
    color: #4a5568;
    margin-bottom: 1rem;
}

.course-meta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.course-meta span {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.8rem;
    color: #6b7280;
    background: #f3f4f6;
    padding: 0.3rem 0.7rem;
    border-radius: 6px;
}

.course-card-footer {
    padding: 1rem 2rem 1.5rem;
    display: flex;
    gap: 0.75rem;
    border-top: 1px solid #e5e7eb;
}

.btn-course {
    flex: 1;
    padding: 0.7rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
}

.btn-course-primary {
    background: var(--secondary);
    color: #fff;
}

.btn-course-primary:hover {
    background: var(--btn-primary-hover);
    transform: translateY(-1px);
}

.btn-course-secondary {
    background: transparent;
    color: var(--secondary);
    border: 1px solid var(--border);
}

.btn-course-secondary:hover {
    background: var(--accent-glow);
    border-color: var(--accent);
}

/* ===== COURSE PAGE ===== */
.course-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 6rem 2rem 4rem;
}

.course-hero {
    text-align: center;
    margin-bottom: 3rem;
    padding: 3rem 2rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    border: 1px solid var(--border);
}

.course-hero .breadcrumb {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.course-hero .breadcrumb a {
    color: var(--accent);
    text-decoration: none;
}

.course-hero h1 {
    font-size: clamp(1.8rem, 3vw, 2.5rem);
    font-weight: 800;
    margin-bottom: 1rem;
}

.course-hero .course-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
    flex-wrap: wrap;
}

/* ===== QUIZ INTERFACE ===== */
.quiz-wrapper {
    max-width: 800px;
    margin: 0 auto;
    padding: 6rem 2rem 4rem;
}

.quiz-header {
    text-align: center;
    margin-bottom: 2rem;
}

.quiz-header h1 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.quiz-progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin: 1.5rem 0;
}

.quiz-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--secondary));
    border-radius: 4px;
    transition: width 0.4s ease;
}

.quiz-progress-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

/* ===== QUESTION CARD ===== */
.question-card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 2.5rem;
    color: var(--card-text);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    margin-bottom: 1.5rem;
}

.question-number {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--secondary);
    background: rgba(27, 68, 155, 0.1);
    padding: 0.3rem 0.8rem;
    border-radius: 6px;
    margin-bottom: 1rem;
}

.question-topic {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 500;
    color: #6b7280;
    margin-left: 0.5rem;
}

.question-text {
    font-size: 1.2rem;
    font-weight: 600;
    line-height: 1.5;
    margin-bottom: 2rem;
    color: var(--card-text);
}

/* ===== ANSWER OPTIONS ===== */
.options-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.option-btn {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
    padding: 1rem 1.25rem;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    background: #f9fafb;
    font-size: 1rem;
    text-align: left;
    cursor: pointer;
    transition: all 0.25s ease;
    color: var(--card-text);
    font-family: inherit;
}

.option-btn:hover:not(.selected):not(.correct):not(.incorrect) {
    border-color: var(--secondary);
    background: rgba(27, 68, 155, 0.05);
    transform: translateX(4px);
}

.option-letter {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
    transition: all 0.25s;
}

.option-btn.selected {
    border-color: var(--secondary);
    background: rgba(27, 68, 155, 0.1);
}

.option-btn.selected .option-letter {
    background: var(--secondary);
    color: #fff;
}

.option-btn.correct {
    border-color: var(--success);
    background: rgba(34, 197, 94, 0.1);
}

.option-btn.correct .option-letter {
    background: var(--success);
    color: #fff;
}

.option-btn.incorrect {
    border-color: var(--error);
    background: rgba(239, 68, 68, 0.1);
}

.option-btn.incorrect .option-letter {
    background: var(--error);
    color: #fff;
}

.option-btn.disabled {
    pointer-events: none;
    opacity: 0.7;
}

.option-icon {
    margin-left: auto;
    font-size: 1.2rem;
}

/* ===== FEEDBACK BOX ===== */
.feedback-box {
    margin-top: 1.5rem;
    padding: 1.25rem;
    border-radius: 12px;
    display: none;
    animation: fadeIn 0.3s ease;
}

.feedback-box.show { display: block; }

.feedback-box.correct-feedback {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.feedback-box.incorrect-feedback {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.feedback-box h4 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.feedback-box.correct-feedback h4 { color: var(--success); }
.feedback-box.incorrect-feedback h4 { color: var(--error); }

.feedback-box p {
    font-size: 0.9rem;
    line-height: 1.6;
    color: #4a5568;
    margin-bottom: 0.75rem;
}

.feedback-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--secondary);
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    background: rgba(27, 68, 155, 0.08);
    transition: all 0.2s;
}

.feedback-link:hover {
    background: rgba(27, 68, 155, 0.15);
    text-decoration: underline;
}

/* ===== NAVIGATION ===== */
.quiz-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.5rem;
    gap: 1rem;
}

.nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1.5rem;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
    font-family: inherit;
}

.nav-btn-prev {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.nav-btn-prev:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.nav-btn-next {
    background: var(--btn-primary);
    color: #fff;
}

.nav-btn-next:hover {
    background: var(--btn-primary-hover);
    transform: translateY(-1px);
}

.nav-btn-bookmark {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid transparent;
    padding: 0.7rem;
    font-size: 1.2rem;
}

.nav-btn-bookmark:hover,
.nav-btn-bookmark.active {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--accent-glow);
}

/* ===== QUESTION MAP ===== */
.question-map {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.q-dot {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
}

.q-dot:hover {
    border-color: var(--accent);
    transform: scale(1.1);
}

.q-dot.current {
    border-color: var(--accent);
    background: var(--accent-glow);
    color: var(--accent);
}

.q-dot.answered {
    background: var(--secondary);
    color: #fff;
}

.q-dot.bookmarked {
    position: relative;
}

.q-dot.bookmarked::after {
    content: '📌';
    position: absolute;
    top: -6px;
    right: -6px;
    font-size: 0.6rem;
}

.q-dot.correct-dot {
    background: var(--success);
    color: #fff;
}

.q-dot.incorrect-dot {
    background: var(--error);
    color: #fff;
}

/* ===== RESULTS PAGE ===== */
.results-container {
    max-width: 700px;
    margin: 0 auto;
    padding: 6rem 2rem 4rem;
    text-align: center;
}

.results-card {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 3rem;
    color: var(--card-text);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.score-circle {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    margin: 0 auto 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

.score-circle svg {
    position: absolute;
    top: 0;
    left: 0;
    transform: rotate(-90deg);
}

.score-circle .score-text {
    font-size: 2.5rem;
    font-weight: 800;
    z-index: 1;
}

.score-circle .score-label {
    font-size: 0.85rem;
    color: #6b7280;
    z-index: 1;
}

.results-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin: 2rem 0;
}

.stat-box {
    padding: 1rem;
    background: #f3f4f6;
    border-radius: 10px;
}

.stat-box .stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--secondary);
}

.stat-box .stat-label {
    font-size: 0.8rem;
    color: #6b7280;
    margin-top: 0.25rem;
}

.results-message {
    font-size: 1.1rem;
    color: #4a5568;
    margin: 1.5rem 0;
    line-height: 1.6;
}

.results-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
    flex-wrap: wrap;
}

/* ===== DOCUMENTATION VIEWER ===== */
.doc-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 6rem 2rem 4rem;
}

.doc-card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 3rem;
    color: var(--card-text);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.doc-card h1 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--card-text);
}

.doc-card h2 {
    font-size: 1.3rem;
    font-weight: 700;
    margin: 2rem 0 1rem;
    color: var(--secondary);
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e5e7eb;
}

.doc-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 1.5rem 0 0.75rem;
    color: var(--card-text);
}

.doc-card p {
    font-size: 0.95rem;
    line-height: 1.8;
    color: #374151;
    margin-bottom: 1rem;
}

.doc-card ul, .doc-card ol {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.doc-card li {
    font-size: 0.95rem;
    line-height: 1.7;
    color: #374151;
    margin-bottom: 0.5rem;
}

.doc-card .example-box {
    background: #f0f7ff;
    border-left: 4px solid var(--secondary);
    padding: 1.25rem;
    border-radius: 0 10px 10px 0;
    margin: 1.5rem 0;
}

.doc-card .example-box h4 {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--secondary);
    margin-bottom: 0.5rem;
}

.doc-card table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.9rem;
}

.doc-card th, .doc-card td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.doc-card th {
    background: #f3f4f6;
    font-weight: 700;
    color: var(--card-text);
}

.doc-card td {
    color: #374151;
}

/* ===== LANGUAGE TOGGLE ===== */
.lang-toggle-btn {
    position: fixed;
    top: 80px;
    right: 24px;
    background: var(--primary);
    color: var(--accent);
    border: 1px solid var(--border);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    z-index: 100;
    transition: all 0.3s;
}

.lang-toggle-btn:hover {
    border-color: var(--accent);
    background: var(--accent-glow);
}

/* ===== DARK MODE TOGGLE ===== */
.theme-toggle-edu {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary);
    border: 2px solid var(--border);
    color: var(--accent);
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 100;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.theme-toggle-edu:hover {
    transform: scale(1.1);
    border-color: var(--accent);
}

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

.fade-in { animation: fadeIn 0.4s ease; }
.slide-in { animation: slideIn 0.3s ease; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .hub-container, .quiz-wrapper, .course-container, .doc-container, .results-container {
        padding: 5rem 1rem 3rem;
    }

    .course-grid {
        grid-template-columns: 1fr;
    }

    .question-card {
        padding: 1.5rem;
    }

    .results-stats {
        grid-template-columns: 1fr;
    }

    .quiz-nav {
        flex-wrap: wrap;
    }

    .question-map {
        justify-content: center;
    }
}

/* ===== PRINT STYLES ===== */
@media print {
    body::before { display: none; }
    body { background: #fff; color: #000; }
    .doc-card { box-shadow: none; border: 1px solid #ccc; }
    .quiz-nav, .theme-toggle-edu, .lang-toggle-btn { display: none; }
}