/* ═══════════════════════════════════════════════════════════
   MARINA BET — ULTRA PREMIUM SIDEBAR  v4.0
   Glassmorphism · Cyberpunk Emerald · Micro-Animations
   ═══════════════════════════════════════════════════════════ */

/* ══ CSS Variables ══ */
:root {
    --sb-emerald:       #1C87B7;
    --sb-emerald-dark:  #006e9f;
    --sb-emerald-glow:  rgba(16, 158, 202,.18);
    --sb-purple:        #BE04E1;
    --sb-bg:            rgba(4, 11, 14, 0.98);
    --sb-width:         278px;
}

/* ══ Shell ══ */
.sidebar {
    width: var(--sb-width);
    min-width: var(--sb-width);
    background: linear-gradient(180deg,
        rgba(5, 11, 14, 0.97) 0%,
        rgba(3, 7, 9, 0.99) 100%);
    border-right: 1px solid rgba(16, 158, 202,.07);
    padding: 0;
    position: sticky;
    top: 130px;
    align-self: flex-start;
    flex-shrink: 0;
    transition: width .3s ease, opacity .4s ease, visibility .4s ease, transform .4s ease;
    /* Aç/kapat animasyonu sırasında sidebar'ın kendi iç menü listesinin de her karede
       yeniden hesaplanmasını izole eder — animasyon kasmadan akar. */
    contain: layout style;
}

/* Footer alanına geçilince sidebar'ı görünmez yap (JS: IntersectionObserver) */
.sidebar.sb-hide-for-footer {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Footer'a gelinince sidebar gizle */
.sidebar.sidebar-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateX(-18px);
}

/* Masaüstü: butonla aç/kapat — sadece masaüstünde (900px üstü) geçerli;
   900px altında emerald-elite.css'teki mobil "overlay olarak göster" kuralıyla
   çakışıp sidebar'ın hiç görünmemesine sebep oluyordu. */
@media (min-width: 901px) {
    .sidebar.open {
        width: 0 !important;
        min-width: 0 !important;
        opacity: 0;
        overflow: hidden;
        pointer-events: none;
        transform: translateX(-20px);
    }
}

/* Üst parlama halkası */
.sidebar::before {
    content: '';
    position: absolute;
    top: -1px; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(16, 158, 202,.6) 30%,
        rgba(16, 158, 202,1)  50%,
        rgba(16, 158, 202,.6) 70%,
        transparent 100%);
    border-radius: 0 0 4px 4px;
    animation: topGlow 3s ease-in-out infinite;
    z-index: 2;
}

@keyframes topGlow {
    0%,100% { opacity: .5; }
    50%      { opacity: 1; box-shadow: 0 0 20px rgba(16, 158, 202,.5); }
}

/* Sağ kenar canlı çizgi */
.sidebar::after {
    content: '';
    position: absolute;
    top: 0; right: 0;
    width: 1px; height: 100%;
    background: linear-gradient(180deg,
        rgba(16, 158, 202,.5) 0%,
        rgba(16, 158, 202,.15) 40%,
        transparent 80%);
    pointer-events: none;
}

/* ══ Inner Scroll ══ */
.sidebar-inner {
    height: calc(100vh - 130px);
    overflow-y: auto;
    overflow-x: hidden;
    /* iOS Safari (ve bazı Android tarayıcılar): position:fixed bir ebeveyn içindeki
       overflow:auto alan, bu olmadan parmakla kaydırmaya hiç tepki vermiyor. */
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    /* Kaydırma sonuna gelince arkadaki sayfaya/overlay'e "scroll chaining" yapmasın */
    overscroll-behavior: contain;
    padding: 16px 10px 24px;
    position: relative;
    z-index: 1;
    scrollbar-width: thin;
    scrollbar-color: rgba(16, 158, 202,.15) transparent;
}

/* Mobil: gerçek mobil header yüksekliği (56px) baz alınır — masaüstü değeri (130px)
   burada kullanılırsa sidebar-inner ebeveynden çok daha kısa kalır ve içerik
   dip kısımlara ulaşılamaz/kaydırma alanı yanlış hesaplanır. */
@media (max-width: 768px) {
    .sidebar-inner {
        height: calc(100vh - 56px);
    }
}

.sidebar-inner::-webkit-scrollbar       { width: 3px; }
.sidebar-inner::-webkit-scrollbar-track { background: transparent; }
.sidebar-inner::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(16, 158, 202,.3), rgba(16, 158, 202,.1));
    border-radius: 3px;
}

