/* MARHafizh - Custom Styles (Sprint 1) */

:root {
    --mh-primary: #006c49;
    --mh-primary-light: #10b981;
    --mh-bg: #f8f9ff;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

.marhafizh-auth-bg {
    background-color: var(--mh-bg);
    background-image: radial-gradient(var(--mh-primary-light) 0.5px, transparent 0.5px);
    background-size: 24px 24px;
}

.marhafizh-logo {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(16, 185, 129, 0.15);
    color: var(--mh-primary);
    border-radius: 20px;
    font-size: 28px;
}

.navbar-brand {
    letter-spacing: 0.3px;
}

/* Bottom Navigation */
.has-bottom-nav {
    padding-bottom: 72px;
}

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1030;
    display: flex;
    background: #ffffff;
    border-top: 1px solid #e5e7eb;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.06);
    overflow-x: auto;
    padding: 4px 4px calc(4px + env(safe-area-inset-bottom));
}

.bottom-nav-item,
.bottom-nav-more {
    flex: 1 1 0;
    min-width: 64px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 8px 4px;
    border: none;
    background: none;
    color: #6b7280;
    text-decoration: none;
    font-size: 0.7rem;
    border-radius: 12px;
    transition: color 0.15s, background-color 0.15s;
}

.bottom-nav-item i,
.bottom-nav-more i {
    font-size: 1.25rem;
    line-height: 1;
}

.bottom-nav-item:hover,
.bottom-nav-more:hover {
    color: var(--mh-primary);
}

.bottom-nav-item.active,
.bottom-nav-item.active .bottom-nav-more,
.dropup.active .bottom-nav-more {
    color: var(--mh-primary);
    background-color: rgba(16, 185, 129, 0.12);
    font-weight: 600;
}

.dropup.bottom-nav-item {
    padding: 0;
    display: flex;
}

/* =========================================================
   Tema Anak-anak (halaman Siswa) — .kids-theme
   Dipisah dari tema utama supaya panel Admin/Guru/Orang Tua
   tetap rapi & profesional seperti semula.
   ========================================================= */
