/* =============================================== */
/* ===========      GAYA DASAR & UMUM      =========== */
/* =============================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
    color: #333;

    /* Gabungkan gradasi semi-transparan dengan gambar */
    background: linear-gradient(rgba(40, 40, 70, 0.88), rgba(40, 40, 70, 0.88)), url('img/BG.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-decoration: none; /* Menghilangkan garis bawah pada link <a> */
    display: inline-block; /* Agar padding dan margin berfungsi pada link <a> */
}

.btn-primary {
    background: #48bb78;
    color: white;
}

.btn-primary:hover {
    background: #38a169;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(72, 187, 120, 0.3);
}

.btn-danger {
    background: #e53e3e;
    color: white;
}

.btn-danger:hover {
    background: #c53030;
}


/* =============================================== */
/* ===========      HALAMAN UTAMA (INDEX)      =========== */
/* =============================================== */
.header {
    text-align: center;
    background: white;
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    color: #4a5568;
}

.header p {
    font-size: 1.2em;
    color: #666;
}

.main-content {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.stage {
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    color: white;
    text-align: center;
    padding: 20px;
    margin-bottom: 40px;
    border-radius: 50px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.stage-label {
    font-weight: bold;
    font-size: 1.2em;
    letter-spacing: 2px;
}

.seat-map {
    margin-bottom: 30px;
    overflow-x: auto;
    padding-bottom: 10px;
}

.seat-container {
    min-width: max-content;
    width: max-content;
    margin: 0 auto;
}

.seat-row {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    gap: 10px;
    white-space: nowrap;
}

.row-label {
    width: 40px;
    text-align: center;
    font-weight: bold;
    font-size: 1.1em;
    color: #555;
}

.seats {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    justify-content: center;
}

.seat {
    width: 25px;
    height: 25px;
    border: none;
    border-radius: 6px;
    font-size: 10px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    display: flex; /* Untuk menengahkan angka */
    align-items: center;
    justify-content: center;
}

.seat.available { background: #48bb78; color: white; }
.seat.available:hover { background: #38a169; transform: scale(1.1); }
.seat.selected { background: #3182ce; color: white; transform: scale(1.1); box-shadow: 0 0 10px rgba(49, 130, 206, 0.5); }
.seat.booked { background: #e53e3e; color: white; cursor: not-allowed; }
.seat.maintenance { background: #a0aec0; color: white; cursor: not-allowed; }
.seat.aisle-after { margin-right: 20px; }

.legend {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 30px;
    padding: 20px;
    background: #f7fafc;
    border-radius: 10px;
}

.legend-item { display: flex; align-items: center; gap: 10px; }
.legend-item .seat { cursor: default; }

.selected-info {
    background: #e6fffa;
    border: 2px solid #38b2ac;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
}

.selected-info h3 { margin-bottom: 15px; color: #234e52; }
.selected-seats { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 15px; }
.seat-tag { background: #38b2ac; color: white; padding: 5px 12px; border-radius: 20px; font-size: 14px; font-weight: bold; }
.total-price { font-size: 1.3em; color: #234e52; text-align: right; }

.scroll-hint { text-align: center; font-size: 14px; color: #666; margin-top: 10px; display: none; }


/* =============================================== */
/* ===========      BAGIAN FORMULIR      =========== */
/* =============================================== */
.booking-form {
    background: #f0fff4;
    border: 2px solid #48bb78;
    border-radius: 10px;
    padding: 25px;
    margin-top: 20px;
}

.booking-form h3 { margin-bottom: 20px; color: #22543d; }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 5px; font-weight: bold; color: #22543d; }

/* Menyamakan tampilan semua form input dan select */
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
#paymentMethod {
    width: 100%;
    padding: 12px;
    border: 1px solid #c6f6d5;
    border-radius: 8px;
    font-size: 16px;
    box-sizing: border-box;
    margin-top: 5px;
    background-color: white;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #48bb78;
    box-shadow: 0 0 0 3px rgba(72, 187, 120, 0.1);
}

/* Menambahkan kembali panah dropdown kustom untuk <select> */
.form-group select {
    background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%2322543d%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E');
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 0.65em auto;
    padding-right: 2.5rem;
}


/* =============================================== */
/* =========== HALAMAN ADMIN & LOGIN      =========== */
/* =============================================== */
body.admin-page {
    background: #f7fafc; 
    color: #4a5568;
}

.admin-container { max-width: 1400px; margin: 0 auto; padding: 20px; }

.admin-section {
    background: white;
    color: #2d3748;
    margin-bottom: 30px;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.admin-section h1, .admin-section h2, .admin-section h3,
.admin-section p, .admin-section label {
    color: #2d3748;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 10px;
}

.admin-container .header a { color: #4299e1; font-weight: 600; }

/* Login Page Container */
.login-container {
    width: 100%;
    max-width: 400px;
    margin: 100px auto;
    padding: 30px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    text-align: center;
}
.login-container h1 { margin-bottom: 25px; color: #333; }
.login-container .form-group { text-align: left; }
.login-container input { width: 100%; }
.login-container .error-message { color: #e53e3e; background: #fed7d7; padding: 10px; border-radius: 5px; margin-bottom: 15px; }


/* =============================================== */
/* ===========      RESPONSIVE DESIGN      =========== */
/* =============================================== */
@media (max-width: 768px) {
    .container, .admin-container { padding: 15px; }
    .header h1 { font-size: 2em; }
    .seat { width: 22px; height: 22px; font-size: 9px; flex-shrink: 0; }
    .seats { gap: 3px; }
    .legend { flex-wrap: wrap; gap: 15px; }
    .row-label { width: 25px; font-size: 0.9em; flex-shrink: 0; }
    .seat-map { -webkit-overflow-scrolling: touch; }
    .scroll-hint { display: block; }
}

@media (max-width: 480px) {
    .main-content, .header, .admin-section { padding: 15px; }
    .seat { width: 20px; height: 20px; font-size: 8px; }
    .seats { gap: 2px; }
    .row-label { width: 20px; font-size: 0.8em; }
}

/* Style untuk gambar denah layout */
.venue-layout-image {
    width: 60%; /* Mengurangi lebar gambar menjadi 60% dari kontainer */
    /* Jika Anda ingin ukuran spesifik, bisa pakai: max-width: 500px; */
    height: auto; /* Menjaga rasio aspek gambar */
    display: block; /* Mencegah spasi ekstra di bawah gambar */
    margin: 0 auto 30px auto; /* Posisi di tengah dan beri jarak 30px di bawahnya */
    border-radius: 10px; /* Opsional: sudut sedikit melengkung */
    box-shadow: 0 5px 15px rgba(0,0,0,0.1); /* Opsional: beri sedikit bayangan */
}

/* Tambahan: Responsivitas untuk layar kecil */
@media (max-width: 768px) {
    .venue-layout-image {
        width: 90%; /* Pada layar kecil, biarkan lebih lebar agar jelas */
        margin: 0 auto 20px auto; /* Sesuaikan margin */
    }
}

/* =============================================== */
/* ===========      STYLE UNTUK LOADER      =========== */
/* =============================================== */

.loader-overlay {
    position: fixed; /* Tetap di posisi yang sama bahkan saat di-scroll */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7); /* Latar belakang hitam semi-transparan */
    display: flex; /* Menggunakan flexbox untuk menengahkan spinner */
    justify-content: center;
    align-items: center;
    z-index: 9999; /* Memastikan loader ada di lapisan paling atas */
    display: none; /* Sembunyikan secara default */
}

.loader-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3; /* Warna dasar lingkaran */
    border-top: 5px solid #48bb78; /* Warna animasi putaran */
    border-radius: 50%;
    animation: spin 1s linear infinite; /* Terapkan animasi 'spin' */
}

/* Animasi untuk putaran spinner */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.seat.invitation-only {
    background: #9F7AEA; /* Warna ungu lembut */
    color: white;
    cursor: not-allowed;
}

.legend-item .seat.invitation-only {
    transform: none; /* Hilangkan efek scale di legenda */
}

/* Style untuk penanda kursi Undangan/VIP yang sudah terkunci */
.seat.booked.vip-marker {
    /* Gunakan warna dasar merah yang sedikit berbeda agar lebih kontras */
    background-color: #c53030; 
    
    /* Tambahkan efek garis-garis diagonal */
    background-image: repeating-linear-gradient(
        -45deg,
        rgba(255, 255, 255, 0.15),
        rgba(255, 255, 255, 0.15) 2px,
        transparent 2px,
        transparent 5px
    );
}

/* =============================================== */
/* ========   GAYA UNTUK TABEL ADMIN   ========= */
/* =============================================== */

/* Wrapper untuk membuat tabel bisa di-scroll di mobile */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Keseluruhan tabel di dalam admin section */
.admin-section table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    font-size: 16px;
    color: #4a5568;
}

/* Header tabel (Kolom Judul) */
.admin-section thead th {
    background-color: #f8f9fa;
    border-bottom: 2px solid #e2e8f0;
    padding: 15px;
    text-align: left;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #2d3748;
}

/* Semua sel tabel (header dan data) */
.admin-section th,
.admin-section td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

/* Zebra Stripping: Memberi warna latar berbeda untuk baris genap */
.admin-section tbody tr:nth-child(even) {
    background-color: #f7fafc;
}

/* Hover Effect: Mengubah warna latar saat mouse berada di atas baris */
.admin-section tbody tr:hover {
    background-color: #ebf8ff;
}

/* Style untuk status badge di dalam tabel */
.admin-section .status-badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
    display: inline-block;
}

/* =============================================== */
/* ======== STYLE BARU UNTUK GRID STATISTIK ======== */
/* =============================================== */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
}

.stat-item {
    background-color: white;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.stat-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
}

.stat-icon {
    font-size: 2.5rem;
    padding: 15px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-info {
    text-align: left;
}

.stat-value {
    font-size: 2.2rem;
    font-weight: 700;
    line-height: 1;
}

.stat-label {
    font-size: 0.95rem;
    color: #4a5568;
    margin-top: 5px;
}

/* Pewarnaan Spesifik untuk Setiap Kartu */
.stat-available .stat-icon { background-color: #c6f6d5; }
.stat-available .stat-value { color: #2f855a; }

.stat-sold .stat-icon { background-color: #fed7d7; }
.stat-sold .stat-value { color: #c53030; }

.stat-locked-invitation .stat-icon { background-color: #e9d8fd; }
.stat-locked-invitation .stat-value { color: #805ad5; }

.stat-total-invitation .stat-icon { background-color: #dbeafe; }
.stat-total-invitation .stat-value { color: #3b82f6; }