/* =====================================================
   PARTIALS THEME & AMBIENT GLOW SYSTEM
   ===================================================== */
/* =====================================================
   CUSTOM FONTS (Masking Renta, Aloevera, Sabiyah)
   ===================================================== */
@font-face {
    font-family: 'Masking Renta';
    src: url('../fonts/MaskingRenta.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

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

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

:root {
    --primary-color: #0d6e6e;
    --secondary-color: #ffd700;
    --accent-color: #0a4d68;
    --text-light: #ffffff;
    --text-dark: #333333;
    --bg-gradient: linear-gradient(135deg, #0a4d68, #088395);
    --income-bg: rgba(0,255,127,.15);
    --expense-bg: rgba(255,99,71,.15);
    --display-bg: #062b2b;
}

body {
    background-color: var(--display-bg) !important;
    transition: background-color 2.5s ease !important;
}

/* =====================================================
   DYNAMIC AMBIENT THEMES BY PRAYER TIME (Siklus Suasana Waktu Sholat)
   ===================================================== */
body.theme-subuh {
    --display-bg: #051321 !important;
    --ambient-orb-1: rgba(56, 189, 248, 0.22);
    --ambient-orb-2: rgba(251, 191, 36, 0.16);
    --ambient-accent: #38bdf8;
}

body.theme-dhuha {
    --display-bg: #032018 !important;
    --ambient-orb-1: rgba(250, 204, 21, 0.22);
    --ambient-orb-2: rgba(16, 185, 129, 0.20);
    --ambient-accent: #facc15;
}

body.theme-dzuhur {
    --display-bg: #062b2b !important;
    --ambient-orb-1: rgba(5, 150, 105, 0.25);
    --ambient-orb-2: rgba(255, 215, 0, 0.22);
    --ambient-accent: #ffd700;
}

body.theme-ashar {
    --display-bg: #211608 !important;
    --ambient-orb-1: rgba(249, 115, 22, 0.22);
    --ambient-orb-2: rgba(217, 119, 6, 0.22);
    --ambient-accent: #f97316;
}

body.theme-maghrib {
    --display-bg: #1f0b18 !important;
    --ambient-orb-1: rgba(225, 29, 72, 0.22);
    --ambient-orb-2: rgba(139, 92, 246, 0.20);
    --ambient-accent: #e11d48;
}

body.theme-isya {
    --display-bg: #050e24 !important;
    --ambient-orb-1: rgba(59, 130, 246, 0.22);
    --ambient-orb-2: rgba(212, 175, 55, 0.20);
    --ambient-accent: #3b82f6;
}

/* Lapisan Pencahayaan Halus Ambient Orb */
.ambient-glow-layer {
    position: fixed !important;
    inset: 0;
    pointer-events: none;
    z-index: -8 !important;
    overflow: hidden;
}

.ambient-orb-top {
    position: absolute;
    width: 45vw;
    height: 45vw;
    top: -15vw;
    left: -10vw;
    border-radius: 50%;
    filter: blur(85px);
    background: radial-gradient(circle, var(--ambient-orb-1, rgba(255,215,0,0.18)) 0%, rgba(0,0,0,0) 70%);
    animation: orbFloatingA 16s ease-in-out infinite alternate;
}

.ambient-orb-bottom {
    position: absolute;
    width: 45vw;
    height: 45vw;
    bottom: -15vw;
    right: -10vw;
    border-radius: 50%;
    filter: blur(85px);
    background: radial-gradient(circle, var(--ambient-orb-2, rgba(13,110,110,0.22)) 0%, rgba(0,0,0,0) 70%);
    animation: orbFloatingB 18s ease-in-out infinite alternate;
}

@keyframes orbFloatingA {
    0% { transform: translate(0, 0) scale(1); opacity: 0.6; }
    50% { transform: translate(3vw, 4vh) scale(1.1); opacity: 0.8; }
    100% { transform: translate(-2vw, -2vh) scale(0.95); opacity: 0.6; }
}

@keyframes orbFloatingB {
    0% { transform: translate(0, 0) scale(1); opacity: 0.6; }
    50% { transform: translate(-4vw, -3vh) scale(1.1); opacity: 0.8; }
    100% { transform: translate(2vw, 3vh) scale(0.95); opacity: 0.6; }
}

/* =====================================================
   DISPLAY BACKGROUND (Cerah, Tajam, Jelas Seperti Gambar Aslinya)
   ===================================================== */
.display-background {
    position: fixed !important;
    inset: 0;
    z-index: -10 !important;
    background-image: url('../image/display/background/BG1.png');
    background-position: center !important;
    background-repeat: no-repeat !important;
    background-size: cover !important;
    opacity: 1 !important; 
    filter: brightness(0.96) contrast(1.06) saturate(1.08) !important;
}

/* =====================================================
   DISPLAY OVERLAY (Lapisan Penyejuk Adem, Anti-Silau & Pelindung Teks)
   Menjaga seluruh teks tetap super kontras dan mudah dibaca
   tanpa menutupi keindahan, ketajaman & kecerahan foto masjid
   ===================================================== */
.display-overlay {
    position: fixed !important;
    inset: 0;
    pointer-events: none;
    z-index: -9 !important;
    background: 
        /* Vignette lembut sudut luar layar untuk keteduhan visual & bebas silau */
        radial-gradient(ellipse at 50% 50%, rgba(2, 14, 10, 0.04) 0%, rgba(1, 12, 8, 0.32) 100%),
        /* Gradasi vertikal penopang kontras Header atas dan Running Text bawah */
        linear-gradient(180deg, 
            rgba(2, 16, 11, 0.78) 0%, 
            rgba(2, 16, 11, 0.50) 15%, 
            rgba(2, 16, 11, 0.20) 28%, 
            rgba(2, 16, 11, 0.12) 50%, 
            rgba(2, 16, 11, 0.18) 75%, 
            rgba(2, 16, 11, 0.52) 88%, 
            rgba(2, 16, 11, 0.75) 100%
        ) !important;
}

.display-content {
    position: relative !important;
    z-index: 1 !important;
}

/* =====================================================
   PENGATURAN RUNNING TEXT GLOBAL UNTUK SEMUA HALAMAN
   ===================================================== */
.bottom-section {
    flex-shrink: 0;
    width: 100%;
    margin-top: auto;
}

.running-text-container, 
.bottom-section,
.footer {
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    border: none !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

.running-text-container {
    padding: 6px 15px;
    margin-bottom: 6px;
    overflow: hidden;
}

.running-text {
    white-space: nowrap;
    animation: marquee 50s linear infinite !important; /* Kecepatan pas dan santai */
    font-size: 1.1rem !important; /* Ukuran besar 5rem */
    letter-spacing: 0.5px;
    font-weight: 500;
    color: #ffffff;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.9);
}

.running-text i {
    margin-right: 8px;
    color: #ffd700;
}

@keyframes marquee {
    0% { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
}

.footer {
    text-align: center;
    padding: 6px;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 1px 1px 3px rgba(0,0,0,0.9);
}

/* =====================================================
   MASTER UNIFIED HEADER (H1, SUB-HEADER, DATETIME)
   Menyeragamkan posisi & ukuran font di semua halaman
   ===================================================== */
.header,
.header-section {
    text-align: center !important;
    width: 100% !important;
    margin-top: 0 !important;
    margin-bottom: 12px !important;
    padding: 0 !important;
    flex-shrink: 0 !important;
    position: relative !important;
}

.header h1,
.header-section h1 {
    font-family: 'Masking Renta', sans-serif !important;
    font-size: 3.2rem !important;
    line-height: 1.1 !important;
    letter-spacing: 5px !important;
    text-transform: uppercase !important;
    background: none !important;
    -webkit-background-clip: initial !important;
    -webkit-text-fill-color: #085a2b !important;
    color: #085a2b !important;
    text-shadow:
        1px 1px 0 #ffd700,
        -1px 1px 0 #ffd700,
        1px -1px 0 #ffd700,
        -1px -1px 0 #ffd700,
        2px 2px 0 #000000,
        -2px 2px 0 #000000,
        2px -2px 0 #000000,
        -2px -2px 0 #000000,
        3px 3px 0 #000000,
        -3px 3px 0 #000000,
        3px -3px 0 #000000,
        -3px -3px 0 #000000,
        0 5px 12px rgba(0, 0, 0, 0.95),
        0 0 20px rgba(255, 215, 0, 0.65) !important;
    filter: none !important;
    margin: 0 0 -15px 0 !important;
    padding: 0 !important;
}

.header h2.sub-header,
.header h3.sub-header,
.header .sub-header,
.header-section h2.sub-header,
.header-section h3.sub-header,
.header-section .sub-header,
h3.sub-header,
h2.sub-header {
    font-family: 'Poppins', sans-serif !important;
    font-size: 1.25rem !important;
    font-weight: 500 !important;
    line-height: 1.2 !important;
    letter-spacing: 4px !important;
    color: #ffffff !important;
    text-transform: uppercase !important;
    opacity: 0.95 !important;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.8) !important;
    margin-top: 10px !important;
    margin-bottom: 6px !important;
    padding: 0 !important;
}

.header .datetime,
.header-section .datetime {
    font-size: 1.55rem !important;
    background: rgba(3, 20, 15, 0.65) !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 5px 28px !important;
    border-radius: 35px !important;
    margin-top: 4px !important;
    font-weight: 600 !important;
    letter-spacing: 0.8px !important;
    border: 1.5px solid rgba(255, 215, 0, 0.5) !important;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.4) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    color: #ffffff !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8) !important;
    white-space: nowrap !important;
}

.datetime .masehi-date {
    color: #ffffff !important;
    font-weight: 600 !important;
}

.datetime .hijri-date {
    color: #ffd700 !important;
    font-weight: 700 !important;
    letter-spacing: 1px !important;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.65), 0 0 20px rgba(255, 170, 0, 0.35) !important;
    padding: 0 2px !important;
}

.datetime .jam-time {
    color: #ffffff !important;
    font-weight: 700 !important;
    font-variant-numeric: tabular-nums !important;
}

.datetime .dt-sep {
    color: #ffd700 !important;
    opacity: 0.85 !important;
    margin: 0 10px !important;
    font-weight: bold !important;
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.5) !important;
}

/* Penataan khusus datetime di dalam Header Card (Idul Fitri, Idul Adha) */
.idul-header .datetime,
.header-clock .datetime,
.idul-card .datetime {
    display: inline-flex !important;
    flex-direction: column !important;
    align-items: flex-end !important; /* Rata kanan agar jam sejajar pas di bawah kalender Hijriah */
    justify-content: center !important;
    text-align: right !important;
    padding: 6px 18px !important;
    border-radius: 14px !important;
    background: rgba(3, 20, 15, 0.7) !important;
    border: 1.5px solid rgba(255, 215, 0, 0.5) !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4) !important;
    line-height: 1.35 !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
}

