/* BijakQuiz - Design System (matches brand mockup: dark/gold, bold, card-based) */
:root {
    --bq-dark: #121218;
    --bq-dark-2: #1c1c26;
    --bq-dark-3: #26262f;
    --bq-gold: #f7b733;
    --bq-gold-dark: #dd9f1f;
    --bq-text: #16171b;
    --bq-muted: #6b7280;
    --bq-bg: #f7f7fa;
    --bq-border: #e9e9ef;
    --primary: #f7b733;
    --primary-dark: #dd9f1f;
}

* { box-sizing: border-box; }

body {
    font-family: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Naskh Arabic", "Scheherazade New", sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bq-bg);
    color: var(--bq-text);
}

main { flex: 1; }

a { text-decoration: none; }

h1, h2, h3, h4, h5, h6 { font-weight: 700; letter-spacing: -0.01em; }

.rounded-4 { border-radius: 1rem !important; }
.rounded-5 { border-radius: 1.5rem !important; }

.card {
    transition: box-shadow .2s ease, transform .2s ease;
    border-radius: 1rem;
}

.min-vh-50 { min-height: 50vh; }

/* ---------- Brand palette utilities ---------- */
.bg-brand-dark { background-color: var(--bq-dark) !important; }
.bg-brand-gold { background-color: var(--bq-gold) !important; }
.text-brand-gold { color: var(--bq-gold-dark) !important; }
.text-brand-dark { color: var(--bq-dark) !important; }

.btn-brand {
    background-color: var(--bq-gold);
    border-color: var(--bq-gold);
    color: var(--bq-dark);
    font-weight: 600;
    border-radius: .75rem;
}
.btn-brand:hover, .btn-brand:focus {
    background-color: var(--bq-gold-dark);
    border-color: var(--bq-gold-dark);
    color: var(--bq-dark);
}
.btn-brand-dark {
    background-color: var(--bq-dark);
    border-color: var(--bq-dark);
    color: #fff;
    font-weight: 600;
    border-radius: .75rem;
}
.btn-brand-dark:hover, .btn-brand-dark:focus {
    background-color: var(--bq-dark-2);
    border-color: var(--bq-dark-2);
    color: #fff;
}
.btn-brand-outline {
    background: transparent;
    border: 1.5px solid var(--bq-dark);
    color: var(--bq-dark);
    font-weight: 600;
    border-radius: .75rem;
}
.btn-brand-outline:hover {
    background: var(--bq-dark);
    color: #fff;
}

