/* ==========================================
   THE ULTIMATE LOCKED SIDEBAR (ELITE PURPLE GLOW)
   ========================================== */

.sidebar, 
.sidebar:hover {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    
    /* 🔒 KUNCI MATI DIMENSI 🔒 */
    height: 100vh !important; /* Pas 1 layar */
    width: 280px !important; 
    
    /* 🔒 KUNCI MATI PADDING 🔒 */
    padding: 20px 20px 40px 20px !important; 
    box-sizing: border-box !important; 
    
    background: linear-gradient(180deg, rgba(15, 8, 30, 0.85) 0%, rgba(2, 0, 5, 0.95) 100%) !important; 
    backdrop-filter: blur(24px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(24px) saturate(180%) !important;
    
    /* Border & Outer Glow Ungu Tipis */
    border-right: 1px solid rgba(168, 85, 247, 0.15) !important;
    box-shadow: 4px 0 32px rgba(168, 85, 247, 0.1) !important;
    
    display: flex !important;
    flex-direction: column !important;
    z-index: 9999 !important; 
    white-space: nowrap !important; 
    
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior: contain !important;
    
    transition: none !important; 
    transform: none !important;
}

.sidebar-header {
    /* Padding diatur biar logonya dapet ruang napas yang pas */
    padding: 10px 10px 24px 10px;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(168, 85, 247, 0.15); 
    box-shadow: 0 10px 20px -10px rgba(168, 85, 247, 0.1);
    display: flex;
    align-items: center;
    justify-content: center; /* Gw taruh tengah biar elegan, kalau mau di kiri ganti jadi flex-start */
}


.sidebar-header h2 {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    white-space: normal;
}

/* Styling Gambar Logo Sidebar */
.sidebar-logo-img {
    width: 48px;  /* Digedein karena sendirian */
    height: 48px;
    object-fit: contain;
    filter: drop-shadow(0 0 12px rgba(192, 132, 252, 0.6)); /* Glow Ungu Elite */
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
}

/* Efek Dewa pas diareanya di-hover */
.sidebar-header:hover .sidebar-logo-img {
    transform: scale(1.15) rotate(-5deg);
    filter: drop-shadow(0 0 20px rgba(6, 182, 212, 0.8)); /* Berubah Glow Cyan */
}

.text-white {
    color: #ffffff !important;
}

.logo-gradient {
    background: linear-gradient(135deg, #06b6d4, #c084fc);
    -webkit-background-clip: text !important;
    background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    display: inline-block;
    text-shadow: 0 0 20px rgba(192, 132, 252, 0.4);
}

/* Tagline Hacker Elite */
.sidebar-tagline {
    display: inline-block;
    margin-top: 6px;
    padding-left: 40px; /* Rata presisi sejajar sama huruf R, ngelangkahin logo 28px + gap 12px */
    font-family: 'Inter', sans-serif;
    font-size: 0.65rem;
    color: #06b6d4; /* Aksen Cyan */
    letter-spacing: 1.5px;
    font-weight: 700;
    text-transform: uppercase;
    opacity: 0.85;
    transition: opacity 0.3s ease;
}

.sidebar-header:hover .sidebar-tagline {
    opacity: 1;
    text-shadow: 0 0 8px rgba(6, 182, 212, 0.5);
}
.logo-gradient {
    /* Gradien Cyan ke Purple ala Cyberpunk */
    background: linear-gradient(135deg, #c8cdce, #c084fc);
    -webkit-background-clip: text !important;
    background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    display: inline-block;
    text-shadow: 0 4px 15px rgba(168, 85, 247, .4);
}

.sidebar-header h2 i,
.sidebar-menu li i {
    min-width: 24px;
    font-size: 1.15rem;
    display: flex;
    justify-content: center;
    color: #a1a1aa;
    transition: color .3s;
}

/* --- MENU ITEMS --- */
.control-btn,
.sidebar-menu li {
    cursor: pointer;
    position: relative;
}

.sidebar-menu {
    list-style: none;
    flex: 1;
    padding: 0;
    margin: 0;
}

.sidebar-menu li {
    padding: 10px 8px;
    margin-bottom: 6px;
    border-radius: 10px;
    color: #a1a1aa;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    transition: .3s cubic-bezier(.16, 1, .3, 1);
}

.sidebar-menu li:hover {
    background: linear-gradient(90deg, rgba(192, 132, 252, 0.08) 0%, transparent 100%);
    color: #fff;
    padding-left: 16px;
    border-left: 2px solid rgba(192, 132, 252, 0.4);
}

.sidebar-menu li:hover i {
    transform: scale(1.15) rotate(-5deg);
    color: #a12eff; /* Aksen Cyan pas di-hover */
}

.sidebar-menu li.active {
    background: linear-gradient(90deg, rgba(192, 132, 252, 0.15), transparent 100%);
    color: #fff;
    border-left: 4px solid #c084fc;
    box-shadow: inset 15px 0 25px -10px rgba(192, 132, 252, 0.15);
    border-radius: 0 10px 10px 0;
}

.sidebar-menu li.active i {
    color: #c084fc;
    filter: drop-shadow(0 0 10px rgba(168, 85, 247, .6));
}

.sidebar-menu li.disabled {
    opacity: .3;
    cursor: not-allowed;
}

/* Styling buat Header Kategori */
.sidebar-category {
    font-size: 0.8rem; /* Pas proporsinya */
    font-weight: 800;
    color: #6b7280; 
    cursor: pointer;
    display: flex;
    justify-content: space-between; 
    align-items: center;
    padding: 16px 8px 8px 8px;
    margin-top: 10px;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: color 0.3s ease;
    user-select: none; 
}

.sidebar-category:hover {
    color: #c084fc; 
    text-shadow: 0 0 8px rgba(192, 132, 252, 0.4);
}

.chevron-icon {
    font-size: 0.9rem;
    transition: transform 0.3s ease;
}

/* Container untuk anak menu */
.category-list {
    list-style: none;
    padding-left: 0;
    margin: 0;
    overflow: hidden;
    max-height: 500px; 
    transition: max-height 0.3s ease-in-out;
}

.category-list.collapsed { max-height: 0; }
.sidebar-category.collapsed .chevron-icon { transform: rotate(-90deg); }
.sidebar-menu .sidebar-category:first-child { margin-top: 5px; }

/* --- BOTTOM STATS (PnL & Winrate) --- */
.sidebar-bottom-stats {
    padding-top: 20px;
    border-top: 1px solid rgba(168, 85, 247, 0.15);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.side-stat-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.side-mini-card {
    background: rgba(10, 5, 20, 0.5); /* Gelap pekat */
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border-top: 1px solid rgba(192, 132, 252, 0.15);
    border-left: 1px solid rgba(255, 255, 255, 0.05);
    border-right: 1px solid rgba(0, 0, 0, 0.4);
    border-bottom: 1px solid rgba(0, 0, 0, 0.6);
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
    transition: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}


.side-mini-card.full-width { width: 100%; }

.side-mini-card:hover {
    transform: translateY(-3px);
    background: rgba(192, 132, 252, 0.05);
    border-top-color: rgba(192, 132, 252, 0.4);
    box-shadow: 0 12px 30px rgba(0, 0, 0, .5), 0 0 20px rgba(168, 85, 247, .2);
}

.side-mini-card small {
    font-size: 9px;
    color: #a1a1aa;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
    display: block;
    margin-bottom: 8px;
}

.side-mini-card h4 {
    font-size: 1.1rem;
    color: #fff;
    margin: 0;
    font-weight: 700;
}

.side-mini-card h2 {
    font-size: 1.4rem;
    margin: 0;
    font-weight: 800;
    letter-spacing: -.02em;
}

.text-purple-glow {
    color: #c084fc !important;
    text-shadow: 0 0 20px rgba(192, 132, 252, .6);
}

/* --- TOMBOL LOGOUT --- */
.sidebar-bottom-stats button {
    margin-top: 8px;
    background: rgba(239, 83, 80, 0.05);
    border: 1px solid rgba(239, 83, 80, 0.2);
    color: #ef5350;
    padding: 12px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.sidebar-bottom-stats button:hover {
    background: rgba(239, 83, 80, 0.15);
    box-shadow: 0 0 16px rgba(239, 83, 80, 0.3);
    transform: translateY(-2px);
}

/* ==========================================
   MOBILE SIDEBAR (Phase 2)
   Collapses to slide-over on < 1400px
   ========================================== */

@media (max-width: 1400px) {
    .sidebar {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 280px !important;
        height: 100vh !important;
        z-index: 9800 !important;
        transform: translateX(-100%) !important;
        transition: transform .3s cubic-bezier(.16, 1, .3, 1), opacity .3s !important;
        opacity: 0;
        pointer-events: none;
    }

    .sidebar.sidebar-open {
        transform: translateX(0) !important;
        opacity: 1;
        pointer-events: all;
    }

    .sidebar.sidebar-closed {
        transform: translateX(-100%) !important;
        opacity: 0;
        pointer-events: none;
    }

    .content {
        margin-left: 0 !important;
        padding: 0 !important;
    }
}

/* Hamburger button */
.sidebar-hamburger-btn {
    display: flex !important;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.7) !important;
    font-size: 1rem !important;
}

.sidebar-hamburger-btn:hover {
    color: #fff !important;
    background: rgba(168, 85, 247, 0.2) !important;
    border-color: rgba(168, 85, 247, 0.4) !important;
}

@media (min-width: 1401px) {
    .sidebar-hamburger-btn {
        display: none !important;
    }

    /* Reset sidebar on desktop */
    .sidebar {
        transform: none !important;
        opacity: 1 !important;
        pointer-events: all !important;
    }

    .content {
        margin-left: 280px !important;
    }
}

/* Overlay backdrop */
#sidebar-mobile-overlay {
    cursor: pointer;
}

/* Mobile-friendly touch targets */
@media (max-width: 1400px) {
    .sidebar-menu li {
        padding: 12px 16px !important;
        min-height: 44px;
    }

    .sidebar-category {
        padding: 18px 16px 12px !important;
    }

    .sidebar-bottom-stats {
        padding-top: 24px !important;
    }

    .side-mini-card {
        padding: 16px !important;
    }
}

/* ==========================================
   SCROLLBAR ELITE
   ========================================== */
.sidebar::-webkit-scrollbar { width: 4px; background: transparent; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb {
    background: rgba(168, 85, 247, 0.3); 
    border-radius: 10px;
    transition: background 0.3s ease;
}
.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(192, 132, 252, 0.9);
    box-shadow: 0 0 10px rgba(192, 132, 252, 0.5);
}

/* 🔥 ELITE FIX: MAIN CONTENT BEBAS SCROLL */
.content {
    margin-left: 280px !important; 
    padding: 0 !important; 
    min-height: 100vh !important; 
    display: block !important; /* Dibiarkan scroll natural browser */
    z-index: 1; 
    background: transparent !important;
}