/* File: /assets/css/style.css (Versi Final dengan Layout Flexbox Column) */

:root {
    --display-page-bg: #333;
    --display-container-bg: #ffffff;
    --display-border: #005a3a;
    --display-primary: #005a3a;
    --display-accent: #e0e0e0;
    --display-card-bg: #f8f9fa;
    --display-text: #333;
    --display-heading: #005a3a;
    --display-header-text: #ffffff;
}

/* --- 1. Global & Container --- */
body {
    background-color: var(--display-page-bg);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--display-text);
    margin: 0;
    padding: 0;
}
.container {
    width: 100vw;
    height: 56.25vw; /* Rasio 16:9 */
    max-height: 100vh;
    max-width: 177.78vh;
    margin: auto;
    background-color: var(--display-container-bg);
    border: 10px solid var(--display-border);
    border-top: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-sizing: border-box;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 0;
}

/* --- 2. Header & Welcome Bar --- */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--display-primary);
    color: var(--display-header-text);
    padding: 10px 25px;
    flex-shrink: 0;
    margin: 0;
    border: none;
}
.header-kiri { display: flex; align-items: center; }
.header .logo { display: flex; align-items: center; padding-right: 25px; }
.header .logo img { height: 60px; margin-right: 15px; }
.header .identitas-sekolah h1 { margin: 0; font-size: 28px; font-weight: 700; }
.header .identitas-sekolah p { margin: 0; font-size: 14px; }
.header .waktu { text-align: right; }
.jam-digital { font-size: 36px; font-weight: bold; }
.tanggal-digital { font-size: 16px; }
.welcome-bar {
    background-color: var(--display-accent);
    padding: 4px 8px;
    font-weight: bold;
    font-size: 16px;
    color: var(--display-text);
    flex-shrink: 0;
}

/* --- 3. LAYOUT UTAMA MENGGUNAKAN FLEXBOX COLUMN --- */
main.content-container {
    display: flex;
    gap: 15px;
    padding: 15px;
    flex-grow: 1;
    overflow: hidden;
}
.content-column {
    display: flex;
    flex-direction: column;
    gap: 15px;
    min-width: 0; /* Mencegah kolom meluber */
}
.content-column:nth-child(1) { flex: 1.2; }
.content-column:nth-child(2) { flex: 1.5; }
.content-column:nth-child(3) { flex: 1; }

