/* ============================================================
   BGM Bible College LMS — original theme
   navy #0D1B2A | red #C8102E | blue #4099ff | gold #ffb64d
   page bg #F8FAFC | borders #E2E8F0 | muted #64748B | radius 5px
   ============================================================ */
:root {
    --navy: #0D1B2A;
    --navy-2: #12263d;
    --red: #C8102E;
    --blue: #4099ff;
    --blue-dark: #2f7fd6;
    --gold: #ffb64d;
    --gold-dark: #e09a2e;
    --bg: #F8FAFC;
    --border: #E2E8F0;
    --muted: #64748B;
    --text: #1e293b;
    --radius: 5px;
    --shadow: 0 1px 3px rgba(13, 27, 42, .08), 0 4px 12px rgba(13, 27, 42, .06);
}
* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: 'Poppins', sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.55;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
.inline {
    font-family: ui-monospace, Menlo, Consolas, monospace;
    background: #eef2f7;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1px 6px;
    font-size: 12px;
}

/* ---------------- layout ---------------- */
.app { min-height: 100vh; }
.sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: 240px;
    background: var(--navy);
    color: #dbe4f0;
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: transform .25s ease;
}
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 18px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.sidebar-brand img { width: 40px; height: 40px; border-radius: 50%; }
.sidebar-brand-name { font-weight: 600; font-size: 15px; color: #fff; }
.nav { padding: 12px; flex: 1; overflow-y: auto; }
.nav a {
    display: block;
    color: #c3cfdf;
    padding: 10px 12px;
    border-radius: var(--radius);
    margin-bottom: 4px;
    border-left: 3px solid transparent;
}
.nav a:hover { background: rgba(255, 182, 77, .12); color: var(--gold); text-decoration: none; }
.nav a.active {
    background: rgba(255, 182, 77, .16);
    color: var(--gold);
    border-left-color: var(--gold);
    font-weight: 600;
}
.sidebar-logout { padding: 12px; border-top: 1px solid rgba(255, 255, 255, .08); }
.sidebar-logout a {
    display: block; text-align: center;
    padding: 10px; border-radius: var(--radius);
    background: rgba(200, 16, 46, .18); color: #ff8fa0;
}
.sidebar-logout a:hover { background: var(--red); color: #fff; text-decoration: none; }
.main { margin-left: 240px; min-height: 100vh; display: flex; flex-direction: column; transition: margin .25s ease; }
.topbar {
    background: #fff;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 1px 4px rgba(13, 27, 42, .06);
    padding: 12px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 900;
}
.hamburger {
    display: none;
    background: none; border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 20px; line-height: 1;
    padding: 6px 10px; cursor: pointer; color: var(--navy);
}
.page-title { font-size: 18px; font-weight: 600; color: var(--navy); flex: 1; }
.user-menu { display: flex; align-items: center; gap: 10px; }
.user-name { font-weight: 500; color: var(--navy); }
.user-badge { font-size: 11px; }
.content { padding: 24px; max-width: 1200px; width: 100%; margin: 0 auto; flex: 1; }
.footer-bar {
    text-align: center;
    padding: 14px;
    color: var(--muted);
    font-size: 12px;
    border-top: 1px solid var(--border);
    background: #fff;
}

/* ---------------- cards ---------------- */
.card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    overflow: hidden;
}
.card-header {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    color: var(--navy);
    background: #fbfcfe;
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.card-body { padding: 18px; }
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}
.stat-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 18px;
    text-align: center;
}
.stat-num { font-size: 32px; font-weight: 700; color: var(--gold-dark); }
.stat-label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .5px; margin-top: 4px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }

