/* ══════════════════════════════════════════════════════════════
   STYLES.CSS — FE Mechanical Study Platform
   Template v6 — Config-driven architecture
   ══════════════════════════════════════════════════════════════ */

/* ── CSS Custom Properties (FE MECHANICAL BRAND) ─────────── */
:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #3b82f6;
    --bg-dark: #0a1628;
    --bg-darker: #060f1d;
    --bg-card: #132240;
    --bg-card-hover: #1a3050;
    --accent: #f59e0b;
    --accent-dark: #d97706;
    --text-primary: #ffffff;
    --text-secondary: #c9cdd3;
    --text-muted: #94a3b8;
    --border-color: rgba(255, 255, 255, 0.08);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.4);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --transition: all 0.3s ease;
    --green: #22c55e;
    --red: #ef4444;
    --yellow: #f59e0b;
    --navy: #0a1628;
    --navy-light: #132240;
    --navy-medium: #1a3050;
    --red-glow: rgba(37, 99, 235, 0.3);
}

/* ── Reset & Base ────────────────────────────────────────────── */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Montserrat', 'Inter', sans-serif;
    font-weight: 700;
    line-height: 1.2;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-light);
}

img {
    max-width: 100%;
    height: auto;
}

/* ── Layout Containers ───────────────────────────────────────── */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

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

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

/* ── Header / Navigation ─────────────────────────────────────── */
.header {
    background: var(--bg-darker);
    border-bottom: 1px solid var(--border-color);
    padding: 16px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

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

.header-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.header-brand .brand-icon {
    font-size: 1.5rem;
}

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

.header-nav a {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
}

.header-nav a:hover {
    color: var(--text-primary);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
}

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    line-height: 1.4;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

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

.btn-accent:hover {
    background: var(--accent-dark);
    transform: translateY(-1px);
}

.btn-lg {
    padding: 16px 32px;
    font-size: 1.1rem;
    border-radius: var(--radius);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.85rem;
}

.btn-block {
    width: 100%;
}

/* ── Cards ───────────────────────────────────────────────────── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 24px;
    transition: var(--transition);
}

.card:hover {
    background: var(--bg-card-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.card-header {
    padding: 20px 24px;
    border-radius: var(--radius) var(--radius) 0 0;
}

.card-body {
    padding: 24px;
}

/* ── Badge ───────────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-primary {
    background: rgba(196, 30, 58, 0.15);
    color: var(--primary);
    border: 1px solid rgba(196, 30, 58, 0.3);
}

.badge-accent {
    background: rgba(255, 215, 0, 0.15);
    color: var(--accent);
    border: 1px solid rgba(255, 215, 0, 0.3);
}

/* ── Form Elements ───────────────────────────────────────────── */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    transition: var(--transition);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(196, 30, 58, 0.15);
}

.form-input::placeholder {
    color: var(--text-muted);
}

select.form-input {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

/* ── Hero Section ────────────────────────────────────────────── */
.hero {
    text-align: center;
    padding: 60px 20px 40px;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 16px;
}

.hero h1 em {
    font-style: normal;
    color: var(--primary);
}

.hero p {
    font-size: 1.15rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 30px;
}

/* ── Stats Bar ───────────────────────────────────────────────── */
.stats-bar {
    display: flex;
    justify-content: center;
    gap: 40px;
    padding: 20px;
    flex-wrap: wrap;
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ── Course Cards Grid ───────────────────────────────────────── */
.course-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
    padding: 20px 0;
}

.course-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
    transition: var(--transition);
    cursor: pointer;
}

.course-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.course-card-header {
    padding: 24px;
    position: relative;
}

.course-card-icon {
    font-size: 2rem;
    margin-bottom: 12px;
}

.course-card-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.course-card-subtitle {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.course-card-body {
    padding: 0 24px 24px;
}

.course-card-features {
    list-style: none;
    padding: 0;
}

.course-card-features li {
    padding: 6px 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.course-card-features li::before {
    content: '✓';
    color: var(--primary);
    font-weight: 700;
}

.course-card-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    padding: 4px 10px;
    border-radius: 50px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    background: rgba(255, 215, 0, 0.2);
    color: var(--accent);
}

/* ── Module Cards ────────────────────────────────────────────── */
.module-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    padding: 20px 0;
}

.module-card {
    border-radius: var(--radius);
    overflow: hidden;
    transition: var(--transition);
    cursor: pointer;
    position: relative;
}

.module-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.module-card-inner {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 140px;
}

.module-card-icon {
    font-size: 2rem;
}

