/* File: assets/css/style.css */

/* CSS VARIABLES UNTUK DARK MODE & LIGHT MODE (DIPERTAJAM) */
:root {
    --bg-body: #f4f7f6;
    --bg-card: #ffffff;
    --bg-input: #f8f9fa;
    --text-main: #111111; /* Hitam pekat biar tajam */
    --text-muted: #555555; /* Abu-abu gelap (tidak transparan) */
    --border-color: #d1d8dd;
    --primary: #3498db;
    --header-gradient: linear-gradient(135deg, #3498db, #2980b9);
}

[data-theme="dark"] {
    --bg-body: #121212;
    --bg-card: #1e1e1e;
    --bg-input: #2d2d2d;
    --text-main: #ffffff; /* Putih terang benderang */
    --text-muted: #cccccc; /* Abu-abu terang */
    --border-color: #3d3d3d;
    --primary: #0984e3;
    --header-gradient: linear-gradient(135deg, #1e272e, #2f3640);
}

/* Style Mata (Hide Balance) */
.eye-icon {
    cursor: pointer;
    font-size: 16px;
    margin-left: 8px;
    color: var(--text-muted);
    transition: color 0.3s ease;
}

.eye-icon:hover {
    color: var(--primary);
}

.balance-hidden {
    filter: blur(5px);
    user-select: none;
    transition: filter 0.3s ease;
}

/* GLOBAL STYLES */
body {
    background-color: var(--bg-body);
    color: var(--text-main);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    transition: background-color 0.3s, color 0.3s;
}

/* NAVBAR HEADER */
.navbar {
    background: var(--header-gradient);
    padding: 15px 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.brand {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: 1px;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-menu span {
    font-weight: 600;
    font-size: 15px;
}

/* BUTTONS */
.nav-btn {
    background: rgba(255,255,255,0.2);
    color: white;
    text-decoration: none;
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: bold;
    transition: 0.3s;
    border: 1px solid rgba(255,255,255,0.3);
}

.nav-btn:hover {
    background: white;
    color: var(--primary);
}

.btn {
    padding: 10px 15px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    color: white;
    transition: 0.2s;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary { background: var(--primary); }
.btn-primary:hover { background: #2980b9; }

.btn-success { background: #2ecc71; }
.btn-success:hover { background: #27ae60; }

.btn-danger { background: #e74c3c; }
.btn-danger:hover { background: #c0392b; }

.btn-warning { background: #f1c40f; color: #333; }
.btn-warning:hover { background: #f39c12; }

/* LAYOUT GRID */
.container {
    padding: 30px 5%;
    max-width: 1200px;
    margin: 0 auto;
}

.dash-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
}

/* CARDS */
.card {
    background: var(--bg-card);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    overflow: hidden;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
    transition: background 0.3s, border-color 0.3s;
}

.card-header {
    background: var(--bg-input);
    padding: 15px 20px;
    font-weight: 700;
    font-size: 16px;
    border-bottom: 1px solid var(--border-color);
    color: var(--primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-content {
    padding: 20px;
}

/* BALANCE CARD KHUSUS */
.balance-card {
    background: linear-gradient(135deg, #2c3e50, #34495e);
    color: white;
    padding: 25px;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.balance-card .amount {
    font-size: 32px;
    font-weight: 900;
    margin-top: 5px;
}

/* INPUT FORMS */
.input-group {
    margin-bottom: 15px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-main);
}

.search-box {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    box-sizing: border-box;
    background: var(--bg-input);
    color: var(--text-main);
    transition: border-color 0.3s;
}

.search-box:focus {
    outline: none;
    border-color: var(--primary);
}

/* DROPDOWN CUSTOM */
.dropdown {
    position: relative;
}

.dropdown-header {
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-input);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 500;
}

.dropdown-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-top: 5px;
    max-height: 250px;
    overflow-y: auto;
    z-index: 10;
    display: none;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.dropdown-list.show {
    display: block;
}

.dropdown-search {
    padding: 10px;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    background: var(--bg-card);
}

.dropdown-item {
    padding: 10px 15px;
    cursor: pointer;
    border-bottom: 1px solid var(--bg-input);
    font-size: 14px;
    color: var(--text-main);
}

.dropdown-item:hover {
    background: var(--primary);
    color: white;
}

/* TABLES (Dipercantik biar tajam) */
.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    white-space: nowrap;
}

table th, table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
}

table th {
    background: var(--bg-input);
    font-weight: 700;
    color: var(--text-main); /* Biar tebal dan hitam di light mode */
}

/* STATUS BADGES */
.status {
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
}

.status.pending { background: rgba(241, 196, 15, 0.2); color: #f39c12; }
.status.processing { background: rgba(52, 152, 219, 0.2); color: #2980b9; }
.status.success { background: rgba(46, 204, 113, 0.2); color: #27ae60; }
.status.error { background: rgba(231, 76, 60, 0.2); color: #c0392b; }

/* MODAL / POPUP */
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6);
    z-index: 999;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(3px);
}

.modal-box {
    background: var(--bg-card);
    width: 450px;
    max-width: 90%;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from { transform: translateY(-30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* AUTHENTICATION PAGES (Login/Register) */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-body);
}

.auth-box {
    background: var(--bg-card);
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    width: 100%;
    max-width: 400px;
    border: 1px solid var(--border-color);
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-header img {
    height: 60px;
    margin-bottom: 15px;
}

.auth-header h2 {
    color: var(--primary);
    margin: 0;
}

.auth-links {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
}

.auth-links a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

/* INFO BOX */
.info-box {
    background: rgba(52, 152, 219, 0.1);
    border-left: 4px solid var(--primary);
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 0 8px 8px 0;
    font-size: 14px;
    line-height: 1.6;
}

.price-display {
    font-size: 28px;
    font-weight: 800;
    color: #2ecc71;
}

/* =========================================================
   MEDIA QUERIES (RESPONSIVE)
   ========================================================= */
@media (max-width: 992px) {
    .dash-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .balance-card { flex-direction: column; align-items: flex-start; gap: 15px; }
    .nav-btn { padding: 10px 15px; font-size: 13px; }
    .card-content { padding: 15px; }
    
    /* Perbaikan Header/Navbar User di Mobile (index.php) */
    .navbar, header, .top-bar {
        flex-direction: column !important;
        align-items: flex-start !important;
        height: auto !important;
        padding: 15px !important;
    }

    .nav-buttons, .user-menu, .header-right {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 8px !important;
        width: 100% !important;
        margin-top: 15px !important;
        justify-content: flex-start !important;
    }

    .nav-buttons a, .user-menu a, .header-right .btn {
        flex: 1 !important;
        text-align: center !important;
        font-size: 12px !important;
        padding: 8px 10px !important;
        white-space: nowrap !important;
    }
    
    .username-text {
        display: none !important; 
    }
}

/* =========================================================
   STYLE TAMBAHAN HALAMAN TOPUP V2
   ========================================================= */
.btn-nominal { 
    background: var(--bg-card); 
    color: var(--text-main); 
    border: 2px solid var(--border-color); 
    font-size: 13px; 
    padding: 10px; 
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: 0.2s;
}

.btn-nominal:hover { 
    border-color: var(--primary); 
    color: var(--primary); 
    background: rgba(52, 152, 219, 0.1); 
}

/* =========================================================
   TAMPILAN LOGO METODE PEMBAYARAN TRIPAY            
   ========================================================= */
.payment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
    margin-top: 5px;
}
.payment-method-card {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    background: var(--bg-input);
    transition: 0.2s;
}
.payment-method-card:hover {
    border-color: var(--primary);
}
.payment-method-card input[type="radio"] {
    display: none; /* Sembunyikan bulatan radio aslinya */
}
/* Efek saat diklik / dipilih */
.payment-method-card:has(input[type="radio"]:checked) {
    border: 2px solid var(--primary);
    background: rgba(52, 152, 219, 0.1);
}
.payment-method-card img {
    height: 25px;
    width: auto;
    object-fit: contain;
}
.payment-method-card span {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
}