/* ==================================== */
/* 0. PALETTE & RESET GLOBAL */
/* ==================================== */

/* Definisikan Variabel Warna untuk Kemudahan */
:root {
    --primary-color: #007bff; /* Biru Primer */
    --accent-color: #ff4500; /* Oranye/Merah Aksen */
    --text-dark: #333333;
    --text-light: #ffffff;
    --bg-light: #f4f4f9;
    --shadow-soft: 0 4px 12px rgba(0, 0, 0, 0.08); /* Bayangan lebih lembut */
}

body {
    font-family: 'Poppins', sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.6;
}

h2 {
    text-align: center;
    color: var(--primary-color); 
    /* Margin dihilangkan total untuk kerapatan maksimal */
    margin: 0; 
    /* Line height dikurangi agar judul lebih ringkas */
    line-height: 1.1; 
    /* Margin negatif untuk menarik elemen di bawahnya ke atas (khusus countdown) */
    margin-bottom: -5px; 
    font-weight: 800;
    font-size: clamp(1.5rem, 5vw, 2.5rem); /* Font responsif */
}
/* Kembalikan margin H2 default untuk section selain countdown */
.ticket-section h2 { 
    margin: 40px 0 20px 0;
    margin-bottom: 20px; /* Non-negatif margin */
}

section {
    padding: 20px 0; /* Padding vertikal konsisten */
    margin: 0;
}

/* KELAS KHUSUS UNTUK CENTERING KONTEN UTAMA */
.content-wrapper {
    max-width: 1200px;
    margin: 0 auto; /* Otomatis terpusat */
    padding: 0 20px; /* Padding horizontal agar konten tidak menempel di tepi */
    box-sizing: border-box;
}

/* ==================================== */
/* TIKER INFO PENTING (BARU) */
/* ==================================== */
.info-ticker-container {
    background-color: var(--accent-color); /* Latar belakang oranye/merah */
    color: var(--text-light);
    padding: 8px 0; /* Padding vertikal minimal */
    font-size: 0.9em;
    font-weight: 600;
    width: 100%;
    position: sticky; /* Membuatnya menempel */
    top: 0;
    z-index: 100; /* Z-index tertinggi */
    display: flex;
    align-items: center;
    overflow: hidden; 
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.ticker-label {
    background-color: #cc3600; /* Warna lebih gelap untuk label */
    padding: 0 15px;
    margin-right: 15px;
    white-space: nowrap; 
    flex-shrink: 0;
}

#tickerText {
    flex-grow: 1;
    margin: 0;
    padding: 0;
    white-space: nowrap;
}


/* ==================================== */
/* 1. HEADER & NAVIGASI */
/* ==================================== */
.main-header {
    background-color: var(--text-light);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: sticky; 
    top: 0; 
    z-index: 99; /* Z-index di bawah ticker */
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px 20px;
}

.logo {
    max-height: 60px;
    width: auto;
    object-fit: contain; 
    transition: max-height 0.3s;
}

.main-nav a {
    text-decoration: none;
    color: var(--text-dark);
    margin-left: 15px;
    font-weight: 600;
    transition: color 0.3s;
}

.btn-daftar {
    background-color: var(--accent-color); 
    color: var(--text-light) !important;
    padding: 10px 20px;
    border-radius: 50px;
    font-weight: 700;
    box-shadow: 0 4px 6px rgba(255, 69, 0, 0.3);
    transition: background-color 0.3s, box-shadow 0.3s, transform 0.2s;
    text-align: center;
    cursor: pointer;
}

.btn-daftar:hover:not(.disabled-btn) {
    background-color: #e63900;
    transform: translateY(-2px);
    box-shadow: 0 6px 10px rgba(255, 69, 0, 0.4);
}

