/* ==========================================================
   batch3-style.css (Batch 3)
   - Family account section (daftar anak, status pemakai, switch)
   - Halaman Tentang versi box
   ========================================================== */

/* ===== FAMILY ACCOUNT SECTION ===== */
.setting-switched-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    background: #fef6e0;
    border: 1px solid #f0d894;
    border-radius: 8px;
    padding: 0.6rem 0.8rem;
    margin-bottom: 0.85rem;
    font-size: 0.85rem;
    color: #7a5c00;
    flex-wrap: wrap;
}

.setting-switched-banner .admin-btn {
    font-size: 0.78rem;
    padding: 0.35rem 0.7rem;
    white-space: nowrap;
}

.setting-family-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.setting-family-btn {
    flex: 1;
    min-width: 140px;
    padding: 0.7rem 0.9rem;
    font-size: 0.85rem;
    font-weight: 600;
    border: 1.5px solid var(--border, #d4d4d4);
    border-radius: 10px;
    background: #fff;
    color: var(--text-utama, #1a1a1a);
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s ease;
    text-align: center;
}

.setting-family-btn:hover {
    border-color: var(--tombol-aktif, #2d5a3f);
    background: rgba(45, 90, 63, 0.05);
}

/* Sub-panel (register child / status pemakai) */
.setting-subpanel {
    margin-top: 0.85rem;
    padding: 0.9rem;
    background: #faf9f6;
    border: 1px solid var(--border, #e5e5e5);
    border-radius: 10px;
}

.setting-subpanel-title {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text-utama, #1a1a1a);
    margin-bottom: 0.4rem;
}

.setting-subpanel-desc {
    font-size: 0.8rem;
    color: var(--text-sekunder, #666);
    line-height: 1.45;
    margin-bottom: 0.85rem;
}

.setting-subpanel-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    margin-top: 0.85rem;
}

.setting-field-hint {
    font-size: 0.76rem;
    margin-top: 0.25rem;
    min-height: 1rem;
}

.setting-field-hint.is-ok { color: #1d5a32; }
.setting-field-hint.is-err { color: #cc3333; }

.setting-save-msg.is-ok { color: #1d5a32; }
.setting-save-msg.is-err { color: #cc3333; }

/* Status Pemakai list */
.status-pemakai-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 320px;
    overflow-y: auto;
}

.status-pemakai-loading,
.status-pemakai-empty {
    text-align: center;
    padding: 1rem;
    color: var(--text-sekunder, #888);
    font-size: 0.85rem;
}

.status-pemakai-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    padding: 0.6rem 0.7rem;
    background: #fff;
    border: 1px solid var(--border, #e5e5e5);
    border-radius: 8px;
}

.status-pemakai-info { min-width: 0; flex: 1; }

.status-pemakai-name {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-utama, #1a1a1a);
}

.status-pemakai-username {
    font-size: 0.76rem;
    color: var(--text-sekunder, #888);
    font-family: monospace;
}

.status-pemakai-meta {
    font-size: 0.78rem;
    color: var(--text-sekunder, #666);
    margin-top: 0.2rem;
}

.status-pemakai-switch {
    font-size: 0.78rem;
    padding: 0.4rem 0.75rem;
    white-space: nowrap;
}

/* ===== HALAMAN TENTANG — versi BOX ===== */
.tentang-page-v2 {
    max-width: 760px;
    margin: 0 auto;
    padding: 1rem 0 2rem;
}

.tentang-box {
    background: #fff;
    border: 1px solid var(--border, #e5e5e5);
    border-radius: 16px;
    padding: 1.75rem 1.5rem;
    box-shadow: 0 2px 16px rgba(0,0,0,0.04);
}

.tentang-box-header {
    text-align: center;
    padding-bottom: 1.25rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid rgba(0,0,0,0.07);
}

.tentang-box-logo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    background: #fff;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.08);
    margin-bottom: 0.85rem;
}

.tentang-box-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color, #1a7a3f);
    margin: 0;
}

.tentang-box-subtitle {
    font-size: 0.92rem;
    color: var(--text-sekunder, #666);
    margin: 0;
}

/* Konten Markdown yang sudah di-render */
.tentang-content {
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--text-utama, #2a2a2a);
}

.tentang-content h1,
.tentang-content h2,
.tentang-content h3 {
    margin: 1.5rem 0 0.6rem;
    color: var(--text-utama, #1a1a1a);
    line-height: 1.3;
}
.tentang-content h1 { font-size: 1.4rem; }
.tentang-content h2 { font-size: 1.2rem; }
.tentang-content h3 { font-size: 1.05rem; }

.tentang-content h1:first-child,
.tentang-content h2:first-child,
.tentang-content h3:first-child { margin-top: 0; }

.tentang-content p { margin: 0.75rem 0; }

.tentang-content ul,
.tentang-content ol {
    margin: 0.75rem 0;
    padding-left: 1.5rem;
}

.tentang-content li { margin: 0.35rem 0; }

.tentang-content a {
    color: var(--tombol-aktif, #2d5a3f);
    text-decoration: underline;
}

.tentang-content strong { font-weight: 700; }
.tentang-content em { font-style: italic; }

.tentang-content blockquote {
    border-left: 3px solid var(--tombol-aktif, #2d5a3f);
    padding-left: 1rem;
    margin: 1rem 0;
    color: var(--text-sekunder, #555);
    font-style: italic;
}

.tentang-content code {
    background: rgba(0,0,0,0.05);
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-size: 0.88em;
}

.tentang-content hr {
    border: none;
    border-top: 1px solid rgba(0,0,0,0.1);
    margin: 1.5rem 0;
}

/* ===== GAMBAR / GALERI KENANGAN =====
   Fix: gambar di dalam konten tidak boleh menumpuk / menjepit box di atasnya.
   - Tiap gambar dibatasi lebar 100% (tidak meluber keluar box)
   - clear:both + display:block supaya tidak saling tindih
   - Paragraf yang isinya hanya gambar dijadikan grid responsif rapi. */
.tentang-content img {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 0.75rem 0;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

/* Paragraf berisi banyak gambar → galeri grid otomatis, jarak konsisten,
   tidak ada yang tumpang tindih atau terjepit. */
.tentang-content p:has(> img) {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.75rem;
    align-items: start;          /* cegah peregangan/penjepitan antar gambar */
    margin: 1.25rem 0;
}

.tentang-content p:has(> img) img {
    margin: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    aspect-ratio: 4 / 3;
}

/* Kalau hanya 1 gambar dalam paragraf, tampil natural (bukan dipaksa cover) */
.tentang-content p:has(> img):not(:has(> img ~ img)) {
    display: block;
}
.tentang-content p:has(> img):not(:has(> img ~ img)) img {
    width: auto;
    height: auto;
    aspect-ratio: auto;
    object-fit: contain;
    margin: 1rem auto;
}

@media (max-width: 480px) {
    .tentang-content p:has(> img) {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 0.5rem;
    }
}

/* Empty state — isi belum diatur admin */
.tentang-empty {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-sekunder, #888);
}

.tentang-empty-icon { font-size: 2.5rem; margin-bottom: 0.5rem; }

.tentang-empty-text { font-size: 0.92rem; line-height: 1.6; }

@media (max-width: 480px) {
    .tentang-box { padding: 1.35rem 1.1rem; border-radius: 12px; }
    .tentang-box-title { font-size: 1.3rem; }
}

/* ===== ADMIN: Editor Tentang ===== */
.tentang-editor-textarea {
    width: 100%;
    min-height: 320px;
    font-family: 'Menlo', 'Monaco', monospace;
    font-size: 0.85rem;
    line-height: 1.6;
    padding: 0.85rem;
    border: 1px solid var(--border, #d4d4d4);
    border-radius: 8px;
    resize: vertical;
    color: #1a1a1a;
}

.tentang-editor-textarea:focus {
    outline: none;
    border-color: #2d5a3f;
}

.tentang-editor-help {
    font-size: 0.78rem;
    color: #666;
    background: #f6f6f4;
    border-radius: 6px;
    padding: 0.6rem 0.8rem;
    margin: 0.6rem 0;
    line-height: 1.5;
}

.tentang-editor-help code {
    background: rgba(0,0,0,0.06);
    padding: 0.05rem 0.35rem;
    border-radius: 3px;
}


/* ===== Fase 2: Tabel Data Penghafal (dashboard orang tua) ===== */
.data-penghafal-wrap { overflow-x: auto; margin: 0.5rem 0; }
.data-penghafal-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.data-penghafal-table th,
.data-penghafal-table td { padding: 0.5rem 0.45rem; border-bottom: 1px solid rgba(0,0,0,0.08); text-align: left; vertical-align: top; }
.data-penghafal-table th { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.03em; color: var(--text-sekunder, #777); font-weight: 700; }
.data-penghafal-table .dp-no { width: 2rem; text-align: center; color: var(--text-sekunder, #888); }
.data-penghafal-table .dp-today,
.data-penghafal-table .dp-total { text-align: center; font-variant-numeric: tabular-nums; font-weight: 600; }
.dp-username { font-size: 0.72rem; color: var(--text-sekunder, #999); margin-top: 0.1rem; }
.dp-role { display: inline-block; background: rgba(0,0,0,0.06); border-radius: 4px; padding: 0 0.35rem; margin-left: 0.25rem; text-transform: capitalize; }
.dp-badge { font-size: 0.74rem; font-weight: 700; white-space: nowrap; }
.dp-online { color: #1d8a4f; }
.dp-offline { color: #999; }
.dp-detail-btn { border: 1px solid var(--primary-color, #2d5a3f); color: var(--primary-color, #2d5a3f); background: transparent; border-radius: 6px; padding: 0.25rem 0.6rem; font-size: 0.78rem; cursor: pointer; font-weight: 600; }
.dp-detail-btn:hover { background: var(--primary-color, #2d5a3f); color: #fff; }
.dp-detail { display: flex; flex-direction: column; gap: 0.3rem; padding: 0.6rem 0.4rem; font-size: 0.82rem; color: var(--text-utama, #222); background: rgba(0,0,0,0.02); border-radius: 8px; }
.dp-switch-btn { margin-top: 0.45rem; align-self: flex-start; }
.dp-loading { text-align: center; color: var(--text-sekunder, #888); padding: 1rem; }

/* Dropdown peran di popup Daftar */
.auth-select { width: 100%; padding: 0.6rem 0.7rem; border: 1px solid rgba(0,0,0,0.18); border-radius: 8px; font-size: 0.92rem; background: #fff; color: var(--text-utama, #1a1a1a); }
.auth-select:focus { outline: none; border-color: var(--primary-color, #2d5a3f); }


/* ===== Fase 4: tombol CTA di halaman Tentang (ikut warna subsite) ===== */
.tentang-content .tentang-cta,
.tentang-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0.7rem 0;
    padding: 0.6rem 1.15rem;
    background: var(--primary-color, var(--tombol-aktif, #2d5a3f));
    color: #fff !important;
    border-radius: 10px;
    font-weight: 600;
    text-decoration: none !important;
    box-shadow: 0 4px 14px rgba(0,0,0,0.12);
    transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}
.tentang-content .tentang-cta:hover,
.tentang-cta:hover { transform: translateY(-1px); filter: brightness(1.06); box-shadow: 0 6px 18px rgba(0,0,0,0.18); }
.tentang-cta-arrow { font-weight: 700; }

/* ✨ Judul Info dipindah ke ISI (bukan header); subtitle dihapus */
.tentang-content-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color, #1d5a32);
    margin: 0 0 1rem;
    line-height: 1.3;
}
.tentang-box-header:empty { display: none; }

/* ✨ Toggle auto-play memakai pola switch bawaan (.setting-toggle-row /
   .setting-toggle-track / .setting-toggle-thumb di style.css) agar tidak bentrok. */
