/* 
   ==========================================================================
   Rangkuman Pembaruan Logika & Fitur:
   1. Hari Aktif Otomatis di Depan:
      Saat halaman pertama kali dibuka, sistem mendeteksi hari secara real-time 
      (berdasarkan sistem komputer Anda) dan otomatis membuka/menampilkan kotak 
      kartu untuk hari yang aktif tersebut ke depan.
   2. Interaksi Hover Eksklusif 1 Kartu:
      - Ketika mouse bergerak menyentuh kartu manapun, semua kartu lain (termasuk hari aktif) 
        otomatis mengecil/pasif.
      - Hanya kartu yang sedang disentuh kursor mouse saja yang maju ke depan dan berukuran besar secara eksklusif.
      - Jika kursor meninggalkan area kartu atau diam selama 5 detik, fokus kembali ke hari aktif (hari ini).
   ==========================================================================
*/

:root {
    --bg-gradient: linear-gradient(135deg, #f4f4f9 0%, #e2e8f0 100%);
    --card-header-bg: #2980b9;
    --text-color: #333;
}

body.theme-siang {
    --bg-gradient: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%);
    --card-header-bg: #0284c7;
    --text-color: #0f172a;
}

body.theme-malam {
    --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    --card-header-bg: #3b82f6;
    --text-color: #f8fafc;
}

body.theme-ramai {
    --bg-gradient: linear-gradient(135deg, #fbcfe8 0%, #fde68a 50%, #bae6fd 100%);
    --card-header-bg: #db2777;
    --text-color: #311005;
}

body {
    font-family: Arial, sans-serif;
    background: var(--bg-gradient);
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    height: 100vh;
    margin: 0;
    overflow: hidden;
    box-sizing: border-box;
    padding: 10px;
    transition: background 0.5s ease;
}

.top-dashboard {
    width: 98vw;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    z-index: 10;
    padding: 0 10px;
    box-sizing: border-box;
}

.left-info-group, .right-info-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    max-width: 45%;
}

.right-info-group {
    justify-content: flex-end;
    align-items: flex-end;
    position: relative;
    height: 0;
}

.info-box {
    background-color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    padding: 6px 14px;
    transition: all 0.3s ease;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: #333;
}

.info-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(52, 152, 219, 0.2);
    border-color: #3498db;
}

.box-app-name { font-size: 16px; font-weight: bold; color: #2c3e50; }
.box-school-name { font-size: 14px; font-weight: 600; color: #34495e; }
.box-address, .box-phone, .box-email, .box-classes { font-size: 12px; color: #7f8c8d; }

.box-clock {
    font-size: 46px;
    font-weight: bold;
    color: #2980b9;
    padding: 4px 12px;
    position: absolute;
    right: 0;
    top: 0;
    white-space: nowrap;
    text-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.box-date {
    font-size: 24px;
    font-weight: 600;
    color: #16a085;
    padding: 4px 12px;
    position: absolute;
    right: 0;
    top: 55px;
    white-space: nowrap;
}

/* --- KARTU HARI --- */
.card-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 98vw;
    height: 72vh; 
    z-index: 100;
}

/* TAMPILAN DASAR KARTU (KECIL / PASIF) */
.card {
    width: 14vw;
    max-width: 160px;
    min-width: 95px;
    height: 65vh;
    max-height: 360px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    box-shadow: -5px 5px 15px rgba(0, 0, 0, 0.12);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 2vh 1vw;
    box-sizing: border-box;
    position: relative;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    opacity: 0.85;
    cursor: pointer;
    z-index: 1;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.6);
}

/* KETIKA KARTU BERSTATUS .active (HARI INI SAAT TIDAK ADA HOVER) */
.card.active {
    width: 55vw !important;
    max-width: 800px !important;
    height: 90vh !important;
    max-height: 900px !important;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.35);
    opacity: 1 !important;
    z-index: 2000 !important;
    border: 2px solid #3498db;
    transform: translateY(-5px) scale(1) !important;
    background: rgba(255, 255, 255, 0.98);
}

/* LOGIKA HOVER EKSKLUSIF:
   Begitu container di-hover oleh kursor, SEMUA kartu (termasuk .active) dipaksa kembali kecil/pasif.
   Hanya kartu yang spesifik di-hover (:hover) yang membesar dan di depan.
*/
.card-container:hover .card {
    width: 14vw !important;
    max-width: 160px !important;
    min-width: 95px !important;
    height: 65vh !important;
    max-height: 360px !important;
    box-shadow: -5px 5px 15px rgba(0, 0, 0, 0.12) !important;
    opacity: 0.85 !important;
    z-index: 1 !important;
    border: 1px solid rgba(255, 255, 255, 0.6) !important;
    transform: none !important;
    background: rgba(255, 255, 255, 0.92) !important;
}

/* HANYA KARTU YANG SEDANG DISENTUH MOUSE SAJA YANG MENJADI BESAR DAN DI DEPAN */
.card-container .card:hover {
    width: 55vw !important;
    max-width: 800px !important;
    height: 90vh !important;
    max-height: 900px !important;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.35) !important;
    opacity: 1 !important;
    z-index: 2500 !important;
    border: 2px solid #3498db !important;
    transform: translateY(-5px) scale(1) !important;
    background: rgba(255, 255, 255, 0.98) !important;
}

