/* ===== CNC Ramadan Quiz Theme ===== */

@font-face {
    font-family: 'Faruma';
    src: url('../fonts/Faruma.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

:root,
[data-bs-theme="dark"] {
    --bg-dark: #1a1a2e;
    --bg-card: #16213e;
    --green-primary: #1a5c2a;
    --green-light: #2d8a4e;
    --gold: #c9a84c;
    --gold-light: #e0c872;
    --text-light: #e8e8e8;
    --text-muted: #9a9aaa;
    --bs-body-bg: #1a1a2e;
    --bs-body-color: #e8e8e8;
}

/* ===== Base ===== */
body {
    background-color: var(--bg-dark) !important;
    color: var(--text-light) !important;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-image:
        radial-gradient(circle at 20% 50%, rgba(26, 92, 42, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(201, 168, 76, 0.06) 0%, transparent 50%),
        radial-gradient(circle at 50% 80%, rgba(22, 33, 62, 0.5) 0%, transparent 50%) !important;
}

main {
    flex: 1;
}

a {
    color: var(--gold);
}

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

/* ===== Navbar ===== */
.navbar {
    background-color: rgba(22, 33, 62, 0.95) !important;
    border-bottom: 2px solid var(--gold);
    backdrop-filter: blur(10px);
}

.navbar-brand {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-light) !important;
}

.nav-link {
    color: var(--text-light) !important;
    transition: color 0.3s;
}

.nav-link:hover {
    color: var(--gold) !important;
}

/* ===== Colors ===== */
.text-gold {
    color: var(--gold) !important;
}

.bg-gold {
    background-color: var(--gold) !important;
    color: #1a1a2e !important;
}

/* ===== Glass Card ===== */
.glass-card {
    background: rgba(22, 33, 62, 0.85) !important;
    border: 1px solid rgba(201, 168, 76, 0.2);
    border-radius: 16px;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s, box-shadow 0.2s;
    color: var(--text-light);
}

.glass-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.card-body p,
.card-body strong,
.card-body span {
    color: var(--text-light);
}

.card-title {
    color: var(--gold) !important;
}

/* ===== Buttons ===== */
.btn-gold {
    background: linear-gradient(135deg, var(--gold), var(--gold-light));
    color: #1a1a2e !important;
    border: none;
    font-weight: 600;
    padding: 10px 24px;
    border-radius: 8px;
    transition: all 0.3s;
}

.btn-gold:hover {
    background: linear-gradient(135deg, var(--gold-light), var(--gold));
    color: #1a1a2e !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(201, 168, 76, 0.4);
}

.btn-gold:disabled {
    background: #444;
    color: #888 !important;
    transform: none;
    box-shadow: none;
}

.btn-outline-gold {
    border: 1px solid var(--gold);
    color: var(--gold) !important;
    background: transparent;
    border-radius: 8px;
    transition: all 0.3s;
}

.btn-outline-gold:hover {
    background: rgba(201, 168, 76, 0.15);
    border-color: var(--gold-light);
    color: var(--gold-light) !important;
}

/* ===== Alert ===== */
.alert-gold {
    background: rgba(201, 168, 76, 0.15);
    border: 1px solid var(--gold);
    color: var(--gold) !important;
    border-radius: 8px;
}

.alert-success {
    background: rgba(26, 92, 42, 0.3) !important;
    border-color: var(--green-light) !important;
    color: #8fdf8f !important;
}

.alert-danger {
    background: rgba(180, 40, 40, 0.3) !important;
    border-color: #b42828 !important;
    color: #f5a0a0 !important;
}

/* ===== Tables ===== */
.table-dark,
.table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--text-light);
    --bs-table-hover-bg: rgba(201, 168, 76, 0.1);
    --bs-table-hover-color: var(--text-light);
    --bs-table-active-bg: rgba(201, 168, 76, 0.15);
    --bs-table-active-color: var(--gold);
    --bs-table-border-color: rgba(255, 255, 255, 0.05);
    color: var(--text-light) !important;
}

.table-dark thead th,
.table thead th {
    background: rgba(26, 92, 42, 0.3);
    color: var(--gold) !important;
    border-bottom: 2px solid var(--gold);
    font-weight: 600;
}

.table-dark td,
.table td {
    color: var(--text-light) !important;
    border-color: rgba(255, 255, 255, 0.05);
    vertical-align: middle;
}

.table-active td,
tr.table-active td {
    color: var(--gold) !important;
}

/* ===== Tabs ===== */
.nav-tabs {
    border-bottom: 2px solid rgba(201, 168, 76, 0.3);
}

.nav-tabs .nav-link {
    border: none;
    color: var(--text-muted) !important;
    padding: 12px 24px;
    border-radius: 8px 8px 0 0;
    transition: all 0.3s;
}