.nav-pills .nav-link { color: var(--bq-text); font-weight: 600; white-space: nowrap; padding: .5rem .6rem; font-size: .9rem; }
.nav-pills .nav-link.active { background-color: var(--bq-dark); color: #fff; }

/* Bootstrap primary override (buttons/badges/links using btn-primary etc.) */
.btn-primary {
    background-color: var(--bq-gold) !important;
    border-color: var(--bq-gold) !important;
    color: var(--bq-dark) !important;
    font-weight: 600;
}
.btn-primary:hover, .btn-primary:focus, .btn-primary:active {
    background-color: var(--bq-gold-dark) !important;
    border-color: var(--bq-gold-dark) !important;
    color: var(--bq-dark) !important;
}
.btn-outline-primary {
    color: var(--bq-dark);
    border-color: var(--bq-dark);
}
.btn-outline-primary:hover {
    background-color: var(--bq-dark);
    border-color: var(--bq-dark);
    color: #fff;
}
.text-primary { color: var(--bq-gold-dark) !important; }
.bg-primary { background-color: var(--bq-dark) !important; }
.badge.bg-primary { background-color: var(--bq-gold) !important; color: var(--bq-dark) !important; }

/* ---------- Public navbar ---------- */
.bq-navbar {
    background-color: var(--bq-dark);
    padding: .9rem 0;
}
.bq-navbar .navbar-brand {
    font-weight: 800;
    color: #fff !important;
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: 1.25rem;
}
.bq-logo-badge {
    width: 34px;
    height: 34px;
    border-radius: .6rem;
    background: var(--bq-gold);
    color: var(--bq-dark);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.1rem;
}
.bq-navbar .nav-link {
    color: rgba(255,255,255,.75) !important;
    font-weight: 500;
}
.bq-navbar .nav-link:hover, .bq-navbar .nav-link.active {
    color: var(--bq-gold) !important;
}

/* ---------- Hero ---------- */
.bq-hero {
    background: linear-gradient(180deg, #fffdf5 0%, var(--bq-bg) 60%);
    position: relative;
    overflow: hidden;
}
.bq-hero h1 { font-size: clamp(2.2rem, 5vw, 3.2rem); line-height: 1.1; }
.bq-hero .highlight { color: var(--bq-gold-dark); }

/* Hero mascot: floats over a soft gold disc */
.bq-hero-mascot {
    position: relative;
    display: inline-block;
    width: min(100%, 460px);
}
.bq-hero-mascot::before {
    content: "";
    position: absolute;
    inset: 12% 8% 6% 8%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(247,183,51,.38) 0%, rgba(247,183,51,.14) 55%, rgba(247,183,51,0) 72%);
}
.bq-hero-mascot img {
    position: relative;
    width: 100%;
    height: auto;
    filter: drop-shadow(0 18px 22px rgba(18,18,24,.16));
    animation: bq-float 5s ease-in-out infinite;
}
@keyframes bq-float {
    0%, 100% { transform: translateY(0) rotate(-1.5deg); }
    50% { transform: translateY(-14px) rotate(1.5deg); }
}
@media (max-width: 991.98px) {
    .bq-hero-mascot { width: min(70%, 260px); }
}
@media (prefers-reduced-motion: reduce) {
    .bq-hero-mascot img { animation: none; }
}

/* Bottom call-to-action banner with the graduate mascot peeking out the top */
.bq-cta { background: #fdf1d6; }
.bq-cta-mascot { width: 84px; height: auto; }
@media (min-width: 768px) {
    .bq-cta-mascot { width: 150px; margin: -5.5rem 0 -2.25rem; }
}

.feature-icon-circle {
    width: 52px;
    height: 52px;
    border-radius: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    background: rgba(247,183,51,.15);
    color: var(--bq-gold-dark);
}

.bq-stats-banner {
    background: var(--bq-dark);
    border-radius: 1.5rem;
    color: #fff;
}
.bq-stats-banner .stat-num { font-size: 1.9rem; font-weight: 800; color: var(--bq-gold); }

.subject-chip {
    width: 56px; height: 56px; border-radius: 1rem;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 1.5rem; color: #fff;
}

/* ---------- Authenticated app shell (sidebar) ---------- */
.app-shell { display: flex; min-height: 100vh; width: 100%; }

.app-sidebar {
    width: 250px;
    flex-shrink: 0;
    background: var(--bq-dark);
    color: #fff;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    height: 100dvh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.app-sidebar > .p-3.border-top {
    flex-shrink: 0;
}
.app-sidebar .brand {
    padding: 1.1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: .6rem;
    font-weight: 800;
    font-size: 1.15rem;
    color: #fff;
    border-bottom: 1px solid rgba(255,255,255,.08);
}
.app-sidebar .nav-section-label {
    font-size: .68rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: rgba(255,255,255,.35);
    padding: .9rem 1.25rem .3rem;
}
.app-sidebar .nav-link {
    color: rgba(255,255,255,.72);
    padding: .55rem 1.25rem;
    font-size: .92rem;
    font-weight: 500;
    border-left: 3px solid transparent;
    display: flex;
    align-items: center;
    gap: .65rem;
}
.app-sidebar .nav-link:hover {
    color: #fff;
    background: rgba(255,255,255,.05);
}
.app-sidebar .nav-link.active {
    color: var(--bq-dark);
    background: var(--bq-gold);
    border-left-color: var(--bq-gold-dark);
    font-weight: 600;
    border-radius: 0 .6rem .6rem 0;
    margin-right: .5rem;
}
.app-sidebar .nav-link.active:hover { color: var(--bq-dark); }

.app-sidebar .user-card {
    margin: .75rem;
    padding: .7rem .85rem;
    background: var(--bq-dark-2);
    border-radius: .8rem;
    display: flex;
    align-items: center;
    gap: .6rem;
}
.app-sidebar .user-avatar {
    width: 36px; height: 36px; border-radius: 50%;
    background: var(--bq-gold);
    color: var(--bq-dark);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: .9rem; flex-shrink: 0;
}

.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.app-topbar {
    background: #fff;
    border-bottom: 1px solid var(--bq-border);
    padding: .85rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 10;
}

.app-content { padding: 1.5rem; flex: 1; }

@media (max-width: 991.98px) {
    .app-sidebar {
        position: fixed;
        top: 0;
        left: -260px;
        height: 100vh;
        height: 100dvh;
        z-index: 1050;
        transition: left .2s ease;
        box-shadow: 4px 0 20px rgba(0,0,0,.2);
    }
    .app-sidebar.open { left: 0; }
    .app-sidebar-backdrop {
        display: none;
        position: fixed; inset: 0;
        background: rgba(0,0,0,.4);
        z-index: 1040;
    }
    .app-sidebar-backdrop.show { display: block; }
}

/* ---------- Dashboard stat cards ---------- */
.stat-card {
    background: #fff;
    border-radius: 1rem;
    padding: 1.1rem 1.25rem;
    border: 1px solid var(--bq-border);
    height: 100%;
}
.stat-card .stat-icon {
    width: 38px; height: 38px; border-radius: .65rem;
    display: inline-flex; align-items: center; justify-content: center;
    background: rgba(247,183,51,.15);
    color: var(--bq-gold-dark);
    font-size: 1.1rem;
}
.stat-card .stat-value { font-size: 1.7rem; font-weight: 800; }
.stat-card .stat-label { font-size: .8rem; color: var(--bq-muted); }
.stat-card .stat-delta { font-size: .72rem; color: #16a34a; font-weight: 600; }

.jawi-text {
    font-family: "Noto Naskh Arabic", "Scheherazade New", serif;
    direction: rtl;
    font-size: 1.6em;
    display: inline-block;
}

.xp-pill {
    background: var(--bq-dark-2);
    color: var(--bq-gold);
    border-radius: .8rem;
    padding: .75rem .9rem;
}
.xp-bar-track { height: 6px; background: rgba(255,255,255,.15); border-radius: 99px; overflow: hidden; }
.xp-bar-fill { height: 100%; background: var(--bq-gold); }

/* Make form controls a bit larger on mobile */
@media (max-width: 576px) {
    .form-control-lg { font-size: 1rem; }
}
