/* --- RESET & DASAR --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #1a1a1a;
    color: white;
    line-height: 1.6;
}

/* --- NAVBAR --- */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 5%;
    background-color: #262626;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.logo img {
    height: 45px;
    width: auto;
    display: block;
    object-fit: contain;
}

.search-container {
    flex: 1;
    display: flex;
    justify-content: center;
    margin: 0 20px;
}

.search-container input {
    width: 100%;
    max-width: 500px;
    padding: 10px 15px;
    border-radius: 20px;
    border: none;
    background: #333;
    color: white;
    outline: none;
}

.hamburger {
    font-size: 24px;
    cursor: pointer;
}

/* --- SIDEBAR --- */
.sidebar {
    position: fixed;
    right: -250px;
    top: 0;
    width: 250px;
    height: 100%;
    background-color: #262626;
    transition: 0.3s;
    padding-top: 60px;
    z-index: 999;
}

.sidebar ul { list-style: none; }
.sidebar ul li a {
    display: block;
    padding: 15px 25px;
    color: white;
    text-decoration: none;
    border-bottom: 1px solid #333;
}

.admin-login { background-color: #3d3d3d; }

/* --- KONTEN UTAMA --- */
.container {
    padding: 20px 5%;
}

/* --- SLIDER --- */
.slider {
    position: relative;
    width: 95%;
    max-width: 1200px;
    margin: 20px auto;
    overflow: hidden;
    border-radius: 15px;
}

.slides {
    display: flex;
    transition: transform 0.5s ease-in-out;
    width: 100%;
}

.slide { min-width: 100%; }
.slide img { width: 100%; display: block; height: auto; border-radius: 15px; }

.prev, .next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}
.next { right: 15px; }
.prev { left: 15px; }