/* ══ Live Stats Bar ══ */
.sidebar-live-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(16, 158, 202,.05);
    border: 1px solid rgba(16, 158, 202,.1);
    border-radius: 10px;
    padding: 7px 11px;
    margin-bottom: 12px;
    gap: 6px;
}

.slb-dot {
    width: 6px; height: 6px;
    background: #1C87B7;
    border-radius: 50%;
    flex-shrink: 0;
    animation: pulseDot 1.4s ease-in-out infinite;
    box-shadow: 0 0 6px rgba(16, 158, 202,.8);
}

@keyframes pulseDot {
    0%,100% { transform: scale(1); opacity: 1; }
    50%      { transform: scale(1.4); opacity: .7; }
}

.slb-text {
    font-size: 10px;
    font-weight: 700;
    color: rgba(16, 158, 202,.7);
    font-family: 'Inter', sans-serif;
    letter-spacing: 1px;
    text-transform: uppercase;
    flex: 1;
}

.slb-count {
    font-size: 11px;
    font-weight: 800;
    color: #1C87B7;
    font-family: 'Urbanist', sans-serif;
    background: rgba(16, 158, 202,.1);
    padding: 2px 8px;
    border-radius: 20px;
    border: 1px solid rgba(16, 158, 202,.2);
}

/* ══ Search ══ */
.sidebar-search {
    display: flex;
    align-items: center;
    gap: 9px;
    background: rgba(255,255,255,.03);
    border: 1px solid rgba(255,255,255,.07);
    border-radius: 11px;
    padding: 9px 12px;
    margin-bottom: 13px;
    transition: all .25s ease;
    position: relative;
    overflow: hidden;
    cursor: text;
}

.sidebar-search::after {
    content: '';
    position: absolute;
    bottom: 0; left: 10%; right: 10%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(16, 158, 202,.4), transparent);
    opacity: 0;
    transition: opacity .25s;
}

.sidebar-search:focus-within {
    border-color: rgba(16, 158, 202,.3);
    background: rgba(16, 158, 202,.05);
    box-shadow: 0 0 0 3px rgba(16, 158, 202,.06),
                inset 0 1px 0 rgba(16, 158, 202,.08);
}

.sidebar-search:focus-within::after { opacity: 1; }

.sidebar-search svg {
    color: rgba(255,255,255,.18);
    flex-shrink: 0;
    transition: color .25s, transform .25s;
}

.sidebar-search:focus-within svg {
    color: rgba(16, 158, 202,.55);
    transform: scale(1.1);
}

.sidebar-search input {
    background: none;
    border: none;
    color: rgba(255,255,255,.8);
    font-size: 12px;
    width: 100%;
    outline: none;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
}

.sidebar-search input::placeholder { color: rgba(255,255,255,.16); }

/* ══ Ana Sayfa Butonu ══ */
.sidebar-main-item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 11px 13px;
    border-radius: 13px;
    background: linear-gradient(135deg,
        rgba(16, 158, 202,.1) 0%,
        rgba(16, 158, 202,.05) 100%);
    border: 1px solid rgba(16, 158, 202,.18);
    color: #1C87B7;
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
    margin-bottom: 14px;
    transition: all .25s ease;
    position: relative;
    overflow: hidden;
}

.sidebar-main-item::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(16, 158, 202,.12), transparent);
    opacity: 0;
    transition: opacity .25s;
}

.sidebar-main-item::after {
    content: '';
    position: absolute;
    right: -30px; top: 50%;
    transform: translateY(-50%);
    width: 60px; height: 60px;
    background: radial-gradient(circle, rgba(16, 158, 202,.15), transparent 70%);
    transition: right .3s ease;
}

.sidebar-main-item:hover {
    background: linear-gradient(135deg,
        rgba(16, 158, 202,.18) 0%,
        rgba(16, 158, 202,.08) 100%);
    border-color: rgba(16, 158, 202,.35);
    transform: translateX(3px);
    box-shadow: 0 6px 20px rgba(16, 158, 202,.12),
                inset 0 1px 0 rgba(16, 158, 202,.1);
    color: #00b0ff;
}

.sidebar-main-item:hover::before { opacity: 1; }
.sidebar-main-item:hover::after  { right: 10px; }

.sidebar-main-item svg {
    transition: transform .25s, filter .25s;
    flex-shrink: 0;
}

