:root {
    --primary-color: #005a9e;
    --secondary-color: #e53e3e;
    --background-color: #f4f7f6;
    --card-background: #ffffff;
    --text-color: #2d3748;
    --subtle-text-color: #718096;
    --border-color: #e2e8f0;
}

/* ================= ANIMATIONS (Tetap Sama) ================= */
@keyframes logoSlideIn {
    0% { opacity: 0; transform: translateX(-100px) rotate(-20deg); }
    60% { opacity: 1; transform: translateX(10px) rotate(5deg); }
    80% { transform: translateX(-5px) rotate(-2deg); }
    100% { opacity: 1; transform: translateX(0) rotate(0deg); }
}

@keyframes logoPopOut {
    0% { opacity: 0; transform: scale(0) rotate(-180deg); }
    60% { opacity: 1; transform: scale(1.2) rotate(10deg); }
    80% { transform: scale(0.9) rotate(-5deg); }
    100% { opacity: 1; transform: scale(1) rotate(0deg); }
}

@keyframes fadeInSlide {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ================= BASE STYLES ================= */
body {
    font-family: 'Inter', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ================= HEADER ================= */
.main-header {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem 2rem;
    background: linear-gradient(135deg, #e11d48 0%, #9f1239 100%);
    color: white;
    border-bottom: 5px solid #fbbf24;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-logo {
    height: 75px;
    animation: logoSlideIn 1.2s ease-out forwards;
    opacity: 0;
    margin-right: 1rem;
}

.building-logo {
    height: 75px;
    animation: logoPopOut 1.5s ease-out forwards;
    opacity: 0;
    margin-left: 1rem;
}

.main-header h1 {
    font-size: 1.6rem;
    font-weight: 800;
    color: white;
    animation: fadeInSlide 1s ease-out 0.5s forwards;
    opacity: 0;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    text-shadow: 0 2px 10px rgba(0,0,0,0.2);
    margin: 0 1.5rem;
}

/* ================= CONTENT CONTAINER ================= */
.container {
    max-width: 1200px; /* Diperlebar sedikit agar 3 card muat lega */
    margin: 2rem auto;
    padding: 2rem;
    flex: 1;
}

.welcome-message {
    text-align: center;
    margin-bottom: 3rem;
    animation: fadeInSlide 0.8s ease-out;
}

.welcome-message h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.welcome-message p {
    font-size: 1.1rem;
    color: var(--subtle-text-color);
    margin-top: 0;
}

/* ================= MENU GRID (MODIFIKASI UTAMA) ================= */
.menu-container {
    display: grid;
    /* Default Mobile: 1 Kolom */
    grid-template-columns: 1fr; 
    gap: 2rem;
    justify-content: center;
    padding: 1rem 0;
}

/* Tampilan Tablet & Desktop: Paksa jadi 2 Kolom di Tablet, 4 di Desktop */
@media (min-width: 768px) {
    .menu-container {
        grid-template-columns: repeat(2, 1fr); 
    }
}

@media (min-width: 1024px) {
    .menu-container {
        grid-template-columns: repeat(3, 1fr); 
    }
}

/* ================= MENU ITEM CARD ================= */
.menu-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center; /* Konten vertikal rata tengah */
    
    background-color: var(--card-background);
    padding: 2.5rem 1.5rem; /* Padding diperbesar sedikit */
    border-radius: 16px;
    text-decoration: none;
    color: inherit;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease;
    
    /* Agar tinggi card seragam dan terlihat kokoh */
    height: 100%; 
    min-height: 280px; /* Tinggi minimum agar kotak terlihat proporsional */
    box-sizing: border-box;
}

.menu-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    border-color: #fca5a5;
}

.menu-item h3 {
    text-align: center;
    font-size: 1.35rem; /* Font judul sedikit diperbesar */
    font-weight: 700;
    margin: 0 0 0.75rem 0;
    color: var(--text-color);
}

.menu-item p {
    text-align: center;
    font-size: 1rem;
    color: var(--subtle-text-color);
    line-height: 1.5;
    margin: 0;
    max-width: 250px; /* Membatasi lebar teks agar tidak terlalu melebar */
}

/* --- CARD SPECIFICS (COLORS & BORDERS) --- */
/* Building - Red */
.building-card {
    border-left: 5px solid var(--secondary-color);
    background: linear-gradient(to right, rgba(229, 62, 62, 0.03) 0%, #ffffff 100%);
}

.building-card:hover {
    border-left-width: 8px;
    background: linear-gradient(to right, rgba(229, 62, 62, 0.08) 0%, #ffffff 100%);
}

/* Maintenance - Blue */
.maintenance-card {
    border-left: 5px solid var(--primary-color);
    background: linear-gradient(to right, rgba(0, 90, 158, 0.03) 0%, #ffffff 100%);
}

.maintenance-card:hover {
    border-left-width: 8px;
    border-color: #004a87 !important;
    background: linear-gradient(to right, rgba(0, 90, 158, 0.08) 0%, #ffffff 100%);
}

/* Energy - Green */
.energy-card {
    border-left: 5px solid #10b981;
    background: linear-gradient(to right, rgba(16, 185, 129, 0.03) 0%, #ffffff 100%);
}

.energy-card:hover {
    border-left-width: 8px;
    border-color: #059669 !important;
    background: linear-gradient(to right, rgba(16, 185, 129, 0.08) 0%, #ffffff 100%);
}

/* --- ICONS --- */
/* Icon tunggal */
.menu-item > img, .menu-item > svg {
    display: block;
    margin-bottom: 2rem;
    height: 90px; /* Ukuran icon diperbesar sedikit agar seimbang dengan card */
    width: auto;
    object-fit: contain;
    transition: transform 0.3s ease;
}

/* Icon berjejer (Login) */
.card-icons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-bottom: 2rem;
}

.card-icons img, .card-icons svg {
    height: 75px; /* Disesuaikan agar pas berdua */
    width: auto;
    transition: transform 0.3s ease;
}

.menu-item:hover img, .menu-item:hover svg {
    transform: scale(1.1);
}

/* ================= MODAL STYLES (BARU) ================= */

/* Utility Class untuk menyembunyikan elemen */
.hidden {
    display: none !important;
    opacity: 0;
}

/* Overlay Background Gelap */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6); /* Latar belakang semi-transparan */
    z-index: 9999; /* Pastikan selalu di atas */
    display: flex;
    align-items: center; /* Vertikal tengah */
    justify-content: center; /* Horizontal tengah */
    backdrop-filter: blur(3px); /* Efek blur pada background (opsional) */
    animation: fadeInOverlay 0.3s ease-out;
}

/* Kotak Modal Utama */
.modal-box {
    background: #ffffff;
    padding: 2.5rem;
    border-radius: 20px;
    width: 90%;
    max-width: 450px; /* Lebar maksimal agar tidak terlalu lebar di desktop */
    text-align: center;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    animation: slideUpModal 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Header Icon & Warna */
.modal-box.warning-type .modal-icon {
    color: #dc2626; /* Warna merah icon */
    background-color: #fee2e2; /* Latar belakang merah muda icon */
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem auto;
}

.modal-icon svg {
    width: 40px;
    height: 40px;
}

/* Tipografi Modal */
.modal-box h3 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1a202c;
    margin: 0 0 1rem 0;
}

.modal-box p {
    color: var(--subtle-text-color);
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

/* Box Info Jam Kerja */
.operational-hours {
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 2rem;
    color: var(--text-color);
    font-size: 1rem;
}

.operational-hours span {
    display: block;
    font-size: 0.9rem;
    color: var(--subtle-text-color);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

/* Tombol Tutup */
.modal-close-btn {
    background-color: #dc2626;
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
    transition: background-color 0.2s;
    width: 100%; /* Tombol selebar modal */
}

.modal-close-btn:hover {
    background-color: #b91c1c;
}

/* Animasi Muncul */
@keyframes fadeInOverlay {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUpModal {
    from { 
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to { 
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* =========================================
   MOBILE RESPONSIVE OVERRIDES (LANDING PAGE)
   ========================================= */

@media (max-width: 768px) {
    
    /* === 1. GLOBAL CONTAINER === */
    .container {
        padding: 1rem; /* Mengurangi padding (Desktop: 2rem) */
        width: 100%;
        box-sizing: border-box; /* Pastikan padding tidak menambah lebar */
        margin-top: 1rem;
    }

    /* === 2. HEADER ADJUSTMENTS === */
    .main-header {
        flex-direction: column; /* Logo & Judul tumpuk ke bawah */
        padding: 1rem;
        gap: 0.5rem;
        height: auto;
    }

    .header-logo, 
    .building-logo {
        height: 50px; /* Kecilkan logo agar proporsional */
        margin: 0; /* Reset margin */
    }

    .main-header h1 {
        font-size: 1.2rem; /* Kecilkan font judul */
        margin: 0.5rem 0;
        line-height: 1.3;
    }

    /* === 3. WELCOME MESSAGE === */
    .welcome-message {
        margin-bottom: 2rem;
        padding: 0 0.5rem;
    }

    .welcome-message h2 {
        font-size: 1.25rem; /* Judul welcome lebih ramah layar kecil */
        line-height: 1.4;
    }

    .welcome-message p {
        font-size: 1rem;
    }

    /* === 4. MENU GRID & CARDS === */
    /* Grid sudah 1 kolom dari default style, kita hanya rapikan card-nya */
    .menu-container {
        gap: 1.25rem; /* Jarak antar kartu dikurangi sedikit */
    }

    .menu-item {
        padding: 1.5rem; /* Padding dalam kartu dikurangi */
        min-height: auto; /* Hilangkan tinggi minimum agar menyesuaikan isi */
    }

    /* Kecilkan ikon di dalam menu */
    .menu-item > img, .menu-item > svg {
        height: 70px; 
        margin-bottom: 1rem;
    }

    .card-icons img, .card-icons svg {
        height: 60px; /* Icon kembar (Login) dikecilkan */
        gap: 10px;
    }

    .menu-item h3 {
        font-size: 1.2rem;
    }

    /* === 5. MODAL RESPONSIVE === */
    /* Agar popup peringatan jam kerja muat di HP */
    .modal-box {
        width: 85%; /* Beri jarak kiri kanan */
        padding: 1.5rem; /* Kurangi padding dalam modal */
        max-height: 90vh; /* Cegah modal lebih tinggi dari layar */
        overflow-y: auto; /* Scroll jika konten modal panjang */
    }

    .modal-box h3 {
        font-size: 1.3rem;
    }

    .modal-box p {
        font-size: 0.95rem;
    }

    .modal-icon {
        width: 60px !important;
        height: 60px !important;
        margin-bottom: 1rem !important;
    }

    .modal-icon svg {
        width: 30px;
        height: 30px;
    }
}

/* === LANDSCAPE MODE FIX === */
/* Mencegah header memakan seluruh layar saat HP dimiringkan */
@media (max-height: 500px) and (orientation: landscape) {
    .main-header {
        flex-direction: row; /* Kembali ke baris agar hemat tinggi */
        padding: 0.5rem 1rem;
    }
    
    .header-logo, .building-logo {
        height: 40px;
    }
    
    .main-header h1 {
        font-size: 1.2rem;
        margin: 0 1rem;
    }
}
