@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary: #1e3a5f;
    --primary-dark: #162f56;
    --accent: #9a4a12;
    --text: #0f172a;
    --text-muted: #475569;
    --bg: #ffffff;
    --card-bg: rgba(255, 255, 255, 0.95);
    --border: #e2e8f0;
    --glass-border: rgba(255, 255, 255, 0.6);
    --shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.08);
}

* {
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}
.back-btn{display:inline-flex;align-items:center;gap:8px;background:#fbbf24;color:#1e293b!important;text-decoration:none;font-size:.85rem;font-weight:600;padding:8px 16px;border-radius:10px;border:2px solid #d97706;transition:all .25s ease}
.back-btn:hover{background:#f59e0b;border-color:#b45309;transform:translateX(-3px)}
.back-btn svg{width:16px;height:16px;transition:transform .2s ease}
.back-btn:hover svg{transform:translateX(-3px)}

body {
    font-family: 'Outfit', sans-serif;
    color: var(--text);
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    margin: 0;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    padding: 2.5rem 1rem;
}

.course-shell {
    width: 100%;
    max-width: 1400px;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 2.5rem;
    border: 1px solid var(--glass-border);
    box-shadow: 0 40px 100px -20px rgba(0, 0, 0, 0.1);
    padding: 3rem 2.5rem;
    display: flex;
    flex-direction: column;
}

header {
    text-align: center;
    margin-bottom: 4rem;
}

header p:first-child {
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--primary);
    font-weight: 800;
    font-size: 0.75rem;
    margin-bottom: 1rem;
    opacity: 0.8;
}

h1 {
    font-size: clamp(2.5rem, 6vw, 3.75rem);
    font-weight: 800;
    color: var(--primary);
    margin: 0.5rem 0;
    letter-spacing: -1.5px;
    line-height: 1.1;
}

header p:last-child {
    color: var(--text-muted);
    font-size: 1.15rem;
    max-width: 650px;
    margin: 1.5rem auto 0;
    line-height: 1.6;
}

.grid {
    display: flex;
    flex-direction: column;
    gap: 3.5rem;
}

.section-card {
    background: var(--card-bg);
    border-radius: 2.25rem;
    padding: 3.5rem;
    border: 1px solid white;
    box-shadow: var(--shadow);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.section-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 30px 60px -15px rgba(0, 0, 0, 0.12);
}

.exam-header-strip {
    background: #f1f5f9;
    color: var(--primary);
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    padding: 0.6rem 1.25rem;
    border-radius: 12px;
    display: inline-block;
    margin-bottom: 1.25rem;
    border: 1px solid #e2e8f0;
}

h2 {
    font-size: 2.1rem;
    margin: 0.5rem 0 1.25rem 0;
    color: var(--primary);
    font-weight: 700;
    letter-spacing: -0.5px;
}

.section-card > p {
    color: var(--text-muted);
    font-size: 1.1rem;
    line-height: 1.7;
    margin-bottom: 2.5rem;
}

/* Audio Block */
.audio-block {
    background: #f8fafc;
    padding: 2rem;
    border-radius: 1.75rem;
    margin: 2.5rem 0;
    border: 1px solid #edf2f7;
}

audio {
    width: 100%;
    height: 48px;
    filter: sepia(20%) saturate(70%) hue-rotate(180deg);
}

.transcript-btn {
    background: white;
    border: 1px solid var(--border);
    color: var(--primary);
    font-weight: 700;
    padding: 0.85rem 1.75rem;
    border-radius: 14px;
    cursor: pointer;
    margin-top: 1.5rem;
    transition: all 0.3s ease;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.transcript-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: translateY(-2px);
}

.transcript {
    margin-top: 1.5rem;
    padding: 2.25rem;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 1.5rem;
    font-size: 1.05rem;
    color: var(--text-muted);
    line-height: 1.8;
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.03);
    animation: fadeIn 0.4s ease-out;
}