/* ---------------- buttons ---------------- */
.btn {
    display: inline-block;
    padding: 9px 18px;
    border-radius: var(--radius);
    border: 1px solid transparent;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-align: center;
}
.btn:hover { text-decoration: none; opacity: .92; }
.btn-primary, .gold-btn { background: var(--gold); color: var(--navy); }
.btn-secondary { background: var(--navy); color: #fff; }
.btn-danger { background: var(--red); color: #fff; }
.btn-success { background: #16a34a; color: #fff; }
.btn-blue, .btn-login { background: var(--blue); color: #fff; }
.btn-blue:hover, .btn-login:hover { background: var(--blue-dark); }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-block { display: block; width: 100%; }

/* ---------------- tables ---------------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 13px; }
table.table th {
    background: #eaf0f8;
    color: var(--navy);
    text-align: left;
    padding: 10px 12px;
    font-weight: 600;
    white-space: nowrap;
}
table.table td { padding: 10px 12px; border-top: 1px solid var(--border); vertical-align: middle; }
table.table tr:nth-child(even) td { background: #fafbfe; }
table.table tr:hover td { background: #f1f5fb; }

/* ---------------- forms ---------------- */
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-weight: 500; margin-bottom: 6px; color: var(--navy); }
.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 14px;
    background: #fff;
    color: var(--text);
}
.form-control:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(64, 153, 255, .15); }
textarea.form-control { min-height: 110px; resize: vertical; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.input-group { display: flex; align-items: stretch; margin-bottom: 14px; }
.input-addon {
    display: flex; align-items: center; justify-content: center;
    background: #eef1f6;
    border: 1px solid var(--border);
    border-right: 0;
    border-radius: var(--radius) 0 0 var(--radius);
    padding: 0 14px;
    color: var(--muted);
}
.input-addon svg { width: 18px; height: 18px; }
.input-group .form-control { border-radius: 0 var(--radius) var(--radius) 0; margin: 0; }
.checkbox-label { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); cursor: pointer; }
.checkbox-label input { width: 16px; height: 16px; accent-color: var(--blue); }

/* ---------------- alerts & badges ---------------- */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    border: 1px solid transparent;
}
.alert-success { background: #dcfce7; border-color: #86efac; color: #166534; }
.alert-danger  { background: #fee2e2; border-color: #fca5a5; color: #991b1b; }
.alert-warning { background: #fef3c7; border-color: #fcd34d; color: #92400e; }
.alert-info    { background: #dbeafe; border-color: #93c5fd; color: #1e40af; }
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}
.badge-success { background: #dcfce7; color: #166534; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger  { background: #fee2e2; color: #991b1b; }
.badge-info    { background: #dbeafe; color: #1e40af; }
.badge-primary { background: #e0ecff; color: #1d4ed8; }

/* ---------------- toasts ---------------- */
.toast-container {
    position: fixed;
    top: 16px; right: 16px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 340px;
}
.toast {
    padding: 12px 16px;
    border-radius: var(--radius);
    color: #fff;
    font-size: 13px;
    box-shadow: 0 6px 20px rgba(13, 27, 42, .25);
    animation: toast-in .3s ease;
}
.toast-success { background: #16a34a; }
.toast-error   { background: var(--red); }
.toast-info    { background: var(--blue); }
@keyframes toast-in {
    from { transform: translateX(30px); opacity: 0; }
    to   { transform: translateX(0); opacity: 1; }
}

/* ---------------- login ---------------- */
.login-wrap {
    min-height: 100vh;
    background: #4A90D9;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.login-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(13, 27, 42, .35);
    max-width: 380px;
    width: 100%;
    padding: 34px 30px 24px;
}
.login-logo-ring {
    width: 96px; height: 96px;
    margin: 0 auto 14px;
    background: #fff;
    border: 3px solid #e6edf5;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 14px rgba(13, 27, 42, .12);
    padding: 6px;
    position: relative;
}
.login-logo-ring::before {
    content: '';
    position: absolute;
    inset: -10px;
    border-radius: 50%;
    border: 3px dashed #ffb64d;
    animation: logoSpin 14s linear infinite;
    pointer-events: none;
}
.login-logo-ring::after {
    content: '';
    position: absolute;
    inset: -18px;
    border-radius: 50%;
    border: 2px dotted rgba(255, 182, 77, .45);
    animation: logoSpinRev 22s linear infinite;
    pointer-events: none;
}
@keyframes logoSpin { to { transform: rotate(360deg); } }
@keyframes logoSpinRev { to { transform: rotate(-360deg); } }
.login-logo { width: 72px; height: 72px; display: block; border-radius: 50%; object-fit: cover; }
.login-title { text-align: center; color: var(--navy); font-size: 22px; font-weight: 600; margin: 0 0 20px; }
.login-card .input-group { margin-bottom: 12px; }
.login-remember { margin: 2px 0 16px; }
.login-card .btn-login { width: 100%; padding: 12px; font-size: 15px; font-weight: 600; }
.login-footer { text-align: center; color: var(--muted); font-size: 12px; margin-top: 18px; }
.login-note {
    background: #fffbe8;
    border: 1px solid #f5d76e;
    color: #7c5a10;
    border-radius: var(--radius);
    padding: 12px 14px;
    margin-bottom: 16px;
    font-size: 13px;
}

/* ---------------- exams ---------------- */
.exam-timer {
    position: sticky;
    top: 70px;
    z-index: 800;
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
}
.timer-badge {
    font-family: ui-monospace, Menlo, Consolas, monospace;
    font-size: 20px;
    font-weight: 700;
    background: var(--gold);
    color: var(--navy);
    padding: 8px 22px;
    border-radius: 30px;
    box-shadow: var(--shadow);
}
.timer-badge.timer-red { background: var(--red); color: #fff; }
.clock-display {
    font-family: ui-monospace, Menlo, Consolas, monospace;
    font-size: 42px;
    font-weight: 700;
    color: var(--navy);
    text-align: center;
}
.question-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 18px;
    margin-bottom: 16px;
}
.question-text { font-weight: 600; color: var(--navy); margin-bottom: 12px; }
.option-label {
    display: block;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 8px;
    cursor: pointer;
}
.option-label:hover { border-color: var(--blue); background: #f2f7ff; }
.option-label input { margin-right: 10px; accent-color: var(--blue); }
.option-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 14px;
    margin-bottom: 10px;
    cursor: pointer;
    background: #fff;
}
.option-card input[type="radio"] { display: none; }
.option-card:hover { border-color: var(--blue); background: #f2f7ff; }
.option-card.selected, .option-card:has(input:checked) { border-color: var(--blue); box-shadow: 0 0 0 2px rgba(64, 153, 255, .25); background: #f2f7ff; }
.option-letter {
    flex: 0 0 auto;
    width: 28px; height: 28px;
    border-radius: 50%;
    background: #eef2f7;
    color: var(--navy);
    font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px;
}
.option-card.selected .option-letter, .option-card:has(input:checked) .option-letter { background: var(--blue); color: #fff; }
.qnav { display: flex; justify-content: space-between; gap: 12px; margin-top: 20px; }
.progress { background: #e8edf4; border-radius: 20px; height: 10px; overflow: hidden; }
.progress > div { background: var(--blue); height: 100%; border-radius: 20px; transition: width .3s; }
.review-correct { color: #166534; border-color: #86efac !important; background: #f0fdf4; }
.review-wrong   { color: #991b1b; border-color: #fca5a5 !important; background: #fef2f2; }
.score-big { font-size: 44px; font-weight: 700; color: var(--blue); text-align: center; }

/* ---------------- content bits ---------------- */
.search-bar { display: flex; gap: 8px; margin-bottom: 16px; }
.search-bar .form-control { flex: 1; }
.announcement {
    background: #fff;
    border: 1px solid var(--border);
    border-left: 4px solid var(--gold);
    border-radius: var(--radius);
    padding: 14px 16px;
    margin-bottom: 12px;
    box-shadow: var(--shadow);
}
.announcement h4 { margin: 0 0 6px; color: var(--navy); }
.announcement .meta { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.lesson-item {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 8px;
    background: #fff;
}
.lesson-item:hover { border-color: var(--blue); }
.lesson-item .lesson-num {
    width: 30px; height: 30px; border-radius: 50%;
    background: var(--navy); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 600; flex: 0 0 auto;
}
.lesson-item.done .lesson-num { background: #16a34a; }
.video-wrap { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; border-radius: var(--radius); }
.video-wrap iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0; }

/* ---------------- install ---------------- */
.install-wrap {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--navy) 0%, #1b3a5f 100%);
    display: flex; align-items: flex-start; justify-content: center;
    padding: 40px 20px;
}
.install-wrap .card { max-width: 560px; width: 100%; }

/* ---------------- utilities ---------------- */
.text-muted { color: var(--muted); }
.text-center { text-align: center; }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }
.d-flex { display: flex; align-items: center; gap: 10px; }
.justify-between { justify-content: space-between; }
.empty-state {
    text-align: center; color: var(--muted);
    padding: 40px 20px;
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    background: #fff;
}

/* ---------------- responsive ---------------- */
.hamburger { display: none; }
@media (max-width: 900px) {
    .hamburger { display: inline-block; }
    .sidebar { transform: translateX(-100%); }
    body.sidebar-open .sidebar { transform: translateX(0); }
    .main { margin-left: 0; }
    .content { padding: 16px; }
    .form-row { grid-template-columns: 1fr; }
    .topbar { padding: 10px 14px; }
    .user-name { display: none; }
}
@media (min-width: 901px) {
    body.sidebar-open .sidebar { transform: translateX(-100%); }
    body.sidebar-open .main { margin-left: 0; }
}

/* Sidebar dropdown groups */
.nav-group { margin-bottom: 4px; }
.nav-group-head {
    width: 100%; display: flex; justify-content: space-between; align-items: center;
    background: none; border: none; cursor: pointer; font: inherit;
    color: #c3cfdf; padding: 10px 12px; border-radius: var(--radius);
    border-left: 3px solid transparent; text-align: left;
}
.nav-group-head:hover { background: rgba(255, 182, 77, .12); color: var(--gold); }
.nav-group-head.active { color: var(--gold); font-weight: 600; }
.nav-caret { font-size: .7rem; transition: transform .2s ease; }
.nav-group.open .nav-caret { transform: rotate(180deg); }
.nav-group-body { display: none; padding-left: 12px; border-left: 1px solid rgba(255,255,255,.08); margin-left: 18px; }
.nav-group.open .nav-group-body { display: block; }
.nav-group-body a { font-size: .9rem; padding: 8px 12px; }
