/* Mobil sidebar â€” yalnÄ±zca â‰¤1024px */

.sidebar-backdrop {
    display: none;
    position: fixed;
    top: var(--topbar-main-height);
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 0;
    width: 100%;
    background: rgba(var(--primary), 0.06);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    border: none;
    padding: 0;
    margin: 0;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

.sidebar-backdrop.is-visible {
    opacity: 1;
    visibility: visible;
}

.mobile-sidebar {
    position: fixed;
    top: var(--topbar-main-height);
    left: 0;
    bottom: 0;
    z-index: 2;
    width: 70vw;
    max-width: none;
    min-width: 0;
    height: auto;
    background: var(--surface-800, #111111);
    color: var(--text-on-dark, #f1f5f9);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.35);
    transform: translateX(-100%);
    transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
    visibility: hidden;
    pointer-events: none;
}

.mobile-sidebar.is-open {
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
}

.sidebar-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    max-height: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

.sidebar-auth {
    display: flex;
    gap: 8px;
    padding: 16px 14px 14px;
    flex-shrink: 0;
}

.sidebar-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0.5rem 0.65rem;
    border-radius: 8px;
    font-size: 0.72rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.sidebar-btn--login {
    background: var(--surface-700, #1a1a1a);
    color: var(--text-light);
    border: 1px solid var(--surface-600);
}

.sidebar-btn--login:hover {
    background: var(--surface-600, #222222);
}

.sidebar-btn--register {
    background: var(--brand-red);
    color: var(--text-light);
    border: 1px solid var(--accent-hover, #d97706);
}

.sidebar-btn--register:hover {
    background: var(--brand-red-hover, #fbbf24);
}

.sidebar-divider {
    border: none;
    height: 1px;
    margin: 0 14px;
    background: rgba(var(--primary), 0.12);
    flex-shrink: 0;
}

.sidebar-nav {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 12px 0 8px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.sidebar-nav::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}

.sidebar-section {
    margin-bottom: 16px;
}

.sidebar-section:last-child {
    margin-bottom: 0;
}

.sidebar-section__title {
    padding-left: 14px;
    padding-right: 14px;
}

.sidebar-links {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sidebar-links li {
    margin: 0;
    border-radius: 20px;
    transition: background 0.2s ease;
}

.sidebar-links li:has(> a.is-active) {
    background: var(--surface-700, #181818);
}

.sidebar-links a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 10px 5px 10px;
    margin: 0 8px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.25;
    border-radius: 10px;
    transition: color 0.2s ease, background 0.2s ease;
}

.sidebar-links a i {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    font-size: 16px;
    color: var(--text-gray);
    border-radius: 8px;
    background: var(--surface-700, #181818);
    transition: color 0.2s ease, background 0.2s ease;
}

.sidebar-links a:hover,
.sidebar-links a:focus-visible {
    color: var(--text-light);
    outline: none;
}

.sidebar-links a:hover i,
.sidebar-links a:focus-visible i {
    color: var(--text-secondary);
    background: var(--surface-900);
}

.sidebar-links a.is-active {
    color: var(--brand-red);
}

.sidebar-links a.is-active i {
    color: var(--brand-red);
    background: color-mix(in srgb, var(--brand-red-dark) 30%, var(--surface-800));
}

.sidebar-footer {
    flex-shrink: 0;
    padding: 0 0 18px;
}

.sidebar-footer .sidebar-divider {
    margin-bottom: 14px;
}

.sidebar-social {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 0 14px;
    margin-bottom: 12px;
}

.sidebar-social__icon {
    width: 32px;
    height: 32px;
    background: var(--surface-700, #1a1a1a);
    border: 1px solid var(--surface-700);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    font-size: 1rem;
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.sidebar-social__icon:hover {
    background: var(--surface-700);
    color: var(--brand-red);
    border-color: var(--surface-600);
}

.sidebar-site-name {
    margin: 0;
    padding: 0 14px;
    text-align: center;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-gray);
}

/* Desktop-only pieces: hidden on mobile drawer */
.sidebar-link-chevron {
    display: none;
}

.sidebar-widgets {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 0 12px 12px;
    flex-shrink: 0;
}

.sidebar-widgets__row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.sidebar-widget {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 14px;
    background: linear-gradient(145deg, var(--surface-700) 0%, var(--surface-800) 48%, var(--card-bg) 100%);
    border: 1px solid rgba(var(--primary), 0.1);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
    text-decoration: none;
    color: var(--text-light);
    transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    min-height: 56px;
    box-sizing: border-box;
}

.sidebar-widget:hover {
    border-color: rgba(var(--primary), 0.28);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 0 0 1px rgba(var(--primary), 0.08);
}

.sidebar-widget.js-daily-reward-claim.is-claimed,
.sidebar-widget.js-daily-reward-claim[aria-disabled="true"] {
    opacity: 0.65;
    cursor: not-allowed;
}

.sidebar-widget.js-daily-reward-claim.is-loading {
    opacity: 0.7;
    pointer-events: none;
}

.sidebar-widget--gorev {
    background:
        radial-gradient(ellipse 70% 120% at 92% 50%, rgba(180, 83, 9, 0.28) 0%, transparent 55%),
        linear-gradient(145deg, var(--surface-700) 0%, var(--surface-800) 48%, var(--card-bg) 100%);
}

.sidebar-widget__icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0;
    background: transparent;
    color: var(--brand-red);
    font-size: 1.15rem;
    overflow: hidden;
    order: 2;
}

.sidebar-widget__icon img,
.sidebar-widget__icon .gift-box-svg,
.sidebar-widget__icon .target-svg,
.sidebar-widget__icon > svg {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.sidebar-widget__icon--gift,
.sidebar-widget__icon--gift .gift-box-svg {
    --gift-shadow: var(--bg-color);
    --gift-box: var(--brand-red);
    --gift-box-dark: var(--brand-red-dark);
    --gift-box-mid: var(--brand-red-mid);
    --gift-bow-dark: var(--brand-red-dark);
    --gift-bow-light: var(--brand-red-hover);
    --gift-ribbon: var(--text-on-dark);
    --gift-ribbon-tint: var(--brand-red-pale);
    --gift-sparkle: var(--text-light);
    --gift-shine: var(--surface-800);
    --gift-stripe-pale: var(--brand-red-pale);
    --gift-stripe-soft: var(--brand-red-soft);
}

.sidebar-widget__icon--gift .gift-sparkle {
    display: none;
}

.sidebar-widget__icon--target,
.sidebar-widget__icon--target .target-svg {
    --target-ring-light: var(--text-light);
    --target-outline: var(--surface-900);
    --target-accent: var(--brand-red);
    --target-arrow-soft: var(--brand-red-soft);
}

.sidebar-widget__text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    flex: 1;
    line-height: 1.2;
    order: 1;
}

.sidebar-widget__title {
    font-size: 0.8rem;
    font-weight: 800;
    color: var(--text-light);
}

.sidebar-widget__sub {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--brand-red);
}

.sidebar-telegram-promo {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 12px 12px 12px;
    padding: 12px 14px;
    border-radius: 14px;
    background: linear-gradient(135deg, #0f2744 0%, #163a5f 100%);
    border: 1px solid rgba(56, 140, 210, 0.35);
    text-decoration: none;
    color: var(--text-light);
    transition: border-color 0.2s ease;
}

.sidebar-telegram-promo:hover {
    border-color: rgba(56, 140, 210, 0.7);
}

.sidebar-telegram-promo__icon {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #229ed9;
    color: var(--text-light, #fff);
    font-size: 1.35rem;
    order: 2;
}

.sidebar-telegram-promo__text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
    line-height: 1.25;
    order: 1;
}

.sidebar-telegram-promo__title {
    font-size: 0.8rem;
    font-weight: 800;
}

.sidebar-telegram-promo__sub {
    font-size: 0.68rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
}

.sidebar-telegram-promo__accent {
    color: var(--brand-red-hover, #fbbf24);
    font-weight: 700;
}

.sidebar-link-label {
    flex: 1;
    min-width: 0;
}

.sidebar-links a {
    position: relative;
}

body.sidebar-open {
    overflow: hidden;
    touch-action: none;
}

@media (min-width: 1025px) {
    /* Ã¼st: mevcut davranÄ±ÅŸ â€” sidebar gizli */
    body.sidebar-pos-ust .sidebar-backdrop,
    body.sidebar-pos-ust .mobile-sidebar {
        display: none !important;
    }

    /* sol: sabit desktop sidebar â€” topbar-sub Ã¼st Ã§izgisinden baÅŸlar */
    body.sidebar-pos-sol .sidebar-backdrop {
        display: none !important;
    }

    body.sidebar-pos-sol .mobile-sidebar {
        display: flex !important;
        flex-direction: column;
        position: fixed;
        top: var(--topbar-main-height);
        left: 0;
        bottom: 0;
        z-index: 1150;
        width: var(--desktop-sidebar-width);
        max-width: none;
        min-width: 0;
        height: calc(100vh - var(--topbar-main-height));
        height: calc(100dvh - var(--topbar-main-height));
        background: var(--surface-800, #111111);
        color: var(--text-on-dark, #f1f5f9);
        box-shadow: none;
        transform: none;
        visibility: visible;
        pointer-events: auto;
        transition: width 0.28s cubic-bezier(0.4, 0, 0.2, 1);
        border-right: 1px solid var(--surface-700);
        overflow: hidden;
    }

    body.sidebar-pos-sol.sidebar-collapsed .mobile-sidebar {
        width: var(--desktop-sidebar-collapsed-width);
    }

    body.sidebar-pos-sol .sidebar-inner {
        height: 100%;
        max-height: 100%;
        overflow: hidden;
        display: flex;
        flex-direction: column;
        min-height: 0;
    }

    body.sidebar-pos-sol .sidebar-widgets {
        padding: 12px 10px 10px;
        flex-shrink: 0;
        gap: 6px;
    }

    body.sidebar-pos-sol .sidebar-widgets__row {
        gap: 6px;
    }

    body.sidebar-pos-sol .sidebar-widget {
        min-height: 50px;
        padding: 8px 10px;
        gap: 6px;
        border-radius: 12px;
    }

    body.sidebar-pos-sol .sidebar-widget__icon {
        width: 32px;
        height: 32px;
    }

    body.sidebar-pos-sol .sidebar-widget__title {
        font-size: 0.74rem;
    }

    body.sidebar-pos-sol .sidebar-widget__sub {
        font-size: 0.66rem;
    }

    body.sidebar-pos-sol .sidebar-nav {
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    body.sidebar-pos-sol .sidebar-nav::-webkit-scrollbar {
        width: 0;
        height: 0;
        display: none;
    }

    body.sidebar-pos-sol .mobile-sidebar,
    body.sidebar-pos-sol .sidebar-inner {
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    body.sidebar-pos-sol .mobile-sidebar::-webkit-scrollbar,
    body.sidebar-pos-sol .sidebar-inner::-webkit-scrollbar {
        width: 0;
        height: 0;
        display: none;
    }

    body.sidebar-pos-sol .sidebar-footer {
        flex-shrink: 0;
    }

    body.sidebar-pos-sol .sidebar-auth {
        display: none;
    }

    /* Sayfa butonları — site (topbar nav) diline uygun */
    body.sidebar-pos-sol .sidebar-section {
        margin-bottom: 14px;
    }

    body.sidebar-pos-sol .sidebar-section__title {
        margin: 0 0 6px;
        padding: 0 12px;
        font-size: 0.64rem;
        font-weight: 800;
        letter-spacing: 0.04em;
        text-transform: uppercase;
        color: var(--section-title-color);
        line-height: 1.2;
    }

    body.sidebar-pos-sol .sidebar-links {
        gap: 3px;
    }

    body.sidebar-pos-sol .sidebar-links li {
        border-radius: 0;
        background: transparent;
    }

    body.sidebar-pos-sol .sidebar-links li:has(> a.is-active) {
        background: transparent;
    }

    body.sidebar-pos-sol .sidebar-links a {
        min-height: 36px;
        margin: 0 8px;
        padding: 5px 8px;
        gap: 8px;
        border-radius: 8px;
        font-size: 0.76rem;
        font-weight: 700;
        color: var(--text-secondary);
        background: transparent;
        border: 1px solid transparent;
        box-sizing: border-box;
        transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
    }

    body.sidebar-pos-sol .sidebar-links a i:first-child {
        width: 26px;
        height: 26px;
        font-size: 14px;
        border-radius: 7px;
        background: var(--surface-700);
        color: var(--text-gray);
        transition: color 0.2s ease, background 0.2s ease;
    }

    body.sidebar-pos-sol .sidebar-link-label {
        flex: 1;
        min-width: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    body.sidebar-pos-sol .sidebar-link-chevron {
        display: inline-flex;
        margin-left: auto;
        flex-shrink: 0;
        font-size: 0.65rem;
        color: var(--text-gray);
        opacity: 0.55;
        width: auto !important;
        height: auto !important;
        background: transparent !important;
        border-radius: 0 !important;
    }

    body.sidebar-pos-sol .sidebar-links a:hover,
    body.sidebar-pos-sol .sidebar-links a:focus-visible {
        color: var(--text-light);
        background: var(--surface-700);
        outline: none;
    }

    body.sidebar-pos-sol .sidebar-links a:hover i:first-child,
    body.sidebar-pos-sol .sidebar-links a:focus-visible i:first-child {
        color: var(--text-light);
        background: var(--surface-600);
    }

    body.sidebar-pos-sol .sidebar-links a:hover .sidebar-link-chevron,
    body.sidebar-pos-sol .sidebar-links a:focus-visible .sidebar-link-chevron {
        opacity: 0.85;
        color: var(--text-secondary);
    }

    body.sidebar-pos-sol .sidebar-links a.is-active {
        color: var(--text-light);
        background: var(--surface-700);
        border-color: rgba(var(--primary), 0.22);
    }

    body.sidebar-pos-sol .sidebar-links a.is-active i:first-child {
        color: var(--brand-red);
        background: color-mix(in srgb, var(--brand-red-dark) 28%, var(--surface-800));
    }

    body.sidebar-pos-sol .sidebar-links a.is-active .sidebar-link-chevron {
        color: var(--brand-red);
        opacity: 0.9;
    }

    body.sidebar-pos-sol .sidebar-telegram-promo {
        margin: 10px 8px 10px;
        padding: 10px 12px;
        border-radius: 12px;
    }

    body.sidebar-pos-sol .sidebar-telegram-promo__title {
        font-size: 0.74rem;
    }

    body.sidebar-pos-sol .sidebar-telegram-promo__sub {
        font-size: 0.64rem;
    }

    body.sidebar-pos-sol .sidebar-telegram-promo__icon {
        width: 36px;
        height: 36px;
        font-size: 1.15rem;
    }

    body.sidebar-pos-sol .sidebar-social {
        gap: 8px;
        padding: 0 10px;
        margin-bottom: 10px;
    }

    body.sidebar-pos-sol .sidebar-social__icon {
        width: 36px;
        height: 36px;
        border-radius: 9px;
        background: var(--surface-700, #1a1a1a);
        border: 1px solid var(--surface-600);
        font-size: 1rem;
    }

    body.sidebar-pos-sol .sidebar-site-name {
        display: none;
    }

    body.sidebar-pos-sol .sidebar-footer .sidebar-divider {
        display: none;
    }

    /* Collapsed (ikon ÅŸeridi) */
    body.sidebar-pos-sol.sidebar-collapsed .sidebar-widget__text,
    body.sidebar-pos-sol.sidebar-collapsed .sidebar-link-label,
    body.sidebar-pos-sol.sidebar-collapsed .sidebar-link-chevron,
    body.sidebar-pos-sol.sidebar-collapsed .sidebar-section__title,
    body.sidebar-pos-sol.sidebar-collapsed .sidebar-telegram-promo__text,
    body.sidebar-pos-sol.sidebar-collapsed .sidebar-site-name,
    body.sidebar-pos-sol.sidebar-collapsed .sidebar-divider {
        display: none !important;
    }

    body.sidebar-pos-sol.sidebar-collapsed .sidebar-widgets {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 6px;
        padding: 12px 0 8px;
    }

    body.sidebar-pos-sol.sidebar-collapsed .sidebar-widgets__row {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 6px;
        width: 100%;
    }

    body.sidebar-pos-sol.sidebar-collapsed .sidebar-widget {
        width: 44px;
        height: 44px;
        min-height: 44px;
        min-width: 44px;
        max-width: 44px;
        padding: 0;
        margin: 0;
        gap: 0;
        justify-content: center;
        align-items: center;
        border-radius: 12px;
        overflow: hidden;
        box-sizing: border-box;
    }

    body.sidebar-pos-sol.sidebar-collapsed .sidebar-widget--gorev {
        background: linear-gradient(145deg, var(--surface-700) 0%, var(--surface-800) 48%, var(--card-bg) 100%);
    }

    body.sidebar-pos-sol.sidebar-collapsed .sidebar-widget__icon {
        order: 0;
        width: 26px;
        height: 26px;
        overflow: hidden;
    }

    body.sidebar-pos-sol.sidebar-collapsed .sidebar-widget__icon--gift .gift-sparkle {
        display: none !important;
    }

    body.sidebar-pos-sol.sidebar-collapsed .sidebar-widget__icon img,
    body.sidebar-pos-sol.sidebar-collapsed .sidebar-widget__icon .gift-box-svg,
    body.sidebar-pos-sol.sidebar-collapsed .sidebar-widget__icon .target-svg,
    body.sidebar-pos-sol.sidebar-collapsed .sidebar-widget__icon > svg {
        width: 26px;
        height: 26px;
        max-width: 26px;
        max-height: 26px;
    }

    body.sidebar-pos-sol.sidebar-collapsed .sidebar-links {
        gap: 4px;
        align-items: center;
    }

    body.sidebar-pos-sol.sidebar-collapsed .sidebar-links li {
        display: flex;
        justify-content: center;
        width: 100%;
        border-radius: 12px;
    }

    body.sidebar-pos-sol.sidebar-collapsed .sidebar-links a {
        width: 40px;
        height: 40px;
        min-width: 40px;
        min-height: 40px;
        margin: 0;
        padding: 0;
        gap: 0;
        justify-content: center;
        align-items: center;
        border-radius: 8px;
        box-sizing: border-box;
    }

    body.sidebar-pos-sol.sidebar-collapsed .sidebar-links a i:first-child {
        width: 28px;
        height: 28px;
        margin: 0;
        font-size: 15px;
    }

    body.sidebar-pos-sol.sidebar-collapsed .sidebar-footer {
        display: flex;
        flex-direction: column;
        align-items: center;
        padding: 0 0 12px;
    }

    body.sidebar-pos-sol.sidebar-collapsed .sidebar-telegram-promo {
        width: 44px;
        height: 44px;
        min-width: 44px;
        min-height: 44px;
        max-width: 44px;
        margin: 0 0 8px;
        padding: 0;
        gap: 0;
        justify-content: center;
        align-items: center;
        border-radius: 12px;
        overflow: hidden;
        box-sizing: border-box;
    }

    body.sidebar-pos-sol.sidebar-collapsed .sidebar-telegram-promo__icon {
        width: 28px;
        height: 28px;
        font-size: 1rem;
        order: 0;
    }

    body.sidebar-pos-sol.sidebar-collapsed .sidebar-social {
        display: none !important;
    }

    body.sidebar-pos-sol.sidebar-collapsed .sidebar-section {
        margin-bottom: 6px;
    }

    body.sidebar-pos-sol.sidebar-collapsed .sidebar-nav {
        padding-top: 4px;
        padding-bottom: 4px;
    }
}

@media (max-width: 1024px) {
    .sidebar-collapse-btn {
        display: none !important;
    }

    .sidebar-link-chevron {
        display: none !important;
    }

    .sidebar-backdrop.is-active {
        display: block;
    }

    .topbar-main {
        position: relative;
        z-index: 3;
        overflow: visible;
    }

    .topbar-sub {
        position: relative;
        z-index: 1;
    }

    body.sidebar-open .topbar-main {
        box-shadow: 0 8px 24px rgba(5, 5, 5, 0.55);
    }

    body.sidebar-open .topbar-main::after {
        content: '';
        position: absolute;
        left: 0;
        right: 0;
        bottom: 0;
        height: 14px;
        transform: translateY(100%);
        background: linear-gradient(
            to bottom,
            rgba(5, 5, 5, 0.5) 0%,
            rgba(5, 5, 5, 0.15) 45%,
            transparent 100%
        );
        pointer-events: none;
        z-index: 4;
    }

    body.sidebar-open .topbar-sub {
        border-top-color: transparent;
    }

    body.sidebar-open .sidebar-backdrop.is-active {
        z-index: 1140;
    }

    body.sidebar-open .mobile-sidebar.is-open {
        z-index: 1141;
    }
}