.disabled-btn {
    background-color: #adb5bd;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

/* ==================================== */
/* 2. GAMBAR STATIS (EKS CAROUSEL) */
/* ==================================== */
.carousel-section {
    width: 100%; 
    margin: 0 0 40px 0;
    position: relative;
    overflow: hidden; 
}

.carousel-container {
    width: 100%;
    position: relative;
    box-shadow: var(--shadow-soft);
}

/* ==================================== */
/* 3. HITUNGAN MUNDUR (ULTRA RAMPING) */
/* ==================================== */
.countdown-section {
    background-color: var(--text-light);
    text-align: center;
    /* Padding atas/bawah dikurangi hingga 10px untuk mobile */
    padding: 10px 20px 10px 20px; 
    border-radius: 12px;
    max-width: 700px;
    margin: 0 auto 40px auto;
    box-shadow: var(--shadow-soft);
}

.countdown-timer {
    display: flex;
    justify-content: center;
    gap: 10px;
    /* Margin total 0 */
    margin: 0; 
    padding-top: 5px; /* Jarak minimal antara h2 dan timer */
    font-weight: bold;
}

.timer-box {
    /* Bentuk Silinder */
    background: linear-gradient(145deg, var(--primary-color), #0056b3);
    color: var(--text-light);
    padding: 15px 5px;
    border-radius: 50px; 
    flex: 1; 
    max-width: 80px; 
    
    font-size: 1em; 
    display: flex;
    flex-direction: column;
    align-items: center;
    box-sizing: border-box;
    transition: transform 0.3s;
    overflow: hidden; 
}

.timer-box:hover {
    transform: scale(1.05);
}

.timer-box span {
    font-size: clamp(2.5rem, 8vw, 4rem); 
    line-height: 1.1; 
}

.timer-box small {
    font-size: clamp(0.7rem, 2vw, 1rem); 
    opacity: 0.9;
}

.timer-separator {
    font-size: clamp(2rem, 8vw, 4rem); 
    font-weight: 300;
    color: var(--primary-color);
    padding: 0 5px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ==================================== */
/* 4. KOLOM KATEGORI TIKET (GRID CARD) */
/* ==================================== */
.ticket-section {
    padding-bottom: 50px;
}

.ticket-grid {
    display: grid;
    /* Di mobile, tetap 1 kolom */
    grid-template-columns: 1fr; 
    gap: 30px; /* Jarak antar kartu lebih lega */
}

.ticket-card {
    background-color: var(--text-light);
    padding: 30px; /* Padding lebih besar */
    border-radius: 15px; /* Sudut membulat */
    box-shadow: var(--shadow-soft);
    text-align: center;
    border-top: 5px solid var(--accent-color); /* Garis warna di atas */
    transition: transform 0.3s, box-shadow 0.3s;
    /* Efek Kartu */
    cursor: pointer; 
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.ticket-card::before {
    /* Desain Kartu / Ticket effect (opsional, bisa dihapus jika tidak suka) */
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 10% 10%, rgba(255, 255, 255, 0.1) 1px, transparent 1px);
    background-size: 20px 20px;
    opacity: 0.1;
    z-index: -1;
}

.ticket-card:hover:not(.unavailable) {
    transform: translateY(-8px); /* Efek angkat */
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.ticket-card h3 {
    margin-top: 0;
    font-size: 1.8em;
    color: var(--accent-color);
    font-weight: 700;
}

.price {
    font-size: 2.5em;
    font-weight: 900;
    color: var(--text-dark);
    margin: 15px 0;
}

.desc {
    color: #777;
    margin-bottom: 25px;
    font-size: 0.95em;
}

.btn-buy {
    /* Tombol Pendaftaran di dalam Card */
    display: block;
    background-color: var(--accent-color);
    color: var(--text-light) !important;
    padding: 10px 20px;
    border-radius: 50px;
    font-weight: 700;
    box-shadow: 0 4px 6px rgba(255, 69, 0, 0.3);
    transition: background-color 0.3s, box-shadow 0.3s;
    text-decoration: none;
    margin-top: 20px;
}

.btn-buy:hover {
    background-color: #e63900;
}

/* Gaya untuk kartu kuota habis */
.ticket-card.unavailable {
    opacity: 0.6;
    background-color: #e9ecef;
    border-top-color: #adb5bd;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.ticket-card.unavailable .btn-buy {
    background-color: #adb5bd;
    box-shadow: none;
}
.ticket-card.unavailable .btn-buy:hover {
    background-color: #adb5bd;
}

.info-ortu {
    color: #dc3545; /* Merah */
    font-weight: 600;
    margin: -10px 0 15px 0;
    font-size: 0.9em;
}

/* Warna spesifik untuk kategori di border (Contoh) */
.master-category { border-top-color: #8a2be2; /* Ungu */ }
.kids-category { border-top-color: #28a745; /* Hijau */ }


/* FOOTER */
footer {
    background-color: var(--text-dark);
    color: #b0b0b0;
    text-align: center;
    padding: 20px;
    font-size: 0.9em;
}

/* ==================================== */
/* 5. GAYA POP-UP MODAL S&K (RESPONSIF) */
/* ==================================== */
.modal {
    display: none; 
    position: fixed; 
    z-index: 20; 
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.7); 
}

/* Class ini digunakan oleh JavaScript (showModal) */
.modal.visible {
    display: flex !important; /* Gunakan flex untuk pusatkan di mobile */
    align-items: center;
    justify-content: center;
}

/* Kontainer Utama Modal - Aturan Default (Desktop) */
.modal-content {
    background-color: var(--text-light);
    margin: 5% auto; /* Jarak dari atas dan tengah (Desktop Default) */
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    position: relative;
    max-width: 600px; /* Ukuran Maksimum Desktop */
    width: 90%; 
    animation-name: animatetop;
    animation-duration: 0.4s;
    box-sizing: border-box; 
}

@keyframes animatetop {
    from {top: -300px; opacity: 0}
    to {top: 0; opacity: 1}
}

/* Perbaikan Konten Modal */
.terms-body {
    max-height: 350px; /* Default untuk desktop */
    overflow-y: auto;
    margin-bottom: 20px;
    padding-right: 15px; 
}
.close-button {
    color: #aaa; float: right; font-size: 28px; font-weight: bold; cursor: pointer; line-height: 20px; position: absolute; top: 10px; right: 20px;
}
.close-button:hover, .close-button:focus {
    color: var(--accent-color); text-decoration: none;
}
.modal-title {
    color: var(--primary-color); text-align: left; margin-top: 0; margin-bottom: 20px; font-size: 1.8em; border-bottom: 2px solid #eee; padding-bottom: 10px;
}
.terms-body ul {
    list-style-type: none; padding: 0;
}
.terms-body li {
    margin-bottom: 15px; padding-left: 20px; position: relative; font-size: 0.95em; color: var(--text-dark);
}
.terms-body li::before {
    content: "•"; color: var(--accent-color); font-weight: bold; display: inline-block; width: 1em; margin-left: -1em;
}
.modal-content .btn-daftar {
    width: 100%; padding: 12px; margin-top: 10px;
}


/* ==================================== */
/* MEDIA QUERY untuk LAYAR MOBILE (<768px) */
/* ==================================== */
@media (max-width: 767px) {
    
    .modal {
        /* Memastikan modal dipusatkan di layar mobile */
        padding-top: 0; 
    }
    
    .modal-content {
        /* Di Mobile, kurangi padding agar konten tidak terlalu menempel */
        padding: 20px; 
        
        /* Hapus margin auto (diambil alih oleh flexbox body) */
        margin: 20px; /* Beri margin 20px dari tepi layar */
        
        /* Lebar agar tidak terlalu besar di mobile, tetapi tetap ada margin */
        width: calc(100% - 40px); /* 100% dikurangi margin kiri/kanan */
    }
    
    .terms-body {
        max-height: 60vh; /* Agar bisa digulir di layar kecil */
    }
}


/* ==================================== */
/* MEDIA QUERY UNTUK ELEMEN LAIN */
/* ==================================== */
@media (min-width: 768px) {
    
    .logo {
        max-height: 75px; 
    }

    .countdown-section {
        padding: 15px 40px 15px 40px; 
    }

    .countdown-timer {
        gap: 20px; 
    }
    
    .timer-box {
        max-width: 100px;
        padding: 20px 10px;
    }

    .timer-box span {
        font-size: 3.5rem;
    }
    .timer-box small {
        font-size: 0.85rem;
    }
    .timer-separator {
        font-size: 3.5rem;
    }
    
    /* Ticket Grid (2 kolom di layar lebar) */
    .ticket-grid {
        grid-template-columns: 1fr 1fr; 
        gap: 40px;
    }
}

@media (min-width: 1024px) {
    .ticket-grid {
        /* Tambahkan kolom ketiga untuk layar sangat lebar */
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); 
    }
}