/* --- GRID GAME --- */
.grid-popular {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.card-popular {
    background: #2a2a2a;
    border: 1px solid #3a3a3a;
    border-radius: 18px;
    display: flex;
    align-items: center;
    padding: 14px;
    gap: 15px;
    transition: 0.3s;
}

.card-popular:hover { transform: translateY(-5px); border-color: #4CAF50; }
.popular-image { width: 100px; height: 100px; object-fit: cover; border-radius: 15px; flex-shrink: 0; }

.card-content h4 { font-size: 18px; }
.card-content p { color: #aaa; font-size: 13px; margin-bottom: 10px; }
.card-content button {
    background: #4CAF50; color: white; border: none; padding: 8px 15px; border-radius: 8px; font-weight: bold; cursor: pointer;
}

.grid-others {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 15px;
    margin-top: 20px;
}

.card-small {
    background: #262626; border-radius: 12px; overflow: hidden; border: 1px solid #333; transition: 0.3s; cursor: pointer;
}
.card-small:hover { border-color: #4CAF50; transform: translateY(-3px); }
.small-game-image { width: 100%; aspect-ratio: 1/1; object-fit: cover; display: block; }

/* --- GRID NOMINAL PULSA (PERBAIKAN MOBILE) --- */
.grid-nominal {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 3 kolom di PC */
    gap: 10px;
    margin-top: 15px;
}

.card-pulsa {
    background: #333;
    padding: 15px 5px;
    border-radius: 10px;
    text-align: center;
    cursor: pointer;
    border: 2px solid #444;
    color: white;
    transition: 0.3s;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.card-pulsa span {
    font-size: 11px;
    opacity: 0.7;
    margin-bottom: 4px;
}

.card-pulsa strong {
    font-size: 14px;
}

.card-pulsa.active {
    border-color: #4CAF50;
    background: #2e4d2e;
}

/* Sembunyikan produk tambahan */
#daftar-harga-container .card-pulsa:nth-child(n+31) {
    display: none;
}
#daftar-harga-container.show-all .card-pulsa {
    display: flex;
}

/* --- MODAL ADMIN --- */
.modal-admin {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.85);
    backdrop-filter: blur(5px);
}

.modal-content-admin {
    background: #222;
    margin: 15% auto;
    padding: 30px;
    width: 90%;
    max-width: 400px;
    border-radius: 20px; /* Lebih membulat halus */
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

/* Group Input Modern */
.input-group-modern {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 25px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.icon-input {
    position: absolute;
    left: 15px;
    color: #4CAF50;
}

.input-wrapper input {
    width: 100%;
    padding: 15px 45px; /* Lebih besar untuk mobile */
    background: #333;
    border: 1px solid #444;
    border-radius: 12px; /* Melengkung halus */
    color: white;
    font-size: 16px; /* Mencegah auto-zoom di iPhone */
    outline: none;
    transition: 0.3s;
}

.input-wrapper input:focus {
    border-color: #4CAF50;
    background: #3a3a3a;
}

/* Icon Mata */
.toggle-password {
    position: absolute;
    right: 15px;
    color: #888;
    cursor: pointer;
    padding: 5px;
}

/* Tombol */
.modal-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn-login-modern {
    background: #4CAF50;
    color: white;
    border: none;
    padding: 15px;
    border-radius: 12px;
    font-weight: bold;
    font-size: 16px;
    cursor: pointer;
    transition: 0.3s;
}

.btn-login-modern:active {
    transform: scale(0.98);
}

.btn-batal-modern {
    background: transparent;
    color: #ff4d4d;
    border: none;
    padding: 10px;
    font-size: 14px;
    cursor: pointer;
}


/* --- MEDIA QUERIES (MOBILE) --- */
@media (max-width: 768px) {
    .grid-popular { grid-template-columns: 1fr; }
    .grid-others { grid-template-columns: repeat(3, 1fr); }
    .grid-nominal { grid-template-columns: repeat(2, 1fr); } /* 2 Kolom di HP agar rapi */
    
    .search-container { margin: 0 10px; }
    .popular-image { width: 80px; height: 80px; }
}

.hidden-game { display: none; }

/* Container Utama Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px); /* Efek blur di belakang pop-up */
}

/* Kotak Pop-up Profesional */
.modal-content {
    background-color: #ffffff;
    margin: 15% auto;
    padding: 0;
    border-radius: 16px;
    width: 90%;
    max-width: 400px; /* Ukuran pas untuk Mobile & Desktop */
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    overflow: hidden;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from { transform: translateY(-20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Header Pop-up */
.modal-header {
    background-color: #f8f9fa;
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 18px;
    color: #333;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Isi Detail Transaksi */
.modal-body {
    padding: 20px;
    color: #444;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 15px;
}

.detail-row span:first-child { color: #888; }
.detail-row span:last-child { font-weight: 600; color: #222; }

/* Status Area */
.modal-footer {
    background-color: #fdfdfd;
    padding: 20px;
    text-align: center;
    border-top: 1px solid #eee;
}

#resStatus {
    font-size: 20px;
    font-weight: 700;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

/* ANIMASI TITIK-TITIK (Loading) */
.loading-dots::after {
    content: '';
    animation: dots 1.5s infinite;
}

@keyframes dots {
    0% { content: '.'; }
    33% { content: '..'; }
    66% { content: '...'; }
}

/* ANIMASI CENTANG SUKSES */
.checkmark-circle {
    width: 24px;
    height: 24px;
    background: #4CAF50;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    animation: scaleUp 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes scaleUp {
    from { transform: scale(0); }
    to { transform: scale(1); }
}

.close-btn {
    cursor: pointer;
    font-size: 24px;
    color: #aaa;
    transition: 0.2s;
}

.close-btn:hover { color: #f44336; }

.sidebar {
    display: flex;
    flex-direction: column;
}

.sidebar ul {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Dorong menu admin ke bawah */
.admin-login {
    margin-top: auto;
}

/* Warna merah saat logout */
.admin-login.logout-mode {
    background-color: #a82222;
}

.admin-login.logout-mode a {
    color: white;
}
#admin-action,
#admin-action-pln {
    text-align: center;
}

#admin-action button,
#admin-action-pln button {
    width: 100%;
    max-width: 300px;
}
/* BOX SALDO */

.saldo-box {
    background: #1f2b1f;
    color: #4CAF50;
    font-weight: bold;
    padding: 16px 20px;
    font-size: 18px;
}

/* AREA LOGOUT */
.logout-box {
    background-color: #8b1e1e;
}

/* TOMBOL LOGOUT */
.logout-box a {
    padding: 10px 20px !important;
    font-size: 15px;
    font-weight: bold;
}
.saldo-box {
    text-align: center;
    letter-spacing: 0.5px;
}

.logout-box a {
    text-align: center;
}
.sidebar-bottom {
    margin-top: auto;
}

.btn-paket {
    background: #333;
    color: white;
    border: 1px solid #4CAF50;
    border-radius: 10px;
    padding: 10px 16px;
    cursor: pointer;
    margin-right: 8px;
    margin-bottom: 8px;
}

.btn-paket:hover {
    background: #4CAF50;
}

.active-paket {
    background: #4CAF50 !important;
    border-color: #4CAF50 !important;
    color: white !important;
}

#paket-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}