/* ===== GLOBAL SIDEBAR STİLLERİ ===== */

.sidebar {
    width: 260px;
    min-width: 260px;
    flex-shrink: 0;
    background: #fff;
    border-right: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    padding: 24px 0;
    position: fixed;
    left: 0;
    top: 72px;
    height: calc(100vh - 72px);
    overflow-y: auto;
    z-index: 100;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

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

.sidebar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('../images/arkaplan/lazer-desen-arka-plan.svg') center/cover;
    z-index: -1;
}

.sidebar-nav {
    flex: 1;
}

.nav-item,
.footer-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    color: #6b7280;
    text-decoration: none;
    transition: all 0.2s;
    font-size: 15px;
    font-weight: 600;
}

.nav-item:hover,
.footer-link:hover {
    background: #f3f4f6;
    color: #111827;
}

.nav-item.active {
    background: #f0fdf4;
    color: #10b981;
    border-right: 3px solid #10b981;
}

.nav-item i,
.footer-link i {
    width: 20px;
    font-size: 18px;
}

.sidebar-footer {
    border-top: 1px solid #e5e7eb;
    padding-top: 16px;
    margin-top: 16px;
}

.sidebar-bottom {
    padding: 16px 24px;
    font-size: 11px;
    color: #9ca3af;
}

.sidebar-bottom .links {
    display: flex;
    gap: 12px;
    margin-bottom: 8px;
}

.sidebar-bottom a {
    color: #6b7280;
    text-decoration: none;
}

/* ===== SIDEBAR OVERLAY & MOBİL HEADER ===== */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 999998;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    backdrop-filter: blur(2px);
    display: none;
}

.sidebar-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.sidebar-mobile-hdr {
    display: none;
}

/* ===== MOBİL SIDEBAR ===== */
@media (max-width: 768px) {

    .sidebar-overlay {
        display: block;
    }

    .sidebar-mobile-hdr {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 20px;
        border-bottom: 1px solid #e5e7eb;
        margin-bottom: 10px;
    }

    .sidebar {
        position: fixed !important;
        left: -280px !important;
        top: 0 !important;
        width: 270px !important;
        height: 100vh !important;
        z-index: 999999 !important;
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
        padding-top: 0 !important;
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
    }

    .sidebar.active {
        left: 0 !important;
    }

    /* Sidebar açılma animasyonu — soldan kayma */
    .sidebar .sidebar-nav .nav-item,
    .sidebar .sidebar-footer .footer-link {
        opacity: 0;
        transform: translateX(-20px);
        transition: opacity 0.3s ease, transform 0.3s ease;
    }

    .sidebar.active .sidebar-nav .nav-item,
    .sidebar.active .sidebar-footer .footer-link {
        opacity: 1;
        transform: translateX(0);
    }

    /* Her bir öğeye sıralı gecikme — soldan gelme efekti */
    .sidebar.active .sidebar-nav .nav-item:nth-child(1) {
        transition-delay: 0.05s;
    }

    .sidebar.active .sidebar-nav .nav-item:nth-child(2) {
        transition-delay: 0.08s;
    }

    .sidebar.active .sidebar-nav .nav-item:nth-child(3) {
        transition-delay: 0.11s;
    }

    .sidebar.active .sidebar-nav .nav-item:nth-child(4) {
        transition-delay: 0.14s;
    }

    .sidebar.active .sidebar-nav .nav-item:nth-child(5) {
        transition-delay: 0.17s;
    }

    .sidebar.active .sidebar-nav .nav-item:nth-child(6) {
        transition-delay: 0.20s;
    }

    .sidebar.active .sidebar-nav .nav-item:nth-child(7) {
        transition-delay: 0.23s;
    }

    .sidebar.active .sidebar-footer .footer-link:nth-child(1) {
        transition-delay: 0.26s;
    }

    .sidebar.active .sidebar-footer .footer-link:nth-child(2) {
        transition-delay: 0.29s;
    }
}

/* ===== DARK THEME SIDEBAR ===== */
body.dark-theme .sidebar {
    background: #1e1e1e;
    border-right-color: #333;
}

body.dark-theme .sidebar::before {
    opacity: 0.08;
}

body.dark-theme .nav-item,
body.dark-theme .footer-link {
    color: #9ca3af;
}

body.dark-theme .nav-item:hover,
body.dark-theme .footer-link:hover {
    background: #2a2a2a;
    color: #f9fafb;
}

body.dark-theme .nav-item.active {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border-right-color: #10b981;
}

body.dark-theme .sidebar-footer {
    border-top-color: #333;
}

body.dark-theme .sidebar-bottom {
    color: #6b7280;
}

body.dark-theme .sidebar-bottom a {
    color: #6b7280;
}

body.dark-theme .sidebar-mobile-hdr {
    border-bottom-color: #333;
}

body.dark-theme .sidebar-mobile-hdr span {
    color: #f9fafb !important;
}

body.dark-theme .sidebar-mobile-hdr button {
    color: #9ca3af !important;
}

/* ===== MASAÜSTÜ SIDEBAR DARALTMA (COLLAPSE) ===== */
@media (min-width: 769px) {
    body.sidebar-collapsed .sidebar {
        transform: translateX(-100%);
    }

    body.sidebar-collapsed .main-content {
        margin-left: 0;
    }

    /* Main content padding ve grid yapıları bu durumda genişlemeli */
    body.sidebar-collapsed .category-filters {
        left: 0 !important;
    }

    body.sidebar-collapsed .mm-vertical-panel {
        left: 20px !important;
    }

    body.sidebar-collapsed .mm-overlay-focus,
    body.sidebar-collapsed .mm-active-bridge {
        left: 0 !important;
        width: 100% !important;
    }
}

/* Butonu mobilde gizle */
@media (max-width: 768px) {
    .desktop-sidebar-toggle {
        display: none !important;
    }
}