/*
 * style.css
 * Stylesheet untuk Papan Informasi Digital Masjid (REVISED FINAL)
 */

/* --- ROOT STYLES / FONT IMPORTS --- */
/* Gunakan font yang bersih dan jelas untuk tampilan digital */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;700;900&display=swap');

:root {
    --main-bg: #F0F4F1;       /* Putih dengan sedikit rona hijau sangat pucat */
    --main-text: #1A301D;     /* Hijau gelap (hampir hitam) untuk teks agar tajam */
    --primary-color: #2D5A27; /* Hijau Emerald Utama */
    --accent-color: #C5A059;   /* Emas/Gold untuk elemen penting */
    --header-bg: #1B3C18;      /* Hijau Emerald Tua (lebih gelap dari primary) */
    --border-color: #CBD5C0;
    --sholat-time-bg: #FFFFFF; /* Putih bersih untuk kartu waktu sholat */
    --card-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}
body {
    margin: 0;
    padding: 0;
    font-family: 'Roboto', sans-serif;
    background-color: var(--main-bg);
    color: var(--main-text);
    overflow: hidden; /* Mencegah scroll */
}

/* --- REUSABLE CARD/BOX STYLE (Modularitas) --- */
/* Digunakan sebagai kelas dasar untuk elemen kotak: .month-calendar-box, .prayer-schedule, .info-box */
.card-base {
    background: white;
    border-radius: 8px;
    box-shadow: var(--card-shadow);
}


/* --- TAMPILAN UTAMA (FULL SCREEN) --- */
.display-board {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100vw;
    box-sizing: border-box;
    transition: all 0.5s ease-in-out;
}


/* --- HEADER --- */
.header-main {
    background-color: var(--header-bg);
    color: white;
    font-size: 5vh;
    font-weight: 900;
    text-align: center;
    padding: 0.5vh 0;
    letter-spacing: 0.2vh;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* --- MAIN CONTENT LAYOUT --- */
.main-content {
    display: flex;
    flex-grow: 1;
    padding: 2vh;
    gap: 2vh;
}

.sidebar-left {
    width: 18%; 
    display: flex;
    flex-direction: column;
    gap: 2vh;
}

.content-right {
    width: 82%; 
    display: flex;
    flex-direction: column;
    gap: 2vh;
}

/* --- CLOCK BOX (JAM ANALOG) - TEMA HIJAU --- */
.clock-box {
    position: relative;
    width: 30vh; 
    height: 30vh; 
    border: 0.5vh solid var(--primary-color);
    border-radius: 50%;
    background: #fcfcfc;
    
    box-shadow: 
        0 8px 15px rgba(76, 175, 80, 0.4), /* Green shadow */
        inset 0 0 15px rgba(0, 0, 0, 0.1); 
    
    margin: 3vh auto 0;
    
    /* Pin Pusat Jam */
    &::after {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        width: 1.5vh; 
        height: 1.5vh;
        background: var(--accent-color);
        border-radius: 50%;
        transform: translate(-50%, -50%);
        z-index: 15;
        border: 2px solid white;
    }
}

.hand {
    position: absolute;
    top: 50%;
    left: 50%;
    transform-origin: bottom center; 
    background: var(--header-bg); /* Jarum default: Hijau Gelap */
    border-radius: 5px;
    z-index: 10;
    box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3); 
    transform: translate(-50%, -100%) rotate(0deg); 
}

#hour {
    width: 1.5vh;
    height: 8vh; 
    background: var(--header-bg);
}

#minute {
    width: 1vh;
    height: 13vh; 
    background: var(--header-bg);
}

#second {
    width: 0.5vh;
    height: 15vh; 
    background: var(--accent-color);
    border-radius: 0; 
}

