.sidebar-btn {
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 28px;
    color: #1e3a8a;
    transition: all 0.3s ease;
    padding: 8px;
    border-radius: 8px;
    background: transparent;
}

.sidebar-btn:hover {
    color: #3b82f6;
    background: rgba(59, 130, 246, 0.1);
}

.sidebar-btn:active {
    transform: scale(0.95);
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    display: none;
}

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

.sidebar {
    position: fixed;
    top: 0;
    right: -100%;
    width: 320px;
    max-width: 85%;
    height: 100vh;
    background: white;
    z-index: 9999;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    box-shadow: -5px 0 20px rgba(0, 0, 0, 0.15);
    flex-direction: column;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 #f3f4f6;
    display: none;
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: #f3f4f6;
}

.sidebar::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.sidebar.active {
    right: 0;
}

.sidebar-header {
    background: linear-gradient(135deg, #1e3a8a, #3b82f6);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 10;
}

.sidebar-header h3 {
    font-size: 20px;
    font-weight: 700;
    margin: 0;
}

.sidebar-close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.sidebar-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.sidebar-content {
    flex: 1;
    padding: 0;
}

.sidebar-section {
    border-bottom: 1px solid #e5e7eb;
    padding: 0;
}

.sidebar-section-title {
    padding: 16px 20px;
    background: #f8fafc;
    font-weight: 700;
    font-size: 14px;
    color: #1e3a8a;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0;
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    color: #374151;
    text-decoration: none;
    border-bottom: 1px solid #f3f4f6;
    transition: all 0.3s ease;
    font-size: 15px;
    background: white;
}

.sidebar-menu-item:hover {
    background: #f8fafc;
    color: #1e3a8a;
}

.sidebar-menu-item.active {
    background: #eff6ff;
    color: #1e3a8a;
    font-weight: 600;
}

.sidebar-menu-item i {
    font-size: 20px;
    width: 24px;
    flex-shrink: 0;
}

.sidebar-menu-item .badge {
    margin-left: auto;
    background: #fbbf24;
    color: #1f2937;
    font-size: 11px;
    font-weight: bold;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
}

.sidebar-categories {
    max-height: 400px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 #f3f4f6;
}

.sidebar-categories::-webkit-scrollbar {
    width: 4px;
}

.sidebar-categories::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-categories::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 2px;
}

.sidebar-categories::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.sidebar-footer {
    padding: 20px;
    background: #f8fafc;
    border-top: 1px solid #e5e7eb;
    margin-top: auto;
}

.sidebar-auth-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sidebar-auth-btn {
    padding: 14px 20px;
    border-radius: 12px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    text-align: center;
}

.sidebar-auth-btn.login {
    background: #1e3a8a;
    color: white;
}

.sidebar-auth-btn.login:hover {
    background: #1e40af;
}

.sidebar-auth-btn.signup {
    background: #22c55e;
    color: white;
}

.sidebar-auth-btn.signup:hover {
    background: #16a34a;
}

.sidebar-auth-btn i {
    font-size: 18px;
}

.sidebar-profile {
    background: linear-gradient(135deg, #1e3a8a, #3b82f6);
    color: white;
    padding: 20px;
    text-align: center;
}

.sidebar-profile-icon {
    width: 60px;
    height: 60px;
    background: white;
    color: #1e3a8a;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    font-size: 30px;
}

.sidebar-profile h4 {
    margin: 0 0 5px 0;
    font-size: 18px;
    font-weight: 700;
}

.sidebar-profile p {
    margin: 0;
    opacity: 0.9;
    font-size: 14px;
}

body.sidebar-open {
    overflow: hidden;
}

/* Show sidebar button only between 601px and 767px */
@media (min-width: 601px) and (max-width: 767px) {
    .sidebar-btn {
        display: flex;
    }

    .sidebar-overlay {
        display: block;
    }

    .sidebar {
        display: flex;
    }
}

@media (max-width: 767px) {
    .sidebar {
        width: 280px;
    }

    .sidebar-header h3 {
        font-size: 18px;
    }

    .sidebar-menu-item {
        padding: 14px 18px;
        font-size: 14px;
    }

    .sidebar-menu-item i {
        font-size: 18px;
        width: 20px;
    }
}

@media (max-width: 360px) {
    .sidebar {
        width: 100%;
        max-width: 100%;
    }
}