.module-card-title {
    font-size: 1.1rem;
    font-weight: 700;
}

.module-card-meta {
    font-size: 0.85rem;
    opacity: 0.8;
}

.module-card-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 3px 8px;
    border-radius: 50px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0.2);
}

.module-card-progress {
    margin-top: auto;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    overflow: hidden;
}

.module-card-progress-fill {
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 2px;
    transition: width 0.5s ease;
}

/* ── Video Player ────────────────────────────────────────────── */
.player-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 24px;
    padding: 24px 0;
}

.video-container {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    background: #000;
    border-radius: var(--radius);
    overflow: hidden;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.lesson-sidebar {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow-y: auto;
    max-height: 70vh;
}

.lesson-item {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.9rem;
}

.lesson-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.lesson-item.active {
    background: rgba(196, 30, 58, 0.1);
    border-left: 3px solid var(--primary);
}

.lesson-item.completed {
    color: var(--text-muted);
}

.lesson-item .lesson-number {
    min-width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
}

.lesson-item.completed .lesson-number {
    background: var(--primary);
    color: white;
}

/* ── Simulator ───────────────────────────────────────────────── */
.simulator-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    border-radius: var(--radius) var(--radius) 0 0;
}

.timer {
    font-size: 1.5rem;
    font-weight: 700;
    font-family: 'Montserrat', monospace;
    color: var(--primary);
}

.timer.warning {
    color: var(--accent);
}

.timer.danger {
    color: #ef4444;
}

.question-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 32px;
    margin: 20px 0;
}

.question-text {
    font-size: 1.15rem;
    line-height: 1.7;
    margin-bottom: 24px;
}

.option {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    margin: 8px 0;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.option:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--primary);
}

.option.selected {
    background: rgba(196, 30, 58, 0.1);
    border-color: var(--primary);
}

.option.correct {
    background: rgba(196, 30, 58, 0.15);
    border-color: var(--primary);
}

.option.incorrect {
    background: rgba(239, 68, 68, 0.15);
    border-color: #ef4444;
}

.option-letter {
    min-width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
}

.option.selected .option-letter {
    background: var(--primary);
    color: white;
}

/* ── Flashcard ───────────────────────────────────────────────── */
.flashcard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
    padding: 20px 0;
}

.flashcard-deck {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
    transition: var(--transition);
}

.flashcard-deck:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.flashcard-deck-header {
    padding: 20px;
    text-align: center;
}

.flashcard-deck-body {
    padding: 0 20px 20px;
}

/* ── Progress Bar ────────────────────────────────────────────── */
.progress-bar {
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 4px;
    transition: width 0.5s ease;
}

/* ── Modal ────────────────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 40px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: var(--transition);
}

.modal-overlay.active .modal {
    transform: scale(1);
}

/* ── Footer ──────────────────────────────────────────────────── */
.footer {
    text-align: center;
    padding: 40px 20px;
    margin-top: 60px;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ── Upsell Footer Bar ───────────────────────────────────────── */
.upsell-footer-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #1e293b, #0f172a);
    border-top: 1px solid var(--primary);
    padding: 12px 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    z-index: 90;
    display: none;
}

.upsell-footer-bar.active {
    display: flex;
}

/* ── Locked Card ─────────────────────────────────────────────── */
.locked-card {
    position: relative;
    opacity: 0.7;
}

.locked-card::after {
    content: '🔒';
    position: absolute;
    top: 16px;
    right: 16px;
    font-size: 1.5rem;
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 1.8rem;
    }

    .player-layout {
        grid-template-columns: 1fr;
    }

    .lesson-sidebar {
        max-height: 300px;
    }

    .stats-bar {
        gap: 20px;
    }

    .stat-number {
        font-size: 1.4rem;
    }

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

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

    .header-nav {
        gap: 12px;
    }

    .header-nav a {
        font-size: 0.8rem;
    }

    .question-card {
        padding: 20px;
    }

    .modal {
        padding: 24px;
    }

    .container {
        padding: 0 16px;
    }
}

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

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

    .hero {
        padding: 40px 16px 24px;
    }
}

/* ── Utilities ───────────────────────────────────────────────── */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-primary-color { color: var(--primary); }
.text-accent { color: var(--accent); }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }
.p-2 { padding: 16px; }
.p-3 { padding: 24px; }
.hidden { display: none !important; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }
.w-full { width: 100%; }

/* ───── 2026-05-10: Hide Exam Accelerator UI sitewide ───── */
.accelerator-feature,
.accelerator-upsell,
.accelerator-only,
.accelerator-active-strip { display: none !important; }