.marker {
    position: absolute;
    font-size: 2.5vh;
    font-weight: 700; 
    color: var(--primary-color); /* Penanda angka: Hijau Utama */
    text-shadow: 0 0 1px rgba(0, 0, 0, 0.1);
    transform: translate(-50%, -50%);
}
/* Marker positioning remains the same */
.marker-12 { top: 4%; left: 50%; } 
.marker-3 { top: 50%; right: 4%; transform: translate(50%, -50%); }
.marker-6 { bottom: 4%; left: 50%; transform: translate(-50%, 50%); } 
.marker-9 { top: 50%; left: 4%; }

/* --- HIJRIYAH DATE BOX (REVISED) --- */
.hijriyah-box {
    text-align: center;
    color: var(--header-bg);
    padding: 1.5vh;
    border-radius: 8px;
    box-shadow: var(--card-shadow);
    font-size: 3.5vh;
    font-weight: 700;
    line-height: 1.2;
    border-bottom: 3px solid var(--accent-color); /* Garis bawah emas */
}

/* --- CALENDAR BOX (TANGGAL HARIAN - Hidden) --- */
.calendar-box {
    display: none; 
    /* Style lainnya dipertahankan, tapi elemen ini disembunyikan */
    text-align: center;
    background: white;
    padding: 1.5vh;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    font-size: 4vh;
    font-weight: 700;
    color: var(--header-bg);
}

#realtime-day {
    color: var(--primary-color);
}

/* --- MONTHLY CALENDAR BOX --- */
.month-calendar-box {
    background: white;
    padding: 1vh;
    border-radius: 8px;
    box-shadow: var(--card-shadow);
    flex-grow: 1; 
}

#month-title {
    font-size: 3vh;
    font-weight: 700;
    color: var(--header-bg);
    text-align: center;
    margin-bottom: 0vh;
}

#calendar-grid {
    width: 100%;
    border-collapse: collapse;
}

#calendar-grid th, #calendar-grid td {
    text-align: center;
    font-size: 2.2vh;
    padding: 0.8vh 0.2vh;
}

#calendar-grid th {
    color: var(--primary-color);
    font-weight: 700;
    border-bottom: 2px solid var(--border-color);
}

#calendar-grid td {
    font-weight: 400;
}

#calendar-grid td.today {
    background-color: var(--accent-color);
    color: white;
    border-radius: 4px;
    font-weight: 700;
}

/* --- PRAYER TITLE --- */
.prayer-title {
    background: white;
    border-radius: 8px;
    box-shadow: var(--card-shadow);
    font-size: 4.5vh;
    font-weight: 900;
    color: var(--header-bg);
    text-align: center;
    padding: 1vh;
}


/* --- PRAYER SCHEDULE TABLE --- */
.prayer-schedule {
    background: white;
    border-radius: 8px;
    box-shadow: var(--card-shadow);
    padding: 0 1vh;
}

.prayer-table {
    width: 100%;
    border-collapse: collapse;
}

.prayer-table th {
    font-size: 4vh;
    font-weight: 700;
    color: var(--primary-color);
    padding: 1.5vh 0.5vh;
    border-bottom: 2px solid var(--primary-color);
}

.prayer-table td {
    font-size: 10vh;
    font-weight: 900;
    text-align: center;
    padding: 0.5vh 0.5vh;
    color: var(--header-bg);
    background-color: var(--sholat-time-bg);
    border-radius: 5px;
    transition: background-color 0.3s, color 0.3s;
}

/* Highlight waktu sholat yang sedang Adzan */
.prayer-table td.highlight-active {
    background-color: var(--accent-color);
    color: white;
}

