/* ============================================
   SANTRILOGY - Shared Design System
   Modern Violet Islamic App Shell
   (mengacu pada pages/referensi.html)
   ============================================ */

/* --- Smooth Cross-Page Navigation (MPA View Transitions) --- */
@view-transition {
    navigation: auto;
}

@media (prefers-reduced-motion: reduce) {

    ::view-transition-group(*),
    ::view-transition-old(*),
    ::view-transition-new(*) {
        animation: none !important;
    }
}

/* --- CSS Variables --- */
:root {
    /* Brand violet */
    --b-50: #ecfeff; --b-100: #cffafe; --b-200: #a5f3fc; --b-300: #67e8f9;
    --b-400: #22d3ee; --b-500: #06b6d4; --b-600: #0891b2; --b-700: #0e7490;
    --b-800: #155e75; --b-900: #164e63; --b-950: #083344;

    --mushaf-border: #c98745;
    --mushaf-bg: #fffdf7;
    --ui-card-bg: #ffffff;
    --ui-border: #e2e8f0;
    --ui-text: #0f172a;
    --ui-muted: #64748b;
}

html.dark {
    --ui-card-bg: #1e293b;
    --ui-border: #334155;
    --ui-text: #f8fafc;
    --ui-muted: #94a3b8;
}

/* --- Depth accents (flat, no color gradient) --- */
.pattern-dots-light {
    background-image: radial-gradient(rgba(255, 255, 255, 0.13) 1px, transparent 1px);
    background-size: 16px 16px;
}

.pattern-dots-brand {
    background-image: radial-gradient(rgba(8, 145, 178, 0.10) 1px, transparent 1px);
    background-size: 18px 18px;
}
/* --- Base --- */
[x-cloak] {
    display: none !important;
}

body {
    font-family: 'DM Sans', sans-serif;
    background-color: #f1f5f9;
    color: #1e293b;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-tap-highlight-color: transparent;
}
.dark body {
    background-color: #020617;
    color: #f1f5f9;
}

body { overscroll-behavior-x: none; }

/* --- App Container --- */
.app-container {
    background: #f8fafc;
    border-color: rgba(226, 232, 240, 0.7);
    box-shadow: 0 28px 80px rgba(2, 6, 23, 0.18);
}
.dark .app-container {
    background: #0f172a;
    border-color: rgba(30, 41, 59, 0.9);
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.55);
}

/* --- Header --- */
.app-container > header {
    background: rgba(248, 250, 252, 0.92) !important;
    border-color: rgba(226, 232, 240, 0.8) !important;
    backdrop-filter: blur(18px);
}
.dark .app-container > header {
    background: rgba(15, 23, 42, 0.92) !important;
    border-color: rgba(30, 41, 59, 0.9) !important;
}

/* --- Main Content --- */
.app-container main {
    background: transparent;
}

/* --- Soft Card Shadow --- */
.shadow-soft { box-shadow: 0 8px 25px rgba(15, 23, 42, 0.05); }
.dark .shadow-soft { box-shadow: 0 8px 25px rgba(0, 0, 0, 0.35); }

/* --- Bottom Navigation Bar --- */
.app-container > nav {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid rgba(226, 232, 240, 0.8) !important;
    box-shadow: 0 -4px 20px rgba(15, 23, 42, 0.06);
}
.dark .app-container > nav {
    background: rgba(15, 23, 42, 0.95) !important;
    border-top-color: rgba(30, 41, 59, 0.9) !important;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
}
.app-container > nav button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    width: 4rem;
    padding: 0.6rem 0.25rem 0.35rem;
    color: #94a3b8;
    transition: color 0.2s ease;
}
.app-container > nav button:hover {
    color: var(--b-600);
}
.dark .app-container > nav button:hover {
    color: var(--b-400);
}
.app-container > nav button iconify-icon {
    font-size: 1.15rem;
    line-height: 1;
    transition: color 0.2s ease, transform 0.2s ease;
}
.app-container > nav button span {
    font-size: 0.65rem;
    font-weight: 600;
    line-height: 1;
    letter-spacing: 0.01em;
}
.app-container > nav button.nav-active {
    color: var(--b-600) !important;
}
.app-container > nav button.nav-active iconify-icon {
    color: var(--b-600);
    transform: scale(1.08);
}
.app-container > nav button.nav-active span {
    color: var(--b-600);
    font-weight: 700;
}
.dark .app-container > nav button.nav-active,
.dark .app-container > nav button.nav-active iconify-icon,
.dark .app-container > nav button.nav-active span {
    color: var(--b-400) !important;
}

/* --- Home Indicator (nav hataman) --- */
.nav-home-indicator {
    width: 36%;
    height: 4px;
    border-radius: 4px;
    background: #d1d5db;
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
}
.dark .nav-home-indicator { background: #374151; }

/* --- Sticky Search Bar (Eksplor) --- */
.search-bar-bg { background: linear-gradient(180deg, #f8fafc 88%, rgba(248, 250, 252, 0)); }
.dark .search-bar-bg { background: linear-gradient(180deg, #0f172a 88%, rgba(15, 23, 42, 0)); }

/* --- Iconify Icons --- */
iconify-icon { vertical-align: -0.15em; }

/* --- Tap Effect --- */
.tap-effect {
    transition: transform 0.15s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.15s ease;
}
.tap-effect:active {
    transform: scale(0.95);
    opacity: 0.85;
}

/* --- Hide Scrollbar --- */
.hide-scroll::-webkit-scrollbar { display: none; }
.hide-scroll { -ms-overflow-style: none; scrollbar-width: none; }

/* --- Pulse Glow (Kompas Kiblat) --- */
@keyframes pulseGlow {
    0%, 100% { opacity: 0.8; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.05); }
}
.pulse-glow { animation: pulseGlow 2.5s infinite ease-in-out; }

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 9999px; }
.dark ::-webkit-scrollbar-thumb { background: #334155; }

/* ============================================
   MOBILE RESPONSIVE
   ============================================ */
@media (max-width: 640px) {
    .app-container {
        box-shadow: none;
        border-radius: 0;
        border-left: none;
        border-right: none;
        border-top: none;
        border-bottom: none;
    }
}