.sidebar-main-item:hover svg {
    transform: scale(1.15);
    filter: drop-shadow(0 0 6px rgba(16, 158, 202,.6));
}

/* ══ Section Header ══ */
.sidebar-section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 2px;
    margin: 22px 0 5px;
}

.sidebar-section-title {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 2px;
    color: rgba(16, 158, 202,.22);
    white-space: nowrap;
    text-transform: uppercase;
    font-family: 'Inter', sans-serif;
}

.sidebar-section-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(to right,
        rgba(16, 158, 202,.08),
        rgba(16, 158, 202,.02),
        transparent);
}

/* ══ Menu List ══ */
.sidebar-menu-list {
    list-style: none;
    padding: 0; margin: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

/* ══ Menu Link ══ */
.menu-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 9px;
    color: rgba(255,255,255,.32);
    text-decoration: none;
    border-radius: 10px;
    transition: all .18s ease;
    position: relative;
    overflow: hidden;
    font-family: 'Inter', sans-serif;
}

/* Hover arka plan sweep */
.menu-link::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg,
        rgba(255,255,255,.04) 0%,
        rgba(255,255,255,.01) 100%);
    opacity: 0;
    transition: opacity .2s;
    border-radius: 12px;
}

/* Sol aktif çizgi */
.menu-link::after {
    content: '';
    position: absolute;
    left: 0; top: 20%; bottom: 20%;
    width: 2.5px;
    border-radius: 2px;
    background: currentColor;
    opacity: 0;
    transform: scaleY(0);
    transition: opacity .2s, transform .22s cubic-bezier(.34,1.56,.64,1);
}

.menu-link:hover {
    color: rgba(255,255,255,.82);
    background: rgba(255,255,255,.04);
}

.menu-link:hover::before { opacity: 1; }
.menu-link:hover::after  { opacity: .65; transform: scaleY(1); }

/* ══ Active Link ══ */
.menu-link.active,
.menu-link[aria-current="page"] {
    color: var(--sb-emerald);
    background: rgba(16, 158, 202,.07);
}

.menu-link.active::after {
    opacity: 1;
    transform: scaleY(1);
    background: var(--sb-emerald);
    box-shadow: 0 0 8px rgba(16, 158, 202,.5);
}

/* ══ Icon Left — Ultra Premium ══ */
.icon-left {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
    transition: all .28s cubic-bezier(.34,1.56,.64,1);
    background: linear-gradient(145deg,
        rgba(255,255,255,.05) 0%,
        rgba(0,0,0,.12) 100%);
    border: 1px solid rgba(255,255,255,.07);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.08),
        inset 0 -1px 0 rgba(0,0,0,.15),
        0 1px 6px rgba(0,0,0,.2);
    overflow: hidden;
}

/* Color fill layer */
.icon-left::before {
    content: '';
    position: absolute; inset: 0;
    border-radius: 11px;
    background: linear-gradient(145deg, currentColor 0%, transparent 120%);
    opacity: .14;
    transition: opacity .25s;
}

/* Shine sweep */
.icon-left::after {
    content: '';
    position: absolute;
    top: -50%; left: -50%;
    width: 30%; height: 200%;
    background: linear-gradient(
        105deg,
        transparent 0%,
        rgba(255,255,255,.18) 50%,
        transparent 100%
    );
    transform: skewX(-10deg);
    opacity: 0;
    transition: opacity .3s, left .4s ease;
    pointer-events: none;
}

.menu-link:hover .icon-left {
    transform: scale(1.12) translateY(-2px);
    border-color: currentColor;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.18),
        inset 0 -1px 0 rgba(0,0,0,.15),
        0 0 0 2px color-mix(in srgb, currentColor 25%, transparent),
        0 6px 20px rgba(0,0,0,.3),
        0 0 16px color-mix(in srgb, currentColor 30%, transparent);
}

.menu-link:hover .icon-left::before { opacity: .28; }

.menu-link:hover .icon-left::after {
    opacity: 1;
    left: 140%;
}

.icon-left svg {
    position: relative;
    z-index: 1;
    transition: transform .28s cubic-bezier(.34,1.56,.64,1), filter .25s;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,.4));
}

.menu-link:hover .icon-left svg {
    filter:
        drop-shadow(0 0 6px currentColor)
        drop-shadow(0 0 2px currentColor)
        brightness(1.25);
    transform: scale(1.18) translateY(-1px);
}