.nav-tabs .nav-link:hover {
    color: var(--gold) !important;
    background: rgba(201, 168, 76, 0.1);
}

.nav-tabs .nav-link.active {
    background: rgba(26, 92, 42, 0.3) !important;
    color: var(--gold) !important;
    border-bottom: 3px solid var(--gold);
}

/* ===== Forms ===== */
.form-control {
    background-color: rgba(26, 26, 46, 0.8) !important;
    border: 1px solid rgba(201, 168, 76, 0.3);
    color: var(--text-light) !important;
    border-radius: 8px;
    padding: 10px 16px;
}

.form-control:focus {
    background-color: rgba(26, 26, 46, 0.95) !important;
    border-color: var(--gold);
    color: var(--text-light) !important;
    box-shadow: 0 0 0 0.2rem rgba(201, 168, 76, 0.25);
}

.form-control::placeholder {
    color: var(--text-muted) !important;
}

.form-label {
    color: var(--gold) !important;
    font-weight: 500;
}

.form-check-input {
    background-color: rgba(26, 26, 46, 0.8);
    border-color: rgba(201, 168, 76, 0.5);
}

.form-check-input:checked {
    background-color: var(--green-primary);
    border-color: var(--green-primary);
}

.form-check-label {
    color: var(--text-light);
}

.invalid-feedback {
    color: #f5a0a0 !important;
}

/* ===== Dhivehi (RTL) Text ===== */
.dv {
    font-family: 'Faruma', 'MV Boli', Tahoma, sans-serif;
    direction: rtl;
    text-align: right;
    line-height: 1.8;
}

/* ===== Choice Options (Quiz) ===== */
.btn-check:checked + .btn-outline-gold {
    background: rgba(26, 92, 42, 0.4);
    border-color: var(--gold);
    color: var(--gold-light) !important;
    box-shadow: 0 0 15px rgba(201, 168, 76, 0.3);
}

.choice-letter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    background: transparent;
    border: 2px solid rgba(201, 168, 76, 0.35);
    border-radius: 50%;
    margin-left: 16px;
    font-weight: 800;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    color: var(--gold);
    direction: ltr;
    flex-shrink: 0;
    transition: all 0.3s;
    font-family: 'Segoe UI', Tahoma, sans-serif;
}

.btn-outline-gold:hover .choice-letter {
    border-color: var(--gold);
    background: rgba(201, 168, 76, 0.1);
}

.btn-check:checked + .btn-outline-gold .choice-letter {
    background: var(--gold);
    border-color: var(--gold);
    color: #1a1a2e;
    box-shadow: 0 0 12px rgba(201, 168, 76, 0.4);
}

/* ===== Score Display ===== */
.score-display {
    padding: 20px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(26, 92, 42, 0.3), rgba(201, 168, 76, 0.1));
}

/* ===== Result Banners ===== */
.result-banner {
    padding: 14px 20px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.result-correct {
    background: linear-gradient(135deg, rgba(26, 92, 42, 0.4), rgba(45, 138, 78, 0.2));
    border-left: 4px solid var(--green-light);
    color: #8fdf8f;
}

.result-wrong {
    background: linear-gradient(135deg, rgba(180, 40, 40, 0.3), rgba(120, 30, 30, 0.15));
    border-left: 4px solid #b42828;
    color: #f5a0a0;
}

.result-pending {
    background: linear-gradient(135deg, rgba(201, 168, 76, 0.15), rgba(201, 168, 76, 0.05));
    border-left: 4px solid var(--gold);
    color: var(--gold);
}

.result-card {
    border-left: 3px solid var(--gold);
}

/* ===== Badges ===== */
.badge.bg-success {
    background: rgba(26, 92, 42, 0.8) !important;
    color: #fff !important;
}

.badge.bg-danger {
    background: rgba(180, 40, 40, 0.8) !important;
    color: #fff !important;
}

.badge.bg-pending {
    background: rgba(201, 168, 76, 0.25) !important;
    color: var(--gold) !important;
    border: 1px solid rgba(201, 168, 76, 0.4);
}

/* ===== Muted text override ===== */
.text-muted {
    color: var(--text-muted) !important;
}

/* ===== Decorative Lanterns ===== */
.lantern {
    position: fixed;
    width: 40px;
    height: 60px;
    background: radial-gradient(ellipse, rgba(201, 168, 76, 0.3), transparent 70%);
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    pointer-events: none;
    z-index: 0;
    animation: lanternGlow 3s ease-in-out infinite alternate;
}

.lantern::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 10px;
    background: var(--gold);
}

.lantern-left {
    top: 80px;
    left: 20px;
    animation-delay: 0s;
}