.card:not(:first-child) {
    margin-left: -3.5vw;
}

.card-header {
    font-size: clamp(12px, 1.4vw, 18px);
    font-weight: bold;
    color: #333;
    text-align: center;
    padding: 8px;
    border-radius: 8px;
    background: rgba(41, 128, 185, 0.1);
    transition: font-size 0.4s ease, background 0.3s ease;
}

/* Header menyesuaikan saat kartu aktif atau di-hover */
.card.active .card-header,
.card:hover .card-header {
    font-size: clamp(20px, 2.5vw, 26px);
    color: #fff;
    background: var(--card-header-bg);
}

.card-body {
    font-size: clamp(10px, 1.1vw, 14px);
    color: #444;
    flex-grow: 1;
    overflow-y: auto;
    transition: font-size 0.4s ease;
    margin-top: 6px;
    padding-right: 4px;
}

.card.active .card-body,
.card:hover .card-body {
    font-size: clamp(12px, 1.4vw, 15px);
}

/* --- BARIS ALARM & ANIMASI --- */
.alarm-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    margin-bottom: 6px;
    border-radius: 8px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    cursor: grab;
    transition: background 0.3s ease, border 0.3s ease, box-shadow 0.3s ease;
}
.alarm-row:active { cursor: grabbing; }
.alarm-row.dragging { opacity: 0.4; background: #cbd5e1; }
.alarm-row:hover { border-color: #3498db; box-shadow: 0 3px 8px rgba(52,152,219,0.12); }

@keyframes zoomInOut {
    0% { transform: scale(1); }
    50% { transform: scale(1.15); color: #e74c3c; }
    100% { transform: scale(1); }
}

.alarm-row.upcoming-alert .row-time {
    animation: zoomInOut 1s infinite ease-in-out;
    font-weight: bold;
}

@keyframes neonRainbow {
    0% { background-color: #fffae6; border-color: #ff007f; box-shadow: 0 0 10px #ff007f, inset 0 0 5px #ff007f; }
    33% { background-color: #e6fffa; border-color: #00ffff; box-shadow: 0 0 15px #00ffff, inset 0 0 5px #00ffff; }
    66% { background-color: #fae6ff; border-color: #9d00ff; box-shadow: 0 0 10px #9d00ff, inset 0 0 5px #9d00ff; }
    100% { background-color: #fffae6; border-color: #ff007f; box-shadow: 0 0 10px #ff007f, inset 0 0 5px #ff007f; }
}

.alarm-row.ongoing-active {
    animation: neonRainbow 1.5s infinite alternate;
    border-width: 2px;
}

.drag-handle { cursor: grab; color: #94a3b8; font-weight: bold; padding: 0 2px; }
.row-time { font-family: monospace; font-weight: bold; width: 55px; color: #2980b9; display: inline-block; transition: transform 0.2s; }
.row-song { flex-grow: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; color: #1e293b; }
.row-actions { display: flex; gap: 4px; align-items: center; }

.icon-btn { background: #f8fafc; border: 1px solid #cbd5e1; cursor: pointer; font-size: 12px; padding: 3px 7px; border-radius: 5px; color: #334155; transition: all 0.2s; }
.icon-btn:hover { background: #3498db; color: #fff; border-color: #3498db; }
.btn-del:hover { background: #d63031 !important; border-color: #d63031 !important; color: #fff; }

.add-row-trigger { width: 100%; border: 1px dashed #94a3b8; background: rgba(255,255,255,0.7); padding: 8px; cursor: pointer; border-radius: 8px; font-size: 12px; color: #475569; font-weight: bold; margin-top: 6px; text-align: center; transition: all 0.2s; }
.add-row-trigger:hover { background: #3498db; color: #fff; border-color: #3498db; }

/* --- DASHBOARD BAWAH --- */
.bottom-dashboard {
    width: 98vw;
    display: flex;
    gap: 15px;
    align-items: center;
    justify-content: space-between;
    z-index: 10;
    box-sizing: border-box;
    padding: 0 10px;
}

.announcement-card {
    flex: 1;
    background-color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    padding: 10px 20px;
    font-size: 13px;
    color: #2c3e50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.action-button {
    background-color: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(8px);
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    padding: 10px 16px;
    font-size: 13px;
    font-weight: bold;
    color: #2980b9;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.5);
    white-space: nowrap;
}

.action-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 22px rgba(52, 152, 219, 0.25);
    background-color: #3498db;
    color: #ffffff;
    border-color: #3498db;
}

.theme-selector {
    display: flex;
    gap: 6px;
}

/* --- ATURAN KELAS FORCE-DEFAULT --- */
.card-container.force-default .card {
    width: 14vw !important;
    max-width: 160px !important;
    min-width: 95px !important;
    height: 65vh !important;
    max-height: 360px !important;
    box-shadow: -5px 5px 15px rgba(0, 0, 0, 0.12) !important;
    opacity: 0.85 !important;
    z-index: 1 !important;
    transform: none !important;
    background: rgba(255, 255, 255, 0.92) !important;
}

.card-container.force-default .card.active {
    width: 55vw !important;
    max-width: 800px !important;
    height: 90vh !important;
    max-height: 900px !important;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.35) !important;
    opacity: 1 !important;
    z-index: 2000 !important;
    transform: translateY(-5px) scale(1) !important;
    background: rgba(255, 255, 255, 0.98) !important;
}

/* Modal */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.55); backdrop-filter: blur(4px); display: none; align-items: center; justify-content: center; z-index: 3000; }
.modal-box { background: white; padding: 22px; border-radius: 14px; width: 420px; max-height: 80vh; display: flex; flex-direction: column; color: #333; box-shadow: 0 20px 40px rgba(0,0,0,0.2); }
.song-list-container { max-height: 220px; overflow-y: auto; border: 1px solid #e2e8f0; margin: 10px 0; border-radius: 8px; background: #f8fafc; }
.song-item { padding: 8px 12px; border-bottom: 1px solid #eee; cursor: pointer; display: flex; justify-content: space-between; align-items: center; font-size: 13px; transition: background 0.2s; }
.song-item:hover { background: #e2e8f0; }
.song-item.selected { background: #e0f2fe; font-weight: bold; color: #0284c7; }
.url-input { width: 100%; padding: 8px; box-sizing: border-box; border: 1px solid #cbd5e1; border-radius: 6px; font-size: 13px; outline: none; transition: border-color 0.2s; }
.url-input:focus { border-color: #3498db; box-shadow: 0 0 0 3px rgba(52,152,219,0.15); }