.idul-header .datetime .dt-date-row,
.header-clock .datetime .dt-date-row,
.idul-card .datetime .dt-date-row {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    font-size: 1.05rem !important;
    font-weight: 600 !important;
}

.idul-header .datetime .dt-sep-time,
.header-clock .datetime .dt-sep-time,
.idul-card .datetime .dt-sep-time {
    display: none !important;
}

.idul-header .datetime .dt-time-row,
.header-clock .datetime .dt-time-row,
.idul-card .datetime .dt-time-row {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 6px !important;
    font-size: 1.02rem !important;
    color: #ffffff !important;
    margin-top: 2px !important;
    font-weight: 700 !important;
    text-align: right !important;
}

.idul-header .datetime .dt-time-row::before,
.header-clock .datetime .dt-time-row::before {
    content: "\f017";
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    color: #ffd700;
    font-size: 0.95rem;
}

/* =====================================================
   MEDALI KALIGRAFI 3D EMAS MENYALA (ALLAH & MUHAMMAD)
   Efek Denyut Pelan Memancarkan Gelombang Cahaya Emas
   ===================================================== */
.kaligrafi-medallion {
    position: absolute !important;
    top: 14px !important;
    width: 125px !important;
    height: 125px !important;
    z-index: 10 !important;
    user-select: none !important;
    pointer-events: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Gelombang Pendaran Cahaya Emas Luar (Aura Emas Utama) */
.kaligrafi-medallion::before {
    content: '' !important;
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 115% !important;
    height: 115% !important;
    border-radius: 50% !important;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.6) 0%, rgba(255, 175, 0, 0.32) 48%, rgba(212, 175, 55, 0) 75%) !important;
    filter: blur(10px) !important;
    z-index: -1 !important;
    pointer-events: none !important;
    animation: goldMedallionAuraWave 4.2s ease-in-out infinite alternate !important;
}