/* ══ Menu Label ══ */
.menu-label { flex: 1; min-width: 0; }

.menu-label span {
    display: block;
    font-size: 12.5px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
    letter-spacing: .1px;
}

/* ══ Badge ══ */
.menu-badge {
    font-size: 9px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 5px;
    letter-spacing: .5px;
    text-transform: uppercase;
    flex-shrink: 0;
    transition: all .2s;
}

.menu-badge--hot {
    background: linear-gradient(135deg,#ff416c,#c0392b);
    color: #fff;
    box-shadow: 0 2px 8px rgba(255,65,108,.3);
    animation: badgePop 2s ease-in-out infinite;
}

.menu-badge--new {
    background: linear-gradient(135deg,#1C87B7,#006e9f);
    color: #000;
    box-shadow: 0 2px 8px rgba(16, 158, 202,.3);
}

.menu-badge--live {
    background: rgba(239,83,80,.1);
    border: 1px solid rgba(239,83,80,.3);
    color: #ef5350;
    animation: livePulse 2s ease-in-out infinite;
}

@keyframes livePulse {
    0%,100% { box-shadow: 0 0 0 0 rgba(239,83,80,.3); }
    50%      { box-shadow: 0 0 0 3px rgba(239,83,80,.1); }
}

@keyframes badgePop {
    0%,100% { transform: scale(1); }
    50%      { transform: scale(1.05); }
}

/* ══ VIP Banner ══ */
.sidebar-vip-banner {
    margin: 14px 0 4px;
    padding: 13px;
    background: linear-gradient(135deg,
        rgba(190,4,225,.14) 0%,
        rgba(100,0,180,.09) 50%,
        rgba(190,4,225,.07) 100%);
    border: 1px solid rgba(190,4,225,.22);
    border-radius: 14px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    overflow: hidden;
    transition: all .28s ease;
}

.sidebar-vip-banner::before {
    content: '';
    position: absolute;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: conic-gradient(
        from 0deg,
        transparent 0%,
        rgba(190,4,225,.12) 25%,
        transparent 50%
    );
    animation: vipSpin 8s linear infinite;
    pointer-events: none;
    opacity: 0;
    transition: opacity .3s;
}

.sidebar-vip-banner:hover::before { opacity: 1; }

@keyframes vipSpin {
    to { transform: rotate(360deg); }
}

.sidebar-vip-banner:hover {
    background: linear-gradient(135deg,
        rgba(190,4,225,.22) 0%,
        rgba(100,0,180,.15) 50%,
        rgba(190,4,225,.14) 100%);
    border-color: rgba(190,4,225,.45);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(190,4,225,.18);
}

.sidebar-vip-icon {
    width: 40px; height: 40px;
    background: linear-gradient(135deg,#BE04E1,#7B00C4);
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 16px rgba(190,4,225,.45);
    color: #fff;
    transition: transform .25s, box-shadow .25s;
}

.sidebar-vip-banner:hover .sidebar-vip-icon {
    transform: scale(1.08);
    box-shadow: 0 6px 24px rgba(190,4,225,.6);
}

.sidebar-vip-text { flex: 1; min-width: 0; }

.sidebar-vip-text strong {
    display: block;
    font-size: 13px;
    font-weight: 800;
    color: #e879f9;
    font-family: 'Urbanist', sans-serif;
    letter-spacing: .3px;
}

.sidebar-vip-text span {
    font-size: 10.5px;
    color: rgba(232,121,249,.5);
    font-family: 'Inter', sans-serif;
    font-weight: 500;
}

.sidebar-vip-arrow {
    color: rgba(232,121,249,.4);
    flex-shrink: 0;
    transition: transform .22s;
}

.sidebar-vip-banner:hover .sidebar-vip-arrow {
    transform: translateX(4px);
    color: rgba(232,121,249,.75);
}

/* ══ Bonus Progress Card ══ */
.sidebar-bonus-card {
    margin: 10px 0;
    padding: 12px 13px;
    background: rgba(16, 158, 202,.04);
    border: 1px solid rgba(16, 158, 202,.09);
    border-radius: 13px;
    transition: all .22s;
    cursor: pointer;
}

.sidebar-bonus-card:hover {
    background: rgba(16, 158, 202,.08);
    border-color: rgba(16, 158, 202,.18);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(16, 158, 202,.08);
}

.sidebar-bonus-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 9px;
}

.sidebar-bonus-title {
    font-size: 10.5px;
    font-weight: 700;
    color: rgba(255,255,255,.4);
    font-family: 'Inter', sans-serif;
    letter-spacing: .5px;
    text-transform: uppercase;
}

.sidebar-bonus-amount {
    font-size: 13px;
    font-weight: 800;
    color: #1C87B7;
    font-family: 'Urbanist', sans-serif;
}

.sidebar-bonus-bar-bg {
    height: 5px;
    background: rgba(255,255,255,.05);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 7px;
}

.sidebar-bonus-bar-fill {
    height: 100%;
    width: 62%;
    background: linear-gradient(90deg, #006e9f, #1C87B7, #00b0ff);
    border-radius: 3px;
    position: relative;
    overflow: hidden;
}

.sidebar-bonus-bar-fill::after {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.5), transparent);
    animation: shimmerBar 2.5s ease-in-out infinite;
}

@keyframes shimmerBar {
    0%   { left: -60%; }
    100% { left: 160%; }
}

.sidebar-bonus-info {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: rgba(255,255,255,.22);
    font-family: 'Inter', sans-serif;
}

/* ══ Sosyal Medya Satırı ══ */
.sidebar-social-row {
    display: flex;
    gap: 6px;
    padding: 10px 0 6px;
    margin-top: 4px;
}

.sidebar-social-btn {
    flex: 1;
    height: 35px;
    border-radius: 10px;
    background: rgba(255,255,255,.03);
    border: 1px solid rgba(255,255,255,.06);
    display: flex; align-items: center; justify-content: center;
    text-decoration: none;
    color: rgba(255,255,255,.28);
    transition: all .22s ease;
}

.sidebar-social-btn:hover   { transform: translateY(-2px); }
.sidebar-social-btn.tw:hover { background:rgba(29,161,242,.1);  border-color:rgba(29,161,242,.2);  color:#1DA1F2; box-shadow:0 4px 14px rgba(29,161,242,.14); }
.sidebar-social-btn.ig:hover { background:rgba(190,4,225,.1);   border-color:rgba(190,4,225,.2);   color:#BE04E1; box-shadow:0 4px 14px rgba(190,4,225,.14); }
.sidebar-social-btn.tg:hover { background:rgba(37,161,224,.1);  border-color:rgba(37,161,224,.2);  color:#25A1E0; box-shadow:0 4px 14px rgba(37,161,224,.14); }

/* ══ Divider ══ */
.sidebar-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.06), transparent);
    margin: 14px 0;
    border: none;
}

/* ══ Pragmatic Play özel ══ */
.pragma-icon {
    justify-content: flex-start !important;
    padding: 0 8px !important;
    overflow: hidden;
}

.menu-link:hover .pragma-icon {
    background: rgba(246,139,41,.12) !important;
    border-color: rgba(246,139,41,.28) !important;
    box-shadow: 0 0 14px rgba(246,139,41,.12);
}

.menu-link:hover .pragma-icon svg {
    filter: drop-shadow(0 0 4px rgba(246,139,41,.5)) brightness(1.1);
    transform: none;
}

/* ══ Sidebar Giriş Animasyonu ══ */
@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-10px); }
    to   { opacity: 1; transform: translateX(0); }
}

.sidebar-inner > * {
    animation: slideInLeft .35s ease both;
}

.sidebar-inner > *:nth-child(1)  { animation-delay: .04s; }
.sidebar-inner > *:nth-child(2)  { animation-delay: .07s; }
.sidebar-inner > *:nth-child(3)  { animation-delay: .10s; }
.sidebar-inner > *:nth-child(4)  { animation-delay: .13s; }
.sidebar-inner > *:nth-child(5)  { animation-delay: .16s; }
.sidebar-inner > *:nth-child(6)  { animation-delay: .19s; }
.sidebar-inner > *:nth-child(7)  { animation-delay: .22s; }
.sidebar-inner > *:nth-child(8)  { animation-delay: .25s; }
.sidebar-inner > *:nth-child(9)  { animation-delay: .28s; }
.sidebar-inner > *:nth-child(10) { animation-delay: .31s; }

/* ══ Responsive ══ */
@media (max-width: 1100px) {
    .sidebar { width: 220px; min-width: 220px; }
}

@media (max-width: 900px) {
    .sidebar {
        width: 280px;
        min-width: 280px;
        padding-bottom: env(safe-area-inset-bottom, 16px);
    }
}