.kids-theme {
    font-family: 'Nunito', 'Segoe UI', system-ui, sans-serif;
    background:
        radial-gradient(circle at 10% 8%, rgba(250, 204, 21, 0.16) 0, transparent 40%),
        radial-gradient(circle at 90% 4%, rgba(56, 189, 248, 0.18) 0, transparent 40%),
        linear-gradient(180deg, #fdfaf1 0%, #eef8ff 45%, #eefcf2 100%);
    background-attachment: fixed;
}

.kids-theme h1,
.kids-theme h2,
.kids-theme h3,
.kids-theme .navbar-brand,
.kids-theme .btn {
    font-family: 'Baloo 2', 'Segoe UI', system-ui, sans-serif;
}

/* Navbar ceria */
.kids-theme .navbar.bg-success {
    background: linear-gradient(90deg, #16a34a, #0ea5b7 60%, #0ea5e9) !important;
    border-radius: 0 0 26px 26px;
    box-shadow: 0 6px 18px rgba(14, 165, 183, 0.28);
}

/* Kartu jadi bulat & berwarna-warni saat disentuh */
.kids-theme .card {
    border-radius: 24px !important;
    border: none;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.kids-theme .card:hover {
    transform: translateY(-4px) scale(1.015);
    box-shadow: 0 12px 26px rgba(15, 23, 42, 0.14);
}

.kids-theme a .card {
    color: inherit;
}

/* Kartu "hero" sambutan di dashboard */
.kids-theme .kids-hero {
    position: relative;
    overflow: hidden;
    background: linear-gradient(120deg, #d1fae5, #e0f2fe) !important;
}

.kids-theme .kids-hero::after {
    content: "⭐";
    position: absolute;
    right: 18px;
    top: 10px;
    font-size: 30px;
    opacity: 0.55;
    animation: kidsFloat 3s ease-in-out infinite;
}

.kids-theme .kids-hero::before {
    content: "🌟";
    position: absolute;
    right: 60px;
    bottom: 8px;
    font-size: 20px;
    opacity: 0.4;
    animation: kidsFloat 2.4s ease-in-out infinite reverse;
}

@keyframes kidsFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

/* Tombol besar & empuk */
.kids-theme .btn-success {
    background: linear-gradient(90deg, #22c55e, #16a34a);
    border: none;
    box-shadow: 0 4px 0 #0f7a34;
    font-weight: 700;
}

.kids-theme .btn-success:hover {
    background: linear-gradient(90deg, #22c55e, #16a34a);
    filter: brightness(1.05);
}

.kids-theme .btn-success:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #0f7a34;
}

.kids-theme .btn-outline-success {
    border-width: 2px;
    font-weight: 700;
}

/* Progress bar warna-warni */
.kids-theme .progress {
    border-radius: 999px;
    background-color: #eef2f7;
    overflow: hidden;
}

.kids-theme .progress-bar {
    background: linear-gradient(90deg, #22c55e, #facc15);
    border-radius: 999px;
}

/* Streak / api semangat berkedip pelan */
.kids-theme .streak-fire {
    display: inline-block;
    animation: kidsPulse 1.2s ease-in-out infinite;
}

@keyframes kidsPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

/* Badge nomor & status jadi lucu */
.kids-theme .badge.bg-secondary {
    background: linear-gradient(135deg, #a78bfa, #818cf8) !important;
    border-radius: 12px;
    font-size: 0.85em;
}

.kids-theme .badge.bg-success {
    background: linear-gradient(135deg, #facc15, #f59e0b) !important;
    color: #7c4a03;
    border-radius: 12px;
}

/* Huruf arab lebih besar & jelas utk anak-anak */
.kids-theme div[style*="Traditional Arabic"],
.kids-theme .fs-3[style*="Traditional Arabic"] {
    font-size: 2.1rem !important;
    color: #0f766e;
}

/* Variasi warna pastel pada kartu daftar surat, biar tidak putih monoton */
.kids-theme .surah-card-0 { background: linear-gradient(160deg, #fff, #eafef2); }
.kids-theme .surah-card-1 { background: linear-gradient(160deg, #fff, #eaf6ff); }
.kids-theme .surah-card-2 { background: linear-gradient(160deg, #fff, #fff7e6); }
.kids-theme .surah-card-3 { background: linear-gradient(160deg, #fff, #f5eeff); }
.kids-theme .surah-card-4 { background: linear-gradient(160deg, #fff, #ffeef2); }
.kids-theme .surah-card:hover {
    transform: translateY(-5px) scale(1.03) rotate(-0.5deg);
}

/* Bottom navigation ceria */
.kids-theme .bottom-nav {
    border-radius: 26px 26px 0 0;
    box-shadow: 0 -6px 20px rgba(15, 23, 42, 0.1);
}

.kids-theme .bottom-nav-item i,
.kids-theme .bottom-nav-more i {
    font-size: 1.35rem;
}

.kids-theme .bottom-nav-item.active,
.kids-theme .dropup.active .bottom-nav-more {
    background: linear-gradient(135deg, #22c55e, #0ea5e9) !important;
    color: #fff !important;
    box-shadow: 0 4px 10px rgba(34, 197, 94, 0.35);
    font-weight: 800;
}

.kids-theme .dropup.active .bottom-nav-more {
    border-radius: 14px;
}

/* Alert jadi lebih ramah */
.kids-theme .alert-success {
    border-radius: 18px;
    background: linear-gradient(90deg, #dcfce7, #d1fae5);
    border: none;
    color: #14532d;
    font-weight: 600;
}

.kids-theme .alert-danger {
    border-radius: 18px;
    border: none;
    font-weight: 600;
}

/* =========================================================
   Quiz & Game (Susun Ayat, Tebak Surah Cepat, Mencocokkan)
   ========================================================= */
.quiz-arabic {
    display: block;
    font-family: 'Traditional Arabic', 'Amiri', serif;
    font-size: 1.8rem;
    direction: rtl;
    text-align: center;
    margin-top: 0.5rem;
    color: #0f766e;
}

.quiz-arabic-option {
    font-family: 'Traditional Arabic', 'Amiri', serif;
    font-size: 1.3rem;
    direction: rtl;
}

.quiz-option {
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.quiz-option:hover {
    background-color: #f0fdf4;
    border-color: #22c55e !important;
}

.quiz-option:has(input:checked) {
    background-color: #dcfce7;
    border-color: #16a34a !important;
    font-weight: 700;
}

/* Susun Ayat: kata-kata yg bisa diketuk */
.word-chip {
    display: inline-block;
    padding: 0.5rem 0.9rem;
    margin: 0.25rem;
    border-radius: 999px;
    border: 2px solid #22c55e;
    background: #fff;
    font-family: 'Traditional Arabic', 'Amiri', serif;
    font-size: 1.3rem;
    cursor: pointer;
    user-select: none;
    transition: transform 0.12s ease;
}

.word-chip:active {
    transform: scale(0.95);
}

.word-chip.used {
    opacity: 0.35;
    pointer-events: none;
}

#answerArea {
    min-height: 70px;
    direction: rtl;
    border: 2px dashed #94a3b8;
    border-radius: 16px;
    padding: 0.75rem;
    background: #f8fafc;
}

/* Tebak Surah Cepat: bar waktu */
.game-timer-bar {
    height: 10px;
    border-radius: 999px;
    background: #eef2f7;
    overflow: hidden;
}

.game-timer-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #22c55e, #facc15, #ef4444);
    transition: width 1s linear;
}

/* Mencocokkan: kartu flip */
.match-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.6rem;
}

.match-card {
    aspect-ratio: 1.3 / 1;
    border-radius: 14px;
    background: linear-gradient(135deg, #22c55e, #0ea5e9);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    font-weight: 800;
    cursor: pointer;
    user-select: none;
    box-shadow: 0 3px 8px rgba(0,0,0,.12);
}

.match-card.flipped {
    background: #fff;
    color: #0f172a;
    border: 2px solid #22c55e;
    font-family: 'Traditional Arabic', 'Amiri', serif;
    font-size: 1.1rem;
    padding: 0.25rem;
    text-align: center;
}

.match-card.matched {
    background: #dcfce7;
    color: #16a34a;
    border: 2px solid #16a34a;
    cursor: default;
}