/* Recorder Block */
.recorder-block {
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
    padding: 2.5rem;
    background: #fff;
    border: 2px dashed #cbd5e1;
    border-radius: 2rem;
    margin-top: 2.5rem;
}

.recorder-info p:first-child {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 6px !important;
}

.recorder-controls {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.recording-status {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: #ef4444;
    font-weight: 700;
    font-size: 1.25rem;
}

.pulse-dot {
    width: 14px;
    height: 14px;
    background: #ef4444;
    border-radius: 50%;
    animation: blink 1s infinite;
}

@keyframes blink {
    0% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(1.2); }
    100% { opacity: 1; transform: scale(1); }
}

.playback-area {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1.25rem;
    background: #f1f5f9;
    border-radius: 1.25rem;
    animation: slideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

.btn-download {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.75rem 1.5rem;
    background: var(--primary);
    color: white;
    text-decoration: none;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 700;
    transition: all 0.2s;
}

/* Cue Card */
.cue-card {
    background: #fffdf5;
    border: 1px solid #e9e4d0;
    padding: 2.5rem;
    border-radius: 1.5rem;
    margin: 2.5rem 0;
    position: relative;
    box-shadow: 0 4px 12px rgba(0,0,0,0.02);
}

.cue-card::before {
    content: "EXAM CUE CARD";
    position: absolute;
    top: -14px;
    right: 32px;
    background: #fef3c7;
    color: #92400e;
    font-size: 0.75rem;
    font-weight: 800;
    padding: 4px 14px;
    border-radius: 8px;
    border: 1px solid #fde68a;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.cue-header {
    font-weight: 800;
    font-size: 1.4rem;
    margin-bottom: 1rem !important;
    color: #1e293b;
}

/* Buttons */
.btn {
    padding: 1rem 2.25rem;
    border-radius: 14px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.btn-record {
    background: #0f172a;
    color: white;
}

.btn-record:hover {
    background: #1e293b;
    transform: translateY(-2px);
}

.btn-record.recording {
    background: #ef4444;
    animation: pulse 2s infinite;
}

.btn-success {
    background: #047857;
    color: white;
    width: 100%;
    margin-top: 5rem;
    padding: 1.5rem;
    font-size: 1.25rem;
    box-shadow: 0 15px 30px -8px rgba(4, 120, 87, 0.4);
}
[data-theme="dark"] .btn-success {
    background: #059669;
    box-shadow: 0 15px 30px -8px rgba(5, 150, 105, 0.4);
}

/* Discussion Grid */
.discussion-points {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin: 4.5rem 0;
}

.point-card {
    background: #ffffff;
    border-radius: 1.75rem;
    border: 1px solid #e2e8f0;
    box-shadow: var(--shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
}

.card-body {
    padding: 3rem;
}

.discussion-prompt {
    font-size: 1.25rem;
    color: #1e293b;
    line-height: 1.6;
    font-style: italic;
    border-left: 5px solid var(--accent);
    padding-left: 1.5rem;
    margin: 2.5rem 0;
}

/* Responsive */
@media (max-width: 1024px) {
    .course-shell { padding: 2.5rem 2rem; }
    .discussion-points { grid-template-columns: 1fr; gap: 2.5rem; }
}

@media (max-width: 768px) {
    body { padding: 1.5rem 0.5rem; }
    .course-shell { border-radius: 1.75rem; padding: 2rem 1.5rem; }
    h1 { font-size: 2.5rem; }
    .section-card { padding: 2rem 1.5rem; }
    .card-body { padding: 1.75rem; }
}

@media (max-width: 600px) {
    body { padding: 1rem 0.25rem; }
    .course-shell { border-radius: 1.25rem; padding: 1.5rem 1rem; }
    .recorder-controls { flex-direction: column; align-items: stretch; }
    .playback-area { flex-direction: column; }
    .section-card { padding: 1.5rem 1rem; }
    h1 { font-size: 2rem; }
}

@keyframes pulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
    70% { transform: scale(1.02); box-shadow: 0 0 0 15px rgba(239, 68, 68, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ── Dark Theme ── */
[data-theme="dark"] {
    --primary: #3d72c4;
    --primary-dark: #2a5599;
    --primary-text: #fbbf24;
    --accent: #f0a050;
    --text: #e2e8f0;
    --text-muted: #94a3b8;
    --bg: #0d1321;
    --card-bg: rgba(30, 41, 59, 0.85);
    --border: #334155;
    --glass-border: rgba(255, 255, 255, 0.08);
    --shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.3);
}
[data-theme="dark"] body { background: linear-gradient(135deg, #0b1120 0%, #162032 100%); }
[data-theme="dark"] .course-shell {
    background: rgba(15, 23, 42, 0.6);
    border-color: var(--glass-border);
}
[data-theme="dark"] h1,
[data-theme="dark"] header p:first-child { color: var(--primary-text); }
[data-theme="dark"] .section-card {
    background: var(--card-bg);
    border-color: var(--border);
}
[data-theme="dark"] .discussion-prompt { color: #cbd5e1; }
[data-theme="dark"] .audio-block {
    background: rgba(15, 23, 42, 0.6);
    border-color: var(--border);
}
[data-theme="dark"] .transcript {
    background: rgba(15, 23, 42, 0.8);
    color: #cbd5e1;
    border-color: var(--border);
}
[data-theme="dark"] .recorder-block {
    background: rgba(15, 23, 42, 0.6);
    border-color: var(--border);
}
[data-theme="dark"] .playback-area {
    background: rgba(15, 23, 42, 0.7);
}
[data-theme="dark"] .cue-card {
    background: rgba(15, 23, 42, 0.6);
    border-color: var(--border);
}
[data-theme="dark"] .cue-card::before {
    background: #1e293b;
    color: #fbbf24;
    border-color: #374151;
}
[data-theme="dark"] .cue-header {
    color: var(--text);
}
[data-theme="dark"] .point-card {
    background: var(--card-bg);
    border-color: var(--border);
}
[data-theme="dark"] .exam-header-strip {
    background: rgba(15, 23, 42, 0.5);
    color: var(--primary-text);
    border-color: var(--border);
}
[data-theme="dark"] .transcript-btn {
    background: rgba(30, 41, 59, 0.5);
    border-color: var(--border);
    color: var(--primary-text);
}
[data-theme="dark"] .transcript-btn:hover {
    background: var(--primary);
    color: white;
}
[data-theme="dark"] .btn-record {
    background: #1e3a5f;
    color: white;
}
[data-theme="dark"] .btn-record:hover {
    background: #2563eb;
    color: white;
}
[data-theme="dark"] .btn-record.recording {
    background: #dc2626;
}
[data-theme="dark"] h2 { color: var(--primary-text); }
[data-theme="dark"] .recorder-info p:first-child { color: var(--primary-text); }
[data-theme="dark"] .back-btn{background:#fbbf24;color:#1e293b!important;border-color:#d97706}
[data-theme="dark"] .back-btn:hover{background:#f59e0b;border-color:#b45309}

/* ── Theme Toggle (in index.html) ── */
.theme-toggle {
    position: fixed; top: 16px; right: 16px; z-index: 1100;
    width: 44px; height: 44px; border-radius: 10px;
    background: white; border: 1px solid var(--glass-border);
    box-shadow: 0 4px 14px rgba(0,0,0,.08);
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    color: var(--text-muted); transition: all .25s ease;
    backdrop-filter: blur(8px);
}
.theme-toggle svg { width: 20px; height: 20px; }
.theme-toggle:hover { background: var(--primary); color: white; transform: scale(1.05); }
[data-theme="dark"] .theme-toggle { background: rgba(30,41,59,0.8); }
[data-theme="dark"] .theme-toggle:hover { background: var(--primary); color: white; }

@media (max-width: 768px) {
    .theme-toggle { width: 38px; height: 38px; top: 14px; right: 14px; }
    .theme-toggle svg { width: 17px; height: 17px; }
}
