/* ===========================================================
   STYLES.CSS - TOTOWIN88 (THEME: BLACK & GOLD #FED804)
   FIXED LAYOUT VERSION
   =========================================================== */

:root {
    /* Color Palette */
    --bg-body: #000000;
    --bg-card: #0a0a0a;
    --bg-element: #151515;
    --gold: #fed804;
    --gold-hover: #ffea00;
    --gold-dark: #b8860b;
    --text-white: #ffffff;
    --text-gray: #888888;
    
    /* Status Colors */
    --red-alert: #ff0000;
    --green-ok: #00ff00;

    /* Layout Dimensions */
    --h-topbar: 36px;
    --h-header: 74px;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Roboto', sans-serif; -webkit-tap-highlight-color: transparent; }

/* 1. BODY PADDING (Agar konten tidak tertutup header yang melayang) */
body { 
    background-color: var(--bg-body); 
    color: var(--text-white); 
    font-size: 13px; 
    overflow-x: hidden; 
    /* Total tinggi = Topbar + Header + Sedikit spasi */
    padding-top: calc(var(--h-topbar) + var(--h-header) + 10px); 
}

.container { max-width: 1200px; margin: 0 auto; padding: 0 10px; position: relative; }

/* --- SCROLLBAR --- */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #000; }
::-webkit-scrollbar-thumb { background: var(--gold); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold-hover); }

/* =========================================
   HEADER SECTION (DESKTOP FIXED)
   ========================================= */

/* 1. TOP BAR (Paling Atas) */
.top-bar { 
    background: #050505; 
    border-bottom: 1px solid #222; 
    height: var(--h-topbar);
    font-size: 11px; 
    
    /* LOGIKA FIXED */
    position: fixed; 
    top: 0; 
    left: 0;
    width: 100%;
    z-index: 1002; /* Layer paling atas */
    
    display: flex;
    align-items: center;
}

