/* =========================================
   1. GLOBAL & LAYOUT LOCK
   ========================================= */
html, body {
    margin: 0; padding: 0; width: 100%; height: 100%;
    overflow: hidden !important; 
    background-color: #ffffff;
    font-family: 'Inter', 'Roboto', sans-serif;
}

.body {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    display: flex; flex-direction: column;
    padding: 0 14px; 
    background-color: #ffffff;
    z-index: 1; overflow-y: auto; 
    overflow-x: hidden;
}

/* =========================================
   2. HEADER & JADWAL (MASJID LAMA - JIKA MASIH DIPAKAI)
   ========================================= */
.header {
    flex-shrink: 0; 
    display: flex; flex-direction: column;
    align-items: center; 
    padding-top: 20px; 
    margin-bottom: 15px; 
    position: relative; 
    z-index: 10;
    width: 100%; 
}
.header h5 { font-weight: 700; font-size: 16px; color: #333; margin: 0; letter-spacing: 0.5px; }
.header h6 { font-weight: 400; font-size: 12px; color: #666; margin: 4px 0 0 0; }

.body .box-schedule {
    flex-shrink: 0; position: relative; display: flex; flex-direction: column;
    height: 196px; border-radius: 20px; padding: 0 !important; color: #fff; 
    margin-bottom: 15px; z-index: 10; overflow: hidden; box-shadow: 0 4px 15px rgba(0,0,0,0.1); 
}
.body .box-schedule.bg-darkblue { background-color: #012a8a; }
.body .box-schedule.bg-indianred { background-color: #dc575a; }
.body .box-schedule.bg-lightblue { background-color: #0083e6; }

.body .box-schedule .box-stacked { 
    position: relative !important; width: 100%; flex: 1; background-size: cover; 
    background-position: center; padding: 20px 20px 10px 20px; display: flex; 
    flex-direction: column; justify-content: space-between;
}
.body .box-schedule .box-stacked.bg-night { background-image: url("/asset-webview/masjid/images/night.png"); }
.body .box-schedule .box-stacked.bg-afternoon { background-image: url("/asset-webview/masjid/images/afternoon.png"); }
.body .box-schedule .box-stacked.bg-evening { background-image: url("/asset-webview/masjid/images/evening.png"); }

.body .box-schedule .information-container { 
    height: 46px; width: 100%; display: flex; justify-content: space-between; 
    align-items: center; font-size: 13px; padding: 0 20px; background-color: transparent; z-index: 2;
}
.body .box-schedule .information-container .btn-link { 
    background: none; border: none; cursor: pointer; text-decoration: none; 
    font-weight: 700; font-size: 14px; display: flex; align-items: center; gap: 10px; color: #fff; 
}
.body .box-schedule .information-container .btn-link .circle-icon { 
    height: 20px; width: 20px; background-color: #fff; border-radius: 50%; 
    display: flex; justify-content: center; align-items: center; color: #0083e6; 
}
.body .box-schedule .box-stacked .top-content { display: flex; width: 100%; justify-content: space-between; align-items: flex-start; }
.body .box-schedule .box-stacked .top-content .left-content .clock-text { font-weight: 700; font-size: 36px; line-height: 1; color: white; margin-bottom: 4px; }
.body .box-schedule .box-stacked .top-content .left-content .sub-text { font-size: 12px; color: rgba(255,255,255,0.9); }
.body .box-schedule .box-stacked .top-content .right-content { text-align: right; }
.body .box-schedule .box-stacked .top-content .right-content .sub-text { font-size: 11px; color: white; display: block; margin-bottom: 2px; }
.body .box-schedule .box-stacked .prayer-container { display: flex; justify-content: space-between; align-items: center; width: 100%; margin-top: auto; padding-top: 10px; }
.body .box-schedule .box-stacked .prayer-container .prayer-item { display: flex; flex-direction: column; align-items: center; }
.body .box-schedule .box-stacked .prayer-container .prayer-item .prayer-time { font-size: 12px; font-weight: 700; color: white; margin-bottom: 2px; }
.body .box-schedule .box-stacked .prayer-container .prayer-item .prayer-name { font-size: 10px; color: rgba(255,255,255,0.8); }
.body .box-schedule .box-stacked .prayer-container .prayer-item.active { background: rgba(255,255,255,0.2); padding: 4px 8px; border-radius: 8px; }

/* =========================================
    3. MENU LAYANAN & LAPORAN (KUNCI MUTLAK 4 KOLOM DINAMIS)
    ========================================= */
#menu_home, #menu_laporan {
    margin-bottom: 20px;
}

.menu-grid {
    display: flex !important;
    flex-wrap: wrap !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    /* KUNCI: Jangan gunakan gap horizontal! Kita atur jarak di dalam item */
}

.menu-item {
    /* KUNCI MUTLAK: Lebar pasti 25% dari layar, tidak peduli ukuran devicenya */
    flex: 0 0 25% !important; 
    max-width: 25% !important; 
    box-sizing: border-box !important;
    
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: flex-start !important;
    text-decoration: none !important;
    cursor: pointer !important;
    
    margin-bottom: 20px !important; /* Jarak vertikal atas-bawah */
    padding: 0 4px !important; /* Jarak aman kiri-kanan agar teks/ikon tidak nempel */
    -webkit-tap-highlight-color: transparent !important;
}

/* Lingkaran Icon Biru Muda */
.menu-icon-circle {
    width: 48px !important;  
    height: 48px !important;
    border-radius: 50% !important; 
    background-color: #eef2fa !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    margin-bottom: 8px !important; 
    box-shadow: 0 2px 6px rgba(0,0,0,0.04) !important;
    transition: transform 0.1s, background-color 0.1s !important;
}

.menu-item:active .menu-icon-circle {
    transform: scale(0.95) !important;
    background-color: #d0def7 !important;
}

.menu-icon-circle img {
    width: 24px !important;  
    height: 24px !important;
    object-fit: contain !important;
}

/* Teks Menu */
.menu-text {
    font-size: 11px !important;
    font-weight: 600 !important; 
    color: #374151 !important;  
    text-align: center !important;
    line-height: 1.25 !important;
    width: 100% !important; 
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
}

/* =========================================
   4. SLIDER (INFO CARD)
   ========================================= */
.photo-gallery {
    position: relative; width: 100%; height: 240px !important; 
    min-height: 240px !important; max-height: 240px !important;
    border-radius: 16px; overflow: hidden !important; background-color: #000;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15); margin-bottom: 20px;
    z-index: 1; display: block !important;
}

.swiper-container { width: 100% !important; height: 100% !important; position: absolute !important; top: 0; left: 0; }
.swiper-wrapper, .swiper-slide { width: 100% !important; height: 100% !important; }

.info-card { width: 100%; height: 100%; position: relative; overflow: hidden; }

.card-img-full {
    position: absolute !important; top: 0; left: 0; width: 100% !important; height: 100% !important;
    object-fit: cover !important; object-position: center; display: block; z-index: 1;
}

.card-overlay {
    position: absolute; bottom: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.4) 50%, rgba(0,0,0,0) 100%);
    padding: 24px 20px; display: flex; flex-direction: column; justify-content: flex-end;
    align-items: flex-start; z-index: 2;
}

.card-title { color: #fff; font-size: 18px; font-weight: 700; margin-bottom: 6px; line-height: 1.3; text-shadow: 0 2px 4px rgba(0,0,0,0.8); }
.card-text { color: #e2e8f0; font-size: 13px; line-height: 1.4; margin-bottom: 12px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; text-shadow: 0 1px 2px rgba(0,0,0,0.8); }

.btn-baca {
    background: rgba(255,255,255,0.2); border: 1px solid rgba(255,255,255,0.5);
    color: white; padding: 6px 16px; font-size: 12px; border-radius: 50px;
    text-decoration: none; backdrop-filter: blur(4px); margin-top: 5px;
    display: inline-block; position: relative; z-index: 50;
    cursor: pointer; pointer-events: auto;
}

.swiper-pagination { bottom: 12px !important; z-index: 10; }
.swiper-pagination-bullet { background: #fff; opacity: 0.5; width: 6px; height: 6px; }
/* Indikator Slider Aktif jadi Biru */
.swiper-pagination-bullet-active { background: #1976d2 !important; opacity: 1; width: 24px; border-radius: 4px; transition: width 0.3s; }

/* =========================================
   5. MEDIA QUERIES RESPONSIVE
   ========================================= */
@media screen and (max-height: 680px) {
    .header { margin-bottom: 5px; min-height: 30px; }
    .header h5 { font-size: 15px; }
    .body .box-schedule { height: 175px; margin-bottom: 10px; }
    .body .box-schedule .box-stacked { padding: 15px 15px 5px 15px; }
    .photo-gallery { height: 200px !important; min-height: 200px !important; max-height: 200px !important; }
}