/* Gelombang Denyut Cincin Riak Emas yang Memancar Keluar */
.kaligrafi-medallion::after {
    content: '' !important;
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) scale(0.85) !important;
    width: 100% !important;
    height: 100% !important;
    border-radius: 50% !important;
    border: 2px solid rgba(255, 220, 80, 0.75) !important;
    box-shadow: 0 0 22px rgba(255, 215, 0, 0.7), inset 0 0 15px rgba(255, 215, 0, 0.4) !important;
    z-index: -1 !important;
    pointer-events: none !important;
    opacity: 0 !important;
    animation: goldRippleRays 4.2s cubic-bezier(0.2, 0.8, 0.2, 1) infinite !important;
}

.kaligrafi-medallion img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    filter: drop-shadow(0 0 12px rgba(255, 220, 50, 0.95)) 
           drop-shadow(0 0 28px rgba(255, 180, 0, 0.8))
           drop-shadow(0 0 50px rgba(255, 140, 0, 0.5))
           drop-shadow(0 10px 20px rgba(0, 0, 0, 0.85)) !important;
    animation: goldMedallionHeartbeat 4.2s ease-in-out infinite alternate !important;
}

.kaligrafi-medallion.kaligrafi-allah {
    right: 28px !important;
    left: auto !important;
}

