/* =====================================================
   SIDEBAR - FIXED: Smooth Open/Close, No Jitter
   ===================================================== */

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 1999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 300px;
    height: 100%;
    background: linear-gradient(180deg, #0d0d0d, #1a1a2e);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    /* FIXED: Use transform instead of left for smooth animation */
    transform: translateX(-100%);
    -webkit-transform: translateX(-100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    /* GPU Acceleration */
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    will-change: transform;
}

.sidebar.active {
    transform: translateX(0);
    -webkit-transform: translateX(0);
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 20px 10px;
    flex-shrink: 0;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-logo img {
    width: 45px;
    height: 45px;
    border-radius: 10px;
    border: 2px solid var(--accent-pink);
}

.sidebar-logo span {
    color: #fff;
    font-size: 16px;
    font-weight: 700;
}

.sidebar-close {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 18px;
    background: rgba(255, 255, 255, 0.06);
    transition: background 0.2s ease, transform 0.3s ease;
    transform: translateZ(0);
}

.sidebar-close:hover {
    background: rgba(255, 0, 0, 0.15);
    transform: translateZ(0) rotate(90deg);
}

.sidebar-nav {
    flex: 1;
    padding: 20px 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

.sidebar-nav li a {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 25px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 15px;
    font-weight: 500;
    border-left: 3px solid transparent;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.sidebar-nav li a:hover {
    background: rgba(255, 255, 255, 0.04);
    color: #fff;
    border-left-color: var(--accent-pink);
}

.sidebar-nav li a i {
    width: 20px;
    text-align: center;
    font-size: 16px;
    color: var(--accent-pink);
}

.sidebar-social {
    display: flex;
    justify-content: center;
    gap: 15px;
    padding: 25px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}

.sidebar-social a {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 16px;
    background: rgba(255, 255, 255, 0.06);
    transition: background 0.2s ease, transform 0.2s ease;
    transform: translateZ(0);
}

.sidebar-social a:hover {
    background: var(--accent-pink);
    transform: translateZ(0) translateY(-3px);
}

/* Sidebar Divider */
.sidebar-nav li.sidebar-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 15px 20px;
    padding: 0;
}

.sidebar-nav li.sidebar-divider a {
    display: none;
}

/* Sidebar Section Title */
.sidebar-nav li.sidebar-section-title {
    padding: 10px 25px 5px;
    pointer-events: none;
}

.sidebar-nav li.sidebar-section-title span {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent-pink);
    opacity: 0.8;
}

.sidebar-nav li.sidebar-section-title span i {
    font-size: 12px;
}

/* Sidebar Flag */
.sidebar-nav li a .sidebar-flag {
    font-size: 18px;
    width: 20px;
    text-align: center;
}

/* Navbar Flag */
.nav-links li a .nav-flag {
    font-size: 16px;
    margin-right: 2px;
}