.top-bar-content { width: 100%; display: flex; justify-content: space-between; align-items: center; }
.top-left a { color: var(--text-gray); margin-right: 10px; font-weight: bold; text-decoration: none; transition: 0.3s; }
.top-left a:hover { color: var(--gold); }
.server-time { color: var(--gold); font-weight: bold; }
.wa-button { background: #25d366; color: #fff; padding: 3px 12px; border-radius: 20px; font-weight: bold; text-decoration: none; }

/* 2. MAIN HEADER (Di Bawah Top Bar) */
.main-header { 
    background: #000; 
    border-bottom: 2px solid var(--gold); 
    height: var(--h-header);
    
    /* LOGIKA FIXED */
    position: fixed; 
    top: var(--h-topbar); /* Menempel tepat di bawah Top Bar */
    left: 0;
    width: 100%;
    z-index: 1001; 
    box-shadow: 0 4px 15px rgba(254, 216, 4, 0.15); 
    
    display: flex;
    align-items: center;
}

.header-content { width: 100%; display: flex; justify-content: space-between; align-items: center; }

/* MENU NAVIGASI */
.nav-menu { display: flex; gap: 20px; align-items: center; }
.nav-menu a { color: #ccc; font-size: 13px; font-weight: 700; text-transform: uppercase; padding-bottom: 5px; border-bottom: 2px solid transparent; transition: 0.3s; text-decoration: none; white-space: nowrap; }
.nav-menu a:hover, .nav-menu a.active { color: var(--gold); border-bottom-color: var(--gold); }
.nav-menu a.highlight { background: var(--gold); color: #000; padding: 6px 15px; border-radius: 4px; border: none; font-weight: 900; box-shadow: 0 0 10px rgba(254, 216, 4, 0.4); }

/* DROPDOWN */
.dropdown { position: relative; display: inline-block; }
.dropbtn { color: #ccc; font-weight: bold; font-size: 13px; cursor: pointer; display: flex; gap: 5px; align-items: center; }
.dropdown:hover .dropbtn { color: var(--gold); }
.dropdown-content { display: none; position: absolute; top: 100%; left: 0; background: #111; min-width: 200px; border: 1px solid var(--gold-dark); border-top: 3px solid var(--gold); z-index: 9999; }
.dropdown-content a { color: #ccc; padding: 12px 16px; border-bottom: 1px solid #222; display: block; }
.dropdown-content a:hover { background: #222; color: var(--gold); padding-left: 18px; }
.dropdown:hover .dropdown-content { display: block; animation: fadeIn 0.3s; }

/* =========================================
   HERO & CONTENT
   ========================================= */
/* Container Utama */
.slider-container { 
    position: relative; 
    margin: 0 auto 15px auto; 
    width: 80%; 
    /* HAPUS aspect-ratio: 16/9; */
    overflow: hidden; 
    border-radius: 8px; 
    border: 1px solid var(--gold-dark); 
    box-shadow: 0 0 15px rgba(254, 216, 4, 0.1); 
    margin-bottom: 15px; 
    background: #000; 
    
    /* TAMBAHAN: Agar border bergerak halus saat ukuran berubah */
    transition: height 0.3s ease-in-out; 
}

/* Track Slider */
.slider-track { 
    display: flex; 
    transition: transform 0.5s ease-in-out; 
    /* TAMBAHAN: Align start agar slide tidak dipaksa sama tinggi */
    align-items: flex-start; 
}

/* Slide Individual */
.slide { 
    min-width: 100%; 
    /* Hapus height 100% agar mengikuti konten gambar */
    position: relative;
}

/* Gambar */
.slide img { 
    width: 100%; 
    height: auto; /* Biarkan tinggi otomatis sesuai rasio gambar */
    display: block; 
}

.quick-buttons { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 15px; }
.btn-quick { background: linear-gradient(180deg, #1a1a1a, #000); border: 1px solid #333; color: var(--gold); text-align: center; padding: 12px; border-radius: 6px; font-weight: bold; font-size: 12px; display: flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; transition: 0.3s; }
.btn-quick:hover { border-color: var(--gold); box-shadow: 0 0 10px rgba(254, 216, 4, 0.3); color: #fff; transform: translateY(-2px); }

.main-content { min-height: 600px; padding-bottom: 50px; }
.section-title { text-align: center; color: #fff; margin: 30px 0 20px; font-size: 24px; text-transform: uppercase; font-weight: 900; letter-spacing: 1px; }
.section-title span { color: var(--gold); }

/* FILTER & CARDS */
.filter-bar { background: var(--bg-element); border: 1px solid var(--gold-dark); padding: 12px 20px; border-radius: 50px; display: flex; justify-content: space-between; align-items: center; margin-bottom: 25px; max-width: 600px; margin: 0 auto 25px; transition: 0.3s; }
.filter-bar input { background: transparent; border: none; color: var(--gold); width: 100%; outline: none; font-weight: bold; text-transform: uppercase; font-size: 14px; }
.filter-bar input::placeholder { color: #555; }
.filter-bar i { color: var(--gold); }
.filter-bar:focus-within { border-color: var(--gold); box-shadow: 0 0 15px rgba(254, 216, 4, 0.2); }

.prediksi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 20px; }

.card {
    background: var(--bg-card);
    border: 1px solid var(--gold-dark);
    border-radius: 8px;
    padding: 12px;
    display: flex; flex-direction: column; gap: 8px;
    box-shadow: 0 0 15px rgba(0,0,0,0.8);
    transition: transform 0.3s;
}
.card:hover { transform: translateY(-5px); border-color: var(--gold); box-shadow: 0 0 20px rgba(254, 216, 4, 0.1); }

.card-header {
    background: var(--bg-element);
    border: 1px solid var(--gold-dark);
    border-radius: 6px;
    padding: 10px 12px;
    display: flex; justify-content: space-between; align-items: center;
    cursor: pointer;
}
.market-name { display: flex; align-items: center; gap: 10px; font-weight: 900; color: var(--gold); font-size: 14px; text-transform: uppercase; letter-spacing: 0.5px; }
.market-icon-img { width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--gold); }

.date-row {
    background: var(--bg-element);
    border: 1px solid #333;
    border-radius: 6px;
    padding: 8px;
    text-align: center;
    font-size: 12px; font-weight: bold; color: #ddd;
    border-left: 3px solid var(--gold);
}

.split-info { display: grid; grid-template-columns: 100px 1fr; gap: 8px; }
.col-time { display: flex; flex-direction: column; gap: 8px; height: 100%; }
.time-box {
    background: var(--bg-element); border: 1px solid #333; border-radius: 6px;
    padding: 10px 5px; text-align: center; height: 100%;
    display: flex; flex-direction: column; justify-content: center;
}
.time-box .lbl { font-size: 10px; color: var(--gold-dark); font-weight: bold; margin-bottom: 4px; }
.time-box .val { font-size: 12px; color: #fff; font-weight: bold; }

.col-stats { display: flex; flex-direction: column; gap: 5px; }
.stat-row { display: grid; grid-template-columns: 70px 1fr; gap: 6px; }
.stat-box {
    background: var(--bg-element); border: 1px solid var(--gold-dark); border-radius: 4px;
    padding: 6px; text-align: center; font-size: 12px; font-weight: bold;
    display: flex; align-items: center; justify-content: center;
}
.stat-lbl { color: #000; background: var(--gold); border: none; font-weight: 900; } 
.stat-val { color: #fff; letter-spacing: 1px; }

.grid-section { margin-top: 5px; }
.grid-head {
    text-align: center; color: var(--gold); font-size: 11px; font-weight: bold;
    padding: 4px; border-bottom: 1px solid var(--gold-dark); margin-bottom: 6px; letter-spacing: 1px;
}
.g-4d { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.g-3d { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.g-2d { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }

.num-box {
    background: var(--bg-element); border: 1px solid #333; border-radius: 4px;
    padding: 8px 0; text-align: center; color: #fff;
    font-weight: bold; font-size: 13px; cursor: pointer; transition: 0.2s;
}
.num-box:hover { background: var(--gold); color: #000; border-color: var(--gold); box-shadow: 0 0 10px var(--gold); font-weight: 900; }
.card-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 5px; }

/* LIVE DRAW */
.live-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(350px, 1fr)); gap: 20px; }
.live-card { background: #111; border: 1px solid #333; border-radius: 10px; overflow: hidden; transition: 0.3s; position: relative; }
.live-card:hover { border-color: var(--gold); transform: translateY(-5px); }
.live-head { background: #1a1a1a; padding: 12px 15px; border-bottom: 1px solid #333; display: flex; justify-content: space-between; align-items: center; }
.live-title { font-weight: 900; color: #fff; display: flex; align-items: center; gap: 10px; }
.live-status { font-size: 10px; font-weight: bold; padding: 4px 8px; border-radius: 4px; }
.status-open { background: var(--green-ok); color: #000; }
.status-close { background: var(--red-alert); color: #fff; animation: blink 1.5s infinite; }
.live-body { padding: 20px; text-align: center; background: #000; }
.timer-display { font-family: monospace; font-size: 26px; font-weight: bold; color: var(--gold); background: #111; padding: 10px; border: 1px solid #333; border-radius: 6px; margin-bottom: 15px; letter-spacing: 2px; }
.btn-live { width: 100%; padding: 12px; background: linear-gradient(45deg, #b89f00, #fed804); color: #000; font-weight: 900; border: none; border-radius: 50px; cursor: pointer; transition: 0.3s; }
.btn-live:hover { box-shadow: 0 0 15px var(--gold); }

/* PAITO & TOOLS */
.paito-dashboard { background-color: #0f0f0f; border: 1px solid #333; border-radius: 12px 12px 0 0; padding: 20px; display: flex; flex-direction: column; gap: 15px; }
.pd-row { display: flex; gap: 15px; align-items: flex-end; }
.pd-col { display: flex; flex-direction: column; gap: 6px; }
.col-warna { flex: 2; } .col-pasaran { flex: 1; }
.pd-label { color: var(--gold); font-size: 12px; font-weight: 600; margin-left: 2px; }

.color-picker-group { display: flex; flex-wrap: wrap; gap: 6px; }
.cp-btn { width: 32px; height: 32px; border-radius: 6px; cursor: pointer; border: 2px solid transparent; transition: 0.2s; }
.cp-btn:hover { transform: scale(1.1); box-shadow: 0 0 10px rgba(255,255,255,0.5); }
.cp-btn.active { border-color: #fff; box-shadow: 0 0 0 2px var(--gold); }
.cp-btn.cp-close { background: #222; border: 1px solid #444; display: flex; align-items: center; justify-content: center; color: #888; }

.c-blue { background: #3b82f6 !important; } .c-cyan { background: #06b6d4 !important; } .c-green { background: #22c55e !important; }
.c-orange { background: #f97316 !important; } .c-red { background: #ef4444 !important; } .c-purple { background: #a855f7 !important; }
.c-yellow { background: #eab308 !important; } .c-grey { background: #64748b !important; } .c-pink { background: #ec4899 !important; }
.c-teal { background: #14b8a6 !important; }

.pd-select, .pd-input { background: #1a1a1a; border: 1px solid #333; color: var(--gold); padding: 10px; border-radius: 6px; width: 100%; font-size: 14px; font-weight: bold; outline: none; }
.pd-select:focus, .pd-input:focus { border-color: var(--gold); box-shadow: 0 0 10px rgba(254, 216, 4, 0.2); }
.input-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; flex: 1; }
.pd-btn-reset { background: transparent; border: 1px solid var(--gold); color: var(--gold); padding: 10px 20px; border-radius: 6px; font-weight: bold; cursor: pointer; height: 40px; transition: 0.3s; }
.pd-btn-reset:hover { background: var(--gold); color: #000; }

.paito-wrapper { overflow-x: auto; border: 1px solid #333; border-top: none; border-radius: 0 0 12px 12px; background: #000; }
.table-paito { width: 100%; min-width: 800px; border-collapse: collapse; table-layout: fixed; }
.table-paito th { background: #1a1a1a; color: var(--gold); border: 1px solid #333; padding: 10px; }
.table-paito td { border: 1px solid #333; background: #000; height: 40px; padding: 0; }
.digit-row-matrix { display: grid; width: 100%; height: 100%; }
.p-digit { display: flex; align-items: center; justify-content: center; font-weight: bold; font-size: 14px; cursor: pointer; color: #fff; border-right: 1px solid #333; transition: 0.1s; }
.p-digit:hover { background: #222; }
.p-digit.auto-hl { background-color: var(--gold) !important; color: #000 !important; font-weight: 900 !important; border: 1px solid #fff !important; z-index: 2; position: relative; box-shadow: 0 0 15px var(--gold); }

.tool-box { background: #111; padding: 25px; border-radius: 10px; border: 1px solid #333; max-width: 600px; margin: 0 auto; text-align: center; }
.form-input { width: 100%; padding: 12px; background: #000; border: 1px solid #444; color: var(--gold); font-weight: bold; border-radius: 6px; text-align: center; font-size: 16px; margin-top: 10px; }
.btn-tool { width: 100%; padding: 12px; background: linear-gradient(to bottom, #fed804, #b8860b); color: #000; font-weight: 900; border: none; border-radius: 6px; cursor: pointer; margin-top: 10px; }
.btn-tool:hover { box-shadow: 0 0 15px var(--gold); }

/* UTILS */
.panduan-grid-img { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 15px; }
.guide-card { position: relative; border-radius: 8px; overflow: hidden; cursor: pointer; border: 1px solid #333; transition: 0.3s; }
.guide-card:hover { border-color: var(--gold); transform: scale(1.02); }
.guide-card img { width: 100%; display: block; }
.guide-overlay { position: absolute; bottom: 0; left: 0; width: 100%; background: rgba(0,0,0,0.8); padding: 5px; text-align: center; }
.btn-guide { color: var(--gold); font-size: 10px; font-weight: bold; }

.mimpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 15px; }
.mimpi-card { background: #111; border: 1px solid #333; border-radius: 8px; overflow: hidden; display: flex; flex-direction: column; }
.mimpi-img-box { width: 100%; aspect-ratio: 1/1; background: #fff; padding: 5px; border-bottom: 2px solid var(--gold); }
.mimpi-img-thumb { width: 100%; height: 100%; object-fit: contain; }
.mimpi-body { padding: 10px; text-align: center; }
.mimpi-title { font-weight: bold; font-size: 11px; margin-bottom: 5px; color: #ccc; }
.mimpi-num { font-size: 20px; font-weight: 900; color: var(--gold); }

.jadwal-table { width: 100%; border-collapse: collapse; margin-top: 15px; }
.jadwal-table th, .jadwal-table td { border: 1px solid #333; padding: 12px; text-align: left; }
.jadwal-table th { background: var(--gold); color: #000; font-weight: 900; }
.status-badge { padding: 4px 8px; border-radius: 4px; font-size: 10px; font-weight: bold; background: var(--green-ok); color: #000; }

.modal-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.9); z-index: 9999; justify-content: center; align-items: center; padding: 15px; backdrop-filter: blur(5px); }
.modal-content { background: #000; border: 1px solid var(--gold); border-radius: 10px; width: 100%; max-width: 800px; max-height: 90vh; display: flex; flex-direction: column; }
.modal-header { background: var(--gold); color: #000; padding: 15px; display: flex; justify-content: space-between; align-items: center; font-weight: 900; }
.modal-body { padding: 20px; overflow-y: auto; }
.compare-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.c-card { background: #111; border: 1px solid #333; padding: 15px; border-radius: 8px; }
.c-card.is-curr { border: 1px solid var(--gold); }
.c-head { text-align: center; border-bottom: 1px solid #333; margin-bottom: 10px; padding-bottom: 5px; }
.c-date { display: block; color: #fff; font-weight: bold; font-size: 12px; }
.c-row { display: flex; justify-content: space-between; border-bottom: 1px dashed #333; padding: 5px 0; }
.c-val { color: var(--gold); font-weight: bold; }

/* SGP TOOLS */
.sgp-balls-container { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.balls-group { display: flex; gap: 5px; justify-content: center; flex-wrap: wrap; }
.balls-separator { color: var(--gold); font-size: 18px; margin: 5px 0; }
.ball-input { width: 45px; height: 45px; border-radius: 50%; border: 2px solid #ccc; background: #fff; color: #000; text-align: center; font-weight: 900; font-size: 16px; outline: none; transition: 0.2s; -moz-appearance: textfield; appearance: textfield; }
.ball-input::-webkit-outer-spin-button, .ball-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.ball-input:focus { border-color: var(--gold); box-shadow: 0 0 10px var(--gold); transform: scale(1.1); }
.ball-input.add { background: var(--gold); color: #000; border-color: var(--gold-dark); }
.ball-input::placeholder { color: #ccc; font-size: 10px; font-weight: normal; }
.ball-input.add::placeholder { color: #554400; }

/* ANIMATIONS */
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
@keyframes fadein { from {bottom: 0; opacity: 0;} to {bottom: 30px; opacity: 1;} }
@keyframes fadeout { from {bottom: 30px; opacity: 1;} to {bottom: 0; opacity: 0;} }
.toast { visibility: hidden; min-width: 250px; background-color: #333; color: #fff; text-align: center; border-radius: 4px; padding: 16px; position: fixed; z-index: 9999; left: 50%; transform: translateX(-50%); bottom: 30px; border: 1px solid var(--gold); }
.toast.show { visibility: visible; animation: fadein 0.5s, fadeout 0.5s 2.5s; }
#backToTop { display: none; position: fixed; bottom: 20px; right: 20px; z-index: 99; border: none; background-color: var(--gold); color: #000; cursor: pointer; padding: 12px; border-radius: 50%; box-shadow: 0 0 10px rgba(254, 216, 4, 0.5); font-size: 18px; }

/* =========================================
   MOBILE RESPONSIVE
   ========================================= */
.mobile-top-nav { display: none; }
.tray-btn { display: none; }

@media (max-width: 768px) {
    /* RESET BODY PADDING FOR MOBILE */
    body { padding-top: 105px; }

    .container { padding: 0 15px; }
    .top-bar, .nav-menu { display: none; } /* Hide Desktop Elements */

    /* HEADER MOBILE: Paling Atas */
    .main-header { 
        padding: 0; 
        background: #000; 
        display: block; 
        position: fixed; 
        top: 0; 
        left: 0; 
        width: 100%; 
        height: 57px; 
        z-index: 1003; 
        border-bottom: 2px solid var(--gold);
        box-shadow: none;
    }
    
    .header-content { padding: 5px 0; justify-content: center; }

    /* MENU BUTTON: Di Bawah Header */
    .tray-btn { 
        display: flex; 
        justify-content: space-between; 
        align-items: center; 
        width: 100%; 
        background: #111; 
        color: var(--gold); 
        border: none; 
        border-bottom: 2px solid var(--gold); 
        padding: 12px 20px; 
        font-weight: 900; 
        position: fixed; 
        top: 57px; /* Header Height */
        left: 0; 
        z-index: 1002; 
        cursor: pointer;
        height: 45px;
    }

    /* DROPDOWN MENU: Di Bawah Tombol Menu */
    .mobile-top-nav { 
        display: grid; 
        grid-template-columns: repeat(4, 1fr); 
        gap: 8px; 
        background: #0a0a0a; 
        max-height: 0; 
        overflow: hidden; 
        transition: max-height 0.4s; 
        position: fixed; 
        top: 102px; /* 57 + 45 */
        left: 0; 
        width: 100%; 
        z-index: 1001; 
        padding: 0 10px; 
        border-bottom: 1px solid #333; 
    }
    .mobile-top-nav.open { max-height: 500px; padding: 15px 10px; }

    /* Mobile Utils */
    .mt-item { background: #151515; border: 1px solid #333; color: #aaa; padding: 10px 5px; border-radius: 6px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; font-size: 9px; font-weight: bold; text-align: center; min-height: 60px; text-decoration: none; }
    .mt-item.active { background: #222; border-color: var(--gold); color: #fff; }
    .mt-item.vip { grid-column: span 4; background: linear-gradient(to right, #b8860b, #fed804, #b8860b); color: #000; border: none; flex-direction: row; font-size: 12px; font-weight: 900; height: 45px; }
    
    .prediksi-grid, .live-grid, .compare-grid { grid-template-columns: 1fr; }
    .split-info { grid-template-columns: 90px 1fr; }
    .pd-row.top-row { flex-direction: column; align-items: stretch; }
    .pd-row.bottom-row { flex-direction: column; }
    .g-4d { grid-template-columns: repeat(3, 1fr); }
    .g-3d { grid-template-columns: repeat(4, 1fr); }
    .g-2d { grid-template-columns: repeat(5, 1fr); }
    .num-box { font-size: 12px; padding: 6px 0; }
    
    .ball-input { width: 38px; height: 38px; font-size: 14px; }
    .balls-group { gap: 4px; }
}