.kaligrafi-medallion.kaligrafi-muhammad {
    left: 28px !important;
    right: auto !important;
}

/* Animasi 1: Denyut Pelan Gambar Medali dengan Kilau Emas */
@keyframes goldMedallionHeartbeat {
    0% {
        opacity: 0.92;
        transform: scale(0.98);
        filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.75))
               drop-shadow(0 0 24px rgba(255, 170, 0, 0.6))
               drop-shadow(0 0 45px rgba(255, 140, 0, 0.35))
               drop-shadow(0 6px 15px rgba(0, 0, 0, 0.85)) !important;
    }
    50% {
        opacity: 1;
        transform: scale(1.045);
        filter: drop-shadow(0 0 20px rgba(255, 245, 140, 1))
               drop-shadow(0 0 42px rgba(255, 215, 0, 0.95))
               drop-shadow(0 0 70px rgba(255, 160, 0, 0.7))
               drop-shadow(0 10px 24px rgba(0, 0, 0, 0.9)) !important;
    }
    100% {
        opacity: 0.92;
        transform: scale(0.98);
        filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.75))
               drop-shadow(0 0 24px rgba(255, 170, 0, 0.6))
               drop-shadow(0 0 45px rgba(255, 140, 0, 0.35))
               drop-shadow(0 6px 15px rgba(0, 0, 0, 0.85)) !important;
    }
}

/* Animasi 2: Pancaran Aura Emas Mengembang Melingkar */
@keyframes goldMedallionAuraWave {
    0% {
        opacity: 0.65;
        transform: translate(-50%, -50%) scale(0.92);
        filter: blur(8px);
    }
    50% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.22);
        filter: blur(14px);
    }
    100% {
        opacity: 0.65;
        transform: translate(-50%, -50%) scale(0.92);
        filter: blur(8px);
    }
}

/* Animasi 3: Gelombang Riak Cahaya Emas Memancar Keluar */
@keyframes goldRippleRays {
    0% {
        transform: translate(-50%, -50%) scale(0.85);
        opacity: 0.85;
        border-color: rgba(255, 235, 100, 0.9);
    }
    50% {
        opacity: 0.45;
    }
    100% {
        transform: translate(-50%, -50%) scale(1.45);
        opacity: 0;
        border-color: rgba(255, 180, 0, 0);
    }
}

/* =====================================================
   KONTEN UTAMA HALUS (ENTRANCE FADE IN UP)
   Menjaga header & footer tetap kokoh di tempatnya
   ===================================================== */