.lantern-right {
    top: 80px;
    right: 20px;
    animation-delay: 1.5s;
}

.heartSVG {
    visibility: hidden;
}

/* ===== Auth Card ===== */
.auth-card {
    position: relative;
    overflow: visible;
}

/* ===== Fanos Side Lanterns ===== */
.fanos-side {
    position: fixed;
    top: 0;
    z-index: 10;
    pointer-events: none;
    width: 0;
    overflow: visible;
}

.fanos-side-left { left: 120px; }
.fanos-side-right { right: 120px; }

.fanos-side .fanos-wrap {
    transform: scale(0.35);
    transform-origin: top center;
    width: 300px;
    position: relative;
    left: -150px;
}

.fanos-side-left .fanos-wrap {
    animation: fanosSwingSide 5s ease-in-out infinite;
}
.fanos-side-right .fanos-wrap {
    animation: fanosSwingSide 5s ease-in-out 1s infinite;
}

@keyframes fanosSwingSide {
    0% { transform: scale(0.35) rotate(5deg); }
    50% { transform: scale(0.35) rotate(-5deg); }
    100% { transform: scale(0.35) rotate(5deg); }
}

/* ===== Fanos Base Styles ===== */
.fanos-wrap {
    width: 300px;
    position: relative;
}

.fanos-wire {
    margin: 0 auto;
    height: 130px;
    width: 10px;
    background: rgba(201, 168, 76, 0.4);
    border: 3px rgba(201, 168, 76, 0.6) solid;
}

.fanos {
    height: 380px;
    padding: 10px;
    margin: 0 auto;
    position: relative;
    top: -20px;
}

.fanos-sc {
    margin: 0 auto;
    width: 30px;
    height: 30px;
    border-radius: 100%;
    background: #c9a84c;
    border: 5px #7a5f20 solid;
    position: relative;
    z-index: 5;
}

.fanos-hc {
    width: 120px;
    height: 120px;
    position: absolute;
    top: 25px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1;
    border-radius: 100%;
    background: #b8923a;
    border: 5px #7a5f20 solid;
}

.fanos-bq {
    margin: 0 auto;
    position: relative;
    top: 50px;
    z-index: 3;
}

.fanos-line {
    margin: 0 auto;
    width: 200px;
    height: 30px;
    padding-top: 3px;
    background: #c9a84c;
    border: 5px #7a5f20 solid;
    overflow: hidden;
    text-align: center;
}

.fanos-ball {
    width: 15px;
    height: 15px;
    margin: auto 5px;
    display: inline-block;
    border-radius: 100%;
    background: #e0c872;
    border: 5px #7a5f20 solid;
}

.fanos-tt {
    margin: 0 auto;
    width: 210px;
    height: 0;
    border-left: 25px transparent solid;
    border-right: 25px transparent solid;
    border-bottom: 30px #7a5f20 solid;
    position: relative;
    top: -5px;
}

.fanos-tt::after {
    content: '';
    display: block;
    position: absolute;
    z-index: 3;
    left: 50%;
    transform: translateX(-50%);
    top: 5px;
    width: 155px;
    height: 0;
    border-left: 15px transparent solid;
    border-right: 15px transparent solid;
    border-bottom: 20px #b8923a solid;
}

.fanos-box {
    width: 170px;
    margin: 0 auto;
    height: 180px;
    background: rgba(201, 168, 76, 0.15);
    position: relative;
    top: -10px;
    z-index: 1;
    border: 5px #7a5f20 solid;
}

.fanos-candel {
    height: 60px;
    width: 30px;
    background: #fffbe6;
    border: 5px #7a5f20 solid;
    border-bottom: 0;
    position: absolute;
    z-index: 1;
    left: 65px;
    bottom: 0;
}

.fanos-candel::after {
    content: '';
    display: block;
    margin: 0 auto;
    position: relative;
    top: -20px;
    width: 10px;
    height: 15px;
    border-radius: 100%;
    background: #ff9b00;
    border: 5px #c97a00 solid;
    box-shadow: 0 0 10px rgba(255, 155, 0, 0.8), 0 0 25px rgba(255, 155, 0, 0.4);
}

.fanos-col {
    margin: 0 auto;
    width: 90px;
    height: 170px;
    border-left: 5px #7a5f20 solid;
    border-right: 5px #7a5f20 solid;
    position: relative;
    z-index: 2;
    background: rgba(201, 168, 76, 0.1);
}

.fanos-final {
    position: relative;
    z-index: 4;
    top: -15px;
}

.fanos-lt {
    margin: 0 auto;
    width: 245px;
    height: 0;
    border-left: 25px transparent solid;
    border-right: 25px transparent solid;
    border-bottom: 25px #7a5f20 solid;
    position: relative;
    top: -5px;
}