/* --- COUNTDOWN BOX --- */
.countdown-box {
    background: var(--header-bg);
    color: white;
    text-align: center;
    padding: 1.5vh 2vh;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.countdown-text {
    display: block;
    font-size: 5vh;
    font-weight: 700;
}

.countdown-time {
    display: block;
    font-size: 20vh;
    font-weight: 900;
    letter-spacing: 0.3vh;
    color: #FFEB3B; /* Kuning terang untuk kontras */
}

/* --- INFO BOXES --- */
.info-boxes {
    display: flex;
    flex-grow: 1;
    gap: 2vh;
    margin-top: auto; 
}

.info-box {
    background: white;
    flex: 1;
    padding: 0.5vh 0.5vh;
    border-radius: 8px;
    box-shadow: var(--card-shadow);
    display: flex;
    flex-direction: column;
}

.info-box h3 {
    font-size: 3.5vh;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0 0 1vh 0;
    padding-bottom: 0.5vh;
    border-bottom: 2px solid var(--border-color);
    text-align: center;
}

/* --- Style untuk Konten Info Boxes --- */
.info-box .data-line {
    display: flex;
    justify-content: space-between;
    font-size: 5.5vh; 
    line-height: 1.2; 
    color: #444;
    padding: 0.1vh 0; 
    border-bottom: 1px dashed #eee; 
}

.info-box .data-line .label {
    font-weight: normal;
    color: #555;
}

.info-box .data-line .value {
    font-weight: bold;
    color: #388E3C; 
    text-align: right;
    white-space: nowrap;
}


.info-box p {
    margin: 0; 
    padding: 0.5vh 0; 
    flex-grow: 1;
}

.info-box p .data-line:last-of-type {
    border-bottom: none;
}

/* --- FOOTER RUNNING TEXT --- */
.footer-running {
    background-color: #333;
    color: white;
    padding: 0vh 0;
    overflow: hidden;
    white-space: nowrap;
    position: relative;
}

.running-text {
    display: inline-block;
    font-size: 7vh;
    font-weight: 500;
    padding-left: 100%; 
    animation: marquee 30s linear infinite;
}

@keyframes marquee {
    0% { transform: translate(0, 0); }
    100% { transform: translate(-100%, 0); }
}

/* --- ADZAN OVERLAY --- */
.adzan-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s, visibility 0.5s;
    z-index: 1000;
}

.adzan-overlay.show {
    opacity: 1;
    visibility: visible;
}

.adzan-text {
    font-size: 15vh;
    font-weight: 900;
    color: white;
    line-height: 1;
    margin-bottom: 5vh;
    animation: pulse 2s infinite alternate;
}

.adzan-subtext {
    font-size: 7vh;
    font-weight: 400;
}

@keyframes pulse {
    from { transform: scale(1); opacity: 1; }
    to { transform: scale(1.05); opacity: 0.9; }
}

/* Hide main board when adzan is active (TRANSISI TAMBAHAN) */
.display-board.hidden {
    visibility: hidden;
    opacity: 0;
    transition: visibility 0.5s, opacity 0.5s; 
}

/* --- PRAYER SCHEDULE GRID (REVISED 2 ROWS) --- */
.prayer-schedule {
    background: transparent; /* Background mengikuti card-card di dalamnya */
    box-shadow: none; 
    padding: 0;
}

.prayer-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 3 Kolom */
    grid-template-rows: repeat(2, 1fr);    /* 2 Baris */
    gap: 2vh;
    width: 100%;
}

.prayer-card {
    background-color: var(--sholat-time-bg);
    border-radius: 12px;
    border: 0.5vh solid var(--primary-color);
    padding: 0.5vh;
    text-align: center;
    box-shadow: var(--card-shadow);
    display: flex;
    flex-direction: column;
    justify-content: center;
    transition: all 0.5s ease-in-out;
}

/* Judul Nama Sholat */
.prayer-name {
    font-size: 4vh;
    font-weight: 700;
    color: var(--primary-color);
    text-transform: uppercase;
    margin-bottom: 0.5vh;
}

/* Angka Waktu Sholat (Sangat Besar) */
.prayer-time {
    font-size: 9.5vh; /* Ukuran font dioptimalkan untuk 2 baris */
    font-weight: 900;
    color: var(--header-bg);
    line-height: 1;
}

