/* Reset Basic */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body {
    background-color: #121212;
    color: #fff;
    overflow-x: hidden;
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #1e1e24; }
::-webkit-scrollbar-thumb { background: #f15a24; border-radius: 3px; }

/* --- LOADING SCREEN --- */
#loading-screen {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100vh;
    background-color: #0b0b0d;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease;
}
.loader-content { text-align: center; }
.loader-gif { width: 130px; height: auto; }
#loading-screen.hide { opacity: 0; visibility: hidden; }

/* --- HEADER --- */
.header-glass {
    position: sticky;
    top: 0; width: 100%;
    z-index: 100;
    background-color: rgba(18, 18, 18, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.header-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
}
.logo {
    font-size: 22px;
    font-weight: 800;
    color: #fff;
    letter-spacing: 1px;
    text-decoration: none;
}
.nav-menu { display: flex; gap: 25px; }
.nav-item {
    text-decoration: none;
    color: #aaa;
    font-size: 14px;
    font-weight: 600;
    transition: 0.3s;
    position: relative;
    padding: 5px 0;
}
.nav-item:hover, .nav-item.active { color: #fff; }
.nav-item.active::after {
    content: '';
    position: absolute;
    bottom: -15px; left: 0;
    width: 100%; height: 3px;
    background-color: #f15a24;
    border-radius: 2px;
}
.header-right { display: flex; align-items: center; gap: 15px; }
.search-bar {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid #f15a24;
    border-radius: 8px;
    padding: 6px 12px;
    display: flex;
    align-items: center;
}
.search-bar input {
    background: transparent;
    border: none;
    color: #fff;
    padding-left: 10px;
    outline: none;
    font-size: 13px;
    width: 160px;
}
.settings-btn {
    background: #f15a24;
    border: none;
    border-radius: 8px;
    padding: 8px;
    cursor: pointer;
}
.google-sign-in {
    background: #1e1e1e;
    border: 1px solid #333;
    color: #fff;
    padding: 8px 15px;
    border-radius: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    cursor: pointer;
    font-weight: 500;
    text-decoration: none;
}
.google-sign-in img { width: 18px; }

/* User avatar di header */
.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}
.user-avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    border: 2px solid #f15a24;
    object-fit: cover;
}
.user-name { font-size: 13px; font-weight: 600; }
.logout-btn {
    background: #2a2a2f;
    border: none;
    color: #ccc;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 12px;
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
    transition: background 0.2s;
}
.logout-btn:hover { background: #3f3f46; color: #fff; }

/* --- MAIN CONTENT --- */
.main-content { width: 100%; padding: 30px 20px; }
.content-container { max-width: 1200px; margin: 0 auto; }

/* TRENDING */
.section-title { margin-bottom: 20px; }
.section-title h2 { font-size: 18px; font-weight: 700; margin-bottom: 5px; }
.section-title p { font-size: 13px; color: #888; }
.trending-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
}
.trend-card {
    background: linear-gradient(90deg, #1e1e24 0%, #151518 100%);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 12px;
    display: flex;
    align-items: center;
    padding: 12px;
    gap: 15px;
    cursor: pointer;
    transition: transform 0.2s ease, border 0.2s ease;
}
.trend-card:hover { transform: translateY(-3px); border: 1px solid #555; }
.trend-icon { width: 50px; height: 50px; border-radius: 10px; object-fit: cover; }
.trend-info h4 { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.trend-info p { font-size: 12px; color: #888; }

/* FILTER */
.filter-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 35px 0 25px 0;
}
.filter-btn {
    background-color: #2a2a2f;
    color: #ccc;
    border: none;
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: 'Poppins', sans-serif;
}
.filter-btn:hover { background-color: #3f3f46; color: #fff; }
.filter-btn.active { background-color: #f15a24; color: #fff; }

/* GAME GRID */
.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 20px;
}
.game-card {
    background-color: #1e1e24;
    border-radius: 16px;
    padding: 10px 10px 20px 10px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s ease;
}
.game-card:hover { transform: scale(1.05); }
.game-img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    border-radius: 12px;
    margin-bottom: 12px;
    background: #2a2a2f;
    padding: 8px;
}
.game-title { font-size: 13px; font-weight: 500; color: #fff; padding: 0 5px; }

/* --- TOMBOL UMUM --- */
.btn-orange {
    background: #f15a24;
    color: #fff;
    border: none;
    padding: 11px 20px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
    transition: opacity 0.2s;
    width: 100%;
}
.btn-orange:hover { opacity: 0.85; }
.btn-ghost {
    background: #2a2a2f;
    color: #ccc;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
    transition: background 0.2s;
}
.btn-ghost:hover { background: #3f3f46; color: #fff; }

/* --- FORM INPUT --- */
.form-group { margin-bottom: 18px; }
.form-group label { font-size: 13px; color: #aaa; display: block; margin-bottom: 8px; }
.form-group input,
.form-group select {
    width: 100%;
    padding: 11px 14px;
    border-radius: 8px;
    background: #2a2a2f;
    border: 1px solid #333;
    color: #fff;
    font-size: 13px;
    font-family: 'Poppins', sans-serif;
    outline: none;
    transition: border 0.2s;
}
.form-group input:focus,
.form-group select:focus { border-color: #f15a24; }

/* --- SECTION TESTIMONI --- */
.testimoni-section { margin-top: 45px; }

.testimoni-locked {
    background: #1e1e24;
    border: 1px dashed #333;
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    margin-bottom: 20px;
}
.testimoni-locked p { font-size: 13px; color: #888; }

.testimoni-form {
    background: #1e1e24;
    border-radius: 14px;
    padding: 18px;
    margin-bottom: 20px;
}
.testimoni-form-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}
.testimoni-form textarea {
    width: 100%;
    background: #2a2a2f;
    border: 1px solid #333;
    border-radius: 10px;
    padding: 12px;
    color: #fff;
    font-size: 13px;
    font-family: 'Poppins', sans-serif;
    outline: none;
    resize: vertical;
    margin-bottom: 12px;
    transition: border 0.2s;
}
.testimoni-form textarea:focus { border-color: #f15a24; }
.testimoni-form-footer {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.testimoni-form-footer select {
    background: #2a2a2f;
    border: 1px solid #333;
    color: #fff;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-family: 'Poppins', sans-serif;
    outline: none;
}

.testimoni-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}
.testimoni-card {
    background: #1e1e24;
    border-radius: 14px;
    padding: 16px;
}
.testimoni-card-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}
.testimoni-rating { font-size: 11px; margin-top: 2px; }
.testimoni-message { font-size: 13px; color: #ccc; line-height: 1.5; }
.badge-options {
    display: inline-block;
    margin-top: 8px;
    background: rgba(241, 90, 36, 0.15);
    color: #f15a24;
    font-size: 10px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
}

/* --- MODAL PRODUK --- */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}
.modal-overlay.show {
    display: flex;
    animation: fadeInOverlay 0.2s ease;
}
@keyframes fadeInOverlay {
    from { opacity: 0; }
    to { opacity: 1; }
}
.modal-box {
    background: #1e1e24;
    border-radius: 18px;
    padding: 28px;
    width: 100%;
    max-width: 380px;
    position: relative;
    animation: popIn 0.25s ease;
}
@keyframes popIn {
    from { transform: scale(0.92); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}
.modal-close {
    position: absolute;
    top: 14px; right: 14px;
    background: #2a2a2f;
    border: none;
    color: #ccc;
    width: 28px; height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.2s;
}
.modal-close:hover { background: #3f3f46; color: #fff; }
.modal-header { text-align: center; margin-bottom: 20px; }
.modal-header img {
    width: 90px; height: 90px;
    object-fit: contain;
    border-radius: 14px;
    background: #2a2a2f;
    padding: 12px;
    margin-bottom: 14px;
}
.modal-header h3 { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.modal-header p { font-size: 12px; color: #888; }

/* Preview foto profil yang lebih besar & bulat di modal edit profil */
#profilePreviewImg {
    width: 90px; height: 90px;
}

/* Daftar opsi/varian di dalam modal */
.modal-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 280px;
    overflow-y: auto;
}
.option-row {
    background: #2a2a2f;
    border-radius: 10px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.option-label { font-size: 13px; font-weight: 600; color: #fff; }

/* Tombol Order via Discord */
.discord-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #5865F2;
    color: #fff;
    text-decoration: none;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    transition: opacity 0.2s;
    width: 100%;
}
.discord-btn:hover { opacity: 0.85; }
.discord-btn-sm {
    width: auto;
    padding: 8px 12px;
    font-size: 11px;
    flex-shrink: 0;
    white-space: nowrap;
}

/* --- HISTORY PAGE --- */
.page-wrapper { max-width: 900px; margin: 0 auto; padding: 35px 20px; }
.page-title { font-size: 20px; font-weight: 700; margin-bottom: 24px; }
.history-card {
    background: #1e1e24;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 16px;
}
.history-img {
    width: 55px; height: 55px;
    border-radius: 10px;
    object-fit: contain;
    background: #2a2a2f;
    padding: 6px;
    flex-shrink: 0;
}
.history-info { flex: 1; }
.history-info h4 { font-size: 14px; font-weight: 600; margin-bottom: 3px; }
.history-info p { font-size: 11px; color: #888; }
.history-right { text-align: right; }
.history-price { font-weight: 700; color: #f15a24; margin-bottom: 6px; font-size: 14px; }
.badge {
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}
.badge-paid { background: #22c55e22; color: #22c55e; }
.badge-pending { background: #f59e0b22; color: #f59e0b; }
.badge-failed { background: #ef444422; color: #ef4444; }

/* --- CART PAGE --- */
.cart-card {
    background: #1e1e24;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 16px;
}
.cart-img {
    width: 60px; height: 60px;
    border-radius: 10px;
    object-fit: contain;
    background: #2a2a2f;
    padding: 6px;
    flex-shrink: 0;
}
.cart-info { flex: 1; }
.cart-info h4 { font-size: 14px; font-weight: 600; margin-bottom: 3px; }
.cart-info p { font-size: 12px; color: #888; }
.cart-total-box {
    background: #1e1e24;
    border-radius: 12px;
    padding: 20px;
    margin-top: 20px;
}
.cart-total-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.cart-total-label { font-size: 15px; font-weight: 600; }
.cart-total-price { font-size: 18px; font-weight: 700; color: #f15a24; }

/* --- RESELLER PANEL --- */
.reseller-layout { display: flex; min-height: calc(100vh - 60px); }
.reseller-sidebar {
    width: 220px;
    background: #151518;
    padding: 24px 16px;
    border-right: 1px solid rgba(255,255,255,0.05);
    flex-shrink: 0;
}
.sidebar-label { font-size: 11px; color: #555; font-weight: 600; margin-bottom: 16px; letter-spacing: 1px; }
.sidebar-link {
    display: block;
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 6px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    color: #aaa;
    transition: all 0.2s;
}
.sidebar-link:hover { background: #2a2a2f; color: #fff; }
.sidebar-link.active { background: #f15a24; color: #fff; }
.sidebar-balance { margin-top: 40px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,0.05); }
.sidebar-balance p:first-child { font-size: 12px; color: #888; margin-bottom: 4px; }
.sidebar-balance p:last-child { font-size: 18px; font-weight: 700; color: #f15a24; }
.reseller-content { flex: 1; padding: 30px 28px; overflow-y: auto; }

/* Stat cards reseller */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; margin-bottom: 32px; }
.stat-card { background: #1e1e24; border-radius: 14px; padding: 20px; }
.stat-icon { font-size: 24px; margin-bottom: 8px; }
.stat-label { font-size: 12px; color: #888; margin-bottom: 4px; }
.stat-value { font-size: 20px; font-weight: 700; color: #f15a24; }

/* Produk grid reseller */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.product-manage-card { background: #1e1e24; border-radius: 14px; padding: 18px; }
.product-manage-header { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; }
.product-manage-img { width: 48px; height: 48px; border-radius: 10px; object-fit: contain; background: #2a2a2f; padding: 6px; }

/* Mutasi keuntungan */
.mutasi-card {
    background: #1e1e24;
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.mutasi-info h4 { font-size: 13px; font-weight: 600; margin-bottom: 2px; }
.mutasi-info p { font-size: 11px; color: #888; }
.mutasi-amount { color: #22c55e; font-weight: 700; }

/* --- LOGIN PAGE --- */
.login-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 80vh;
    padding: 20px;
}
.login-card {
    background: #1e1e24;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    width: 100%;
    max-width: 380px;
}
.login-logo { font-size: 28px; font-weight: 800; margin-bottom: 8px; }
.login-sub { font-size: 13px; color: #888; margin-bottom: 30px; }
.google-btn {
    background: #fff;
    color: #333;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    margin: 0 auto;
    font-family: 'Poppins', sans-serif;
    transition: opacity 0.2s;
    text-decoration: none;
}
.google-btn:hover { opacity: 0.9; }