/* --- 4. Styling Umum untuk Semua Kotak (.grid-item) --- */
.grid-item {
    box-sizing: border-box;
    background-color: var(--display-card-bg);
    border: 1px solid var(--display-border);
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.grid-item h3, .grid-item h4 {
    margin: 0 0 10px 0;
    padding-bottom: 5px;
    text-transform: uppercase;
    color: var(--display-heading);
    text-align: center;
    border-bottom: 2px solid var(--display-primary);
    flex-shrink: 0;
}

/* --- 5. Styling Spesifik per Komponen --- */

/* Visi Misi */
.visi-misi { padding: 5px; flex-shrink: 0; }
.visi-misi h4 { border: none; margin-bottom: 1px; }
.visi-misi .box-content { overflow: hidden; font-size: 12px; line-height: 1.4; }
.visi-misi .box-content p { text-align: center; margin-top: 2px; }
.visi-misi .box-content ol { padding-left: 20px; padding-right: 10px; text-align: justify; margin-top: 2px;}

/* Jumlah Siswa */
.jumlah-siswa { flex-grow: 1; padding-top: 5px; padding-bottom: 5px; }
.jumlah-siswa h3 { border: none; }
.siswa-table-shell {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}
.siswa-scroll-wrapper {
    flex: 1;
    min-height: 0;
    overflow: hidden;
}
.tabel-siswa { width: 100%; border-collapse: collapse; table-layout: fixed; }
.tabel-siswa th, .tabel-siswa td { font-size: 12px; border: 1px solid #ddd; text-align: center; padding: 4px; word-wrap: break-word; }
.siswa-col-no { width: 7%; }
.siswa-col-kelas { width: 25%; }
.siswa-col-lk { width: 12%; }
.siswa-col-pr { width: 12%; }
.siswa-col-wali { width: 41%; }
.tabel-siswa th:last-child, .tabel-siswa td:last-child { text-align: left; padding-left: 8px; }
.tabel-siswa thead th { background-color: #e9ecef; font-weight: 600; }
.tabel-siswa tfoot th { background-color: var(--display-primary); color: var(--display-header-text); font-weight: bold; }

    /* Profil Pegawai */
    .profil-pegawai { height: 165px; flex-shrink: 0; padding: 8px 12px 10px; }
    .profil-pegawai h3 { border: none; margin-bottom: 4px; }
    .profil-slider-container { width: 100%; height: 100%; position: relative; }
    .profil-slide { position: absolute; top: 0; left: 0; width: 100%; height: 100%; display: flex; align-items: center; gap: 15px; opacity: 0; visibility: hidden; transition: opacity 0.8s ease-in-out; }
    .profil-slide.active { opacity: 1; visibility: visible; }
    .profil-foto { box-sizing: border-box; flex-shrink: 0; width: 76px; height: 94px; }
    .profil-foto img { width: 100%; height: 100%; object-fit: cover; border-radius: 12px; border: 3px solid var(--display-primary); }
    .profil-data table { font-size: 12px; line-height: 1.18; padding-top: 0}
    .profil-data table td:first-child { font-weight: bold; width: 100px; }

/* Video & Jadwal */
.main-video {
    flex-shrink: 0;
    min-height: 240px;
    max-height: 320px;
    aspect-ratio: 16 / 9;
}
.video-container {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 10px;
    overflow: hidden;
    border: 3px solid var(--display-primary);
}
.video-container iframe,
.video-container video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
    object-fit: cover;
}
.video-container video {
    display: block;
}
.jadwal { flex-grow: 1; min-height: 120px; display: flex; flex-direction: column; padding-top: 3px }
.jadwal h3 { border: none; flex-shrink: 0; }
.agenda-list { font-size: 14px; line-height: 1.2; text-align: left; flex-grow: 1; overflow-y: hidden; }
.agenda-list ul { padding-left: 20px; margin: 0; }
.agenda-list li { padding-bottom: 4px; }


/* --- FINAL & KONSISTEN: AUTO-SCROLL LOOPING --- */

/* 1. Atur Wrapper (Jendela Scroll) */
.agenda-list {
    flex-grow: 1;
    overflow: hidden;
}

/* 2. Atur Konten yang akan dianimasikan */
.agenda-list ul.is-scrolling-agenda {
    animation-name: scroll-up-loop;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
}

/* 3. Definisikan Animasinya */
@keyframes scroll-up-loop {
    from {
        transform: translateY(0);
    }
    to {
        transform: translateY(-50%);
    }
}

.tabel-siswa tfoot th { font-size: 11px; }
.tabel-siswa td:last-child, .tabel-siswa th:last-child {
    text-align: center;
    padding-left: 8px;
    
}

/* --- 5. STYLING FINAL UNTUK KOLOM KANAN --- */

/* --- Kotak Jumlah Pegawai --- */
.jumlah-pegawai { flex-shrink: 0; flex-grow: 0; height: 230px; padding-top: 5px; padding-bottom: 3px}
.jumlah-pegawai h3 {border-bottom: none; }
.pegawai-table-shell {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}
.pegawai-scroll-wrapper {
    flex: 1;
    min-height: 0;
    overflow: hidden;
}
.tabel-pegawai {
    border-collapse: collapse;
    font-size: 13px;
    table-layout: fixed;
    width: 100%;
}
.pegawai-col-jabatan {
    width: 43%;
}
.tabel-pegawai th, .tabel-pegawai td {
    border: 1px solid #ccc;
    padding: 4px 6px;
    text-align: center;
    line-height: 1.15;
}
.tabel-pegawai thead th {
    background-color: #e9ecef;
    vertical-align: middle;
}
.tabel-pegawai tbody td:first-child {
    text-align: left;
    word-break: break-word;
}
.tabel-pegawai tfoot th {
    background-color: var(--display-primary);
    color: var(--display-header-text);
    font-weight: bold;
}
.summary-pegawai {
    margin-top: 6px;
    font-weight: bold;
    font-size: 14px;
    text-align: center;
    line-height: 1.25;
    flex-shrink: 0;
}


/* --- Kotak Galeri Foto --- */
.galeri-sekolah {
    flex-grow: 1; /* PENTING: Membuat kotak ini meregang mengisi sisa ruang */
    min-height: 150px; /* Beri tinggi minimal agar tidak terlalu kecil saat kosong */
    flex-grow: 1; padding-top: 5px; padding-bottom: 12px;
}
.galeri-sekolah h3 {
    border-bottom: none;
}
.galeri-slider-container {
    position: relative;
    width: 100%;
    height: 100%;
}
.galeri-slider-container img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
    visibility: hidden;
}
.galeri-slider-container img.active {
    opacity: 1;
    visibility: visible;
}


/* --- Penyesuaian Final untuk Kotak Sholat --- */

/* 1. Atur Kotak Utamanya */
.sholat {
    background-color: var(--display-primary);
    color: var(--display-header-text);
    text-align: center;
    justify-content: center; /* Memusatkan konten secara vertikal */
    align-items: center;     /* Memusatkan konten secara horizontal */
    flex-grow: 0;
    flex-shrink: 0;
    height: 70px;
    padding: 4px 10px;
}

/* 2. Atur Judul "MENUJU SHOLAT..." */
.sholat h4 {
    color: rgba(255, 255, 255, 0.8); /* Warna putih yang sedikit transparan */
    border-bottom: none; /* Hilangkan garis bawah */
    margin: 0;           /* Hapus semua margin */
    padding: 0;          /* Hapus semua padding */
    font-size: 12px;     /* Sedikit sesuaikan ukuran font */
    font-weight: 600;
    text-transform: uppercase;
}

/* 3. Atur Countdown Timer agar lebih keren */
.countdown {
    font-family: 'Consolas', 'Courier New', monospace; /* Font ala digital */
    font-size: 34px;       /* Sedikit perbesar */
    font-weight: bold;
    line-height: 1;      /* Merapatkan jarak ke judul di atasnya */
    text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.4); /* Efek bayangan agar tulisan 'timbul' */
    letter-spacing: 2px;   /* Jarak antar huruf agar lebih terbaca */
}