.display-content > div:not(.header):not(.header-section):not(.bottom-section):not(.kaligrafi-medallion),
.page-layout {
    animation: contentPanelFadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes contentPanelFadeIn {
    0% {
        opacity: 0;
        transform: translateY(12px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =====================================================
   RESPONSIVE DESIGN OVERRIDES UNTUK PARTIALS THEME
   Menjamin tampilan di Tablet & Layar Ponsel (HP) Rapi,
   Proporsional, Elegan, dan Bebas Tumpang Tindih
   ===================================================== */

/* Tablet (768px - 1024px) */
@media (max-width: 1024px) {
    .header,
    .header-section {
        padding: 0 90px !important;
        margin-bottom: 8px !important;
    }

    .header h1,
    .header-section h1 {
        font-size: clamp(1.8rem, 3.8vw, 2.4rem) !important;
        letter-spacing: 3px !important;
        margin: 0 0 2px 0 !important;
    }

    .header h2.sub-header,
    .header h3.sub-header,
    .header .sub-header,
    .header-section h2.sub-header,
    .header-section h3.sub-header,
    .header-section .sub-header,
    h3.sub-header,
    h2.sub-header {
        font-size: clamp(0.85rem, 1.8vw, 1.05rem) !important;
        letter-spacing: 2px !important;
        margin-top: 2px !important;
        margin-bottom: 4px !important;
    }

    .header .datetime,
    .header-section .datetime {
        font-size: 1.15rem !important;
        padding: 4px 20px !important;
    }

    .kaligrafi-medallion {
        width: 75px !important;
        height: 75px !important;
        top: 10px !important;
    }
    .kaligrafi-medallion.kaligrafi-allah {
        right: 14px !important;
    }
    .kaligrafi-medallion.kaligrafi-muhammad {
        left: 14px !important;
    }
}

/* Smartphone / HP (< 768px) */
@media (max-width: 767px) {
    .header,
    .header-section {
        padding: 0 54px !important; /* Memberi jarak aman agar judul tidak bertabrakan dengan medali */
        margin-top: 0 !important;
        margin-bottom: 6px !important;
        position: relative !important;
        z-index: 5 !important;
    }

    .header h1,
    .header-section h1 {
        font-size: clamp(1.15rem, 4.8vw, 1.55rem) !important;
        letter-spacing: 1.2px !important;
        line-height: 1.2 !important;
        margin: 0 0 2px 0 !important; /* Hapus margin minus -15px agar tidak menumpuk ke elemen bawah */
        text-shadow:
            1px 1px 0 #ffd700,
            -1px 1px 0 #ffd700,
            1px -1px 0 #ffd700,
            -1px -1px 0 #ffd700,
            1px 1px 4px rgba(0, 0, 0, 0.9),
            0 0 10px rgba(255, 215, 0, 0.5) !important;
    }

    .header h2.sub-header,
    .header h3.sub-header,
    .header .sub-header,
    .header-section h2.sub-header,
    .header-section h3.sub-header,
    .header-section .sub-header,
    h3.sub-header,
    h2.sub-header {
        font-size: clamp(0.65rem, 2.5vw, 0.78rem) !important;
        letter-spacing: 0.8px !important;
        line-height: 1.25 !important;
        margin-top: 1px !important;
        margin-bottom: 6px !important;
        white-space: normal !important;
        word-break: break-word !important;
        opacity: 0.9 !important;
    }

    .header .datetime,
    .header-section .datetime {
        font-size: 0.82rem !important;
        padding: 3px 14px !important;
        border-radius: 20px !important;
        margin-top: 2px !important;
        margin-bottom: 4px !important;
    }

    /* Medali kaligrafi di HP: disesuaikan agar proporsional dan tidak menutupi layar */
    .kaligrafi-medallion {
        width: 48px !important;
        height: 48px !important;
        top: 6px !important;
        z-index: 10 !important;
    }
    .kaligrafi-medallion.kaligrafi-allah {
        right: 6px !important;
        left: auto !important;
    }
    .kaligrafi-medallion.kaligrafi-muhammad {
        left: 6px !important;
        right: auto !important;
    }
    .kaligrafi-medallion::before {
        width: 105% !important;
        height: 105% !important;
        filter: blur(6px) !important;
    }
}

/* Smartphone Layar Kecil (< 380px) */
@media (max-width: 380px) {
    .header,
    .header-section {
        padding: 0 46px !important;
    }
    .header h1,
    .header-section h1 {
        font-size: 1.1rem !important;
        letter-spacing: 0.8px !important;
    }
    .header h2.sub-header,
    .header h3.sub-header,
    .header .sub-header,
    .header-section h2.sub-header,
    .header-section h3.sub-header,
    .header-section .sub-header,
    h3.sub-header,
    h2.sub-header {
        font-size: 0.62rem !important;
    }
    .kaligrafi-medallion {
        width: 42px !important;
        height: 42px !important;
        top: 6px !important;
    }
    .kaligrafi-medallion.kaligrafi-allah {
        right: 4px !important;
    }
    .kaligrafi-medallion.kaligrafi-muhammad {
        left: 4px !important;
    }
}