/* Highlight jika waktu sholat sedang aktif (Adzan) */
.prayer-card.highlight-active {
    background-color: var(--accent-color) !important;
    border-color: #FFF !important;
    animation: pulse-gold 2s infinite;
}

.prayer-card.highlight-active .prayer-name,
.prayer-card.highlight-active .prayer-time {
    color: white;
}

/* Animasi Transisi untuk Imsak/Terbit */
.fade-text {
    transition: opacity 0.4s ease;
}

.fade-out {
    opacity: 0;
}

/* ============================================================
   PERBAIKAN MODE JUMAT (CLOCK ONLY)
   ============================================================ */

/* 1. Sembunyikan elemen teks dan kotak info secara spesifik */
.display-board.clock-only-mode .header-main,
.display-board.clock-only-mode .footer-running,
.display-board.clock-only-mode .content-right,
.display-board.clock-only-mode .hijriyah-box,
.display-board.clock-only-mode .calendar-box,
.display-board.clock-only-mode .month-calendar-box,
.display-board.clock-only-mode .prayer-title {
    display: none !important;
}

/* 2. Pastikan main-content tetap 'ada' agar sidebar-left tidak ikut hilang */
.display-board.clock-only-mode .main-content {
    display: block !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
}

/* 3. Ubah layar menjadi hitam pekat */
.display-board.clock-only-mode {
    background: #000000 !important;
    width: 100vw !important;
    height: 100vh !important;
}

/* 4. Paksa sidebar-left (Jam) ke tengah layar TV */
.display-board.clock-only-mode .sidebar-left {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 90vh !important;
    height: 90vh !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    z-index: 9999 !important;
    background: transparent !important;
}

/* 5. Perbesar tampilan jam analog */
.display-board.clock-only-mode .clock-box {
    width: 85vh !important;
    height: 85vh !important;
    margin: 0 !important;
    background: #000000 !important;
    border: 1vh solid #ffffff !important; /* Border putih agar terlihat di layar hitam */
    box-shadow: 0 0 50px rgba(255, 255, 255, 0.2) !important;
}

/* 6. Perbesar angka jam (12, 3, 6, 9) */
.display-board.clock-only-mode .marker {
    font-size: 8vh !important;
    color: #ffffff !important;
    text-shadow: 2px 2px 10px rgba(0,0,0,0.5);
}

/* 7. Pertebal jarum jam agar jelas dari jarak jauh */
/* --- REVISI JARUM JAM AGAR LEBIH PANJANG & PROPORSIONAL --- */

/* Jarum Jam (Hour) */
.display-board.clock-only-mode #hour {
    width: 3vh !important;
    height: 25vh !important; /* Diperpanjang dari 8vh */
    background: #ffffff !important;
    border-radius: 1.5vh;
}

/* Jarum Menit (Minute) */
.display-board.clock-only-mode #minute {
    width: 2vh !important;
    height: 35vh !important; /* Diperpanjang dari 10.5vh */
    background: #ffffff !important;
    border-radius: 1vh;
}

/* Jarum Detik (Second) */
.display-board.clock-only-mode #second {
    width: 0.8vh !important;
    height: 40vh !important; /* Diperpanjang dari 11.5vh */
    background: #ff0000 !important;
}

/* Penyesuaian Marker (Angka) agar lebih ke tengah sedikit jika tertutup jarum */
.display-board.clock-only-mode .marker-12 { top: 10% !important; }
.display-board.clock-only-mode .marker-3  { right: 10% !important; }
.display-board.clock-only-mode .marker-6  { bottom: 10% !important; }
.display-board.clock-only-mode .marker-9  { left: 10% !important; }

/* Menghilangkan pin tengah asli jika perlu dan menggantinya dengan yang lebih besar */
.display-board.clock-only-mode .clock-box::after {
    width: 3vh !important;
    height: 3vh !important;
    background: #ff0000 !important;
}