.fanos-lt::after {
    content: '';
    display: block;
    position: absolute;
    z-index: 3;
    left: 50%;
    transform: translateX(-50%);
    top: 5px;
    width: 190px;
    height: 0;
    border-left: 15px transparent solid;
    border-right: 15px transparent solid;
    border-bottom: 15px #b8923a solid;
}

.fanos-glow-wrap {
    position: absolute;
    z-index: 0;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 300px;
    height: 300px;
}

.fanos-glow {
    width: 100%;
    height: 100%;
    padding: 30px;
    background: rgba(255, 155, 0, 0.08);
    border-radius: 100%;
    animation: fanosFlash 1s ease-in-out infinite;
}

@keyframes fanosFlash {
    0% { background: rgba(255, 155, 0, 0.08); }
    50% { background: rgba(255, 155, 0, 0.04); }
    100% { background: rgba(255, 155, 0, 0.08); }
}

/* ===== Fanos Card Lanterns (mobile only) ===== */
.fanos-card {
    display: none;
}

@media (max-width: 768px) {
    .fanos-side { display: none; }
    .fanos-card {
        display: block;
        position: absolute;
        top: 0px;
        z-index: 100;
        pointer-events: none;
        width: 0;
        overflow: visible;
    }
    .fanos-card-left { left: 30px; }
    .fanos-card-right { right: 30px; }
    .fanos-card-left.fanos-card-tall { left: 80px; }
    .fanos-card-right.fanos-card-tall { right: 80px; }
    .fanos-card .fanos-wrap {
        transform: scale(0.12);
        transform-origin: top center;
        width: 300px;
        position: relative;
        left: -150px;
    }
    .fanos-card-tall .fanos-wrap {
        transform: scale(0.16);
    }
    .fanos-card-left .fanos-wrap {
        animation: fanosSwingCard 5s ease-in-out infinite;
    }
    .fanos-card-right .fanos-wrap {
        animation: fanosSwingCard 5s ease-in-out 1s infinite;
    }
    .fanos-card-tall.fanos-card-left .fanos-wrap {
        animation: fanosSwingCardTall 5s ease-in-out 0.5s infinite;
    }
    .fanos-card-tall.fanos-card-right .fanos-wrap {
        animation: fanosSwingCardTall 5s ease-in-out 1.5s infinite;
    }
}

@keyframes fanosSwingCard {
    0% { transform: scale(0.12) rotate(4deg); }
    50% { transform: scale(0.12) rotate(-4deg); }
    100% { transform: scale(0.12) rotate(4deg); }
}

@keyframes fanosSwingCardTall {
    0% { transform: scale(0.16) rotate(4deg); }
    50% { transform: scale(0.16) rotate(-4deg); }
    100% { transform: scale(0.16) rotate(4deg); }
}

.light-string:nth-child(1) .light-bulb { animation-delay: 0s; }
.light-string:nth-child(2) .light-bulb { animation-delay: 0.5s; }
.light-string:nth-child(3) .light-bulb { animation-delay: 1s; }
.light-string:nth-child(4) .light-bulb { animation-delay: 1.5s; }
.light-string:nth-child(5) .light-bulb { animation-delay: 2s; }

@keyframes lightGlow {
    0% { opacity: 0.5; box-shadow: 0 0 8px rgba(201, 168, 76, 0.3), 0 0 15px rgba(201, 168, 76, 0.15); }
    100% { opacity: 1; box-shadow: 0 0 15px rgba(201, 168, 76, 0.8), 0 0 35px rgba(201, 168, 76, 0.35), 0 4px 20px rgba(201, 168, 76, 0.25); }
}

@keyframes lanternGlow {
    0% { opacity: 0.4; }
    100% { opacity: 0.8; }
}

/* ===== Confirm Modal ===== */
.modal-content.glass-card {
    background: rgba(22, 33, 62, 0.97) !important;
    border: 1px solid rgba(201, 168, 76, 0.3) !important;
    box-shadow: 0 16px 60px rgba(0, 0, 0, 0.6);
}

.modal-backdrop.show {
    backdrop-filter: blur(4px);
}

.modal-footer {
    border-top: none !important;
}

/* ===== Footer ===== */
/* ===== Footer ===== */
footer {
    border-top: 1px solid rgba(201, 168, 76, 0.2);
    color: var(--text-muted);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .lantern { display: none; }

    .glass-card {
        border-radius: 12px;
    }

    .table-responsive {
        font-size: 0.9rem;
    }

    .display-3 {
        font-size: 2.5rem;
    }
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: rgba(201, 168, 76, 0.3);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(201, 168, 76, 0.5);
}
