﻿/* Overlay for mobile */
.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    backdrop-filter: blur(3px);
    transition: opacity 0.3s ease;
}

    .overlay.active {
        display: block;
        opacity: 1;
    }


/* Sidebar Styles */
#sidebar {
    font-family: 'Roboto', sans-serif;
    position: fixed;
    top: 0;
    left: 0;
    width: 300px;
    height: 100%;
    background: #fff;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    box-shadow: 4px 0 15px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
}

    #sidebar.open {
        transform: translateX(0);
    }

/* Loading indicator */
#loading {
    padding: 20px;
    text-align: center;
    color: #718096;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

/* Sidebar Header */
.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: linear-gradient(90deg, #4a5568, #2d3748);
    color: white;
    font-size: 1.3rem;
    font-weight: 600;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.close-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 5px;
    transition: transform 0.2s ease;
    font-size: 1.2rem;
    cursor:pointer;
    margin: 0;
}

    .close-btn:hover {
        transform: rotate(90deg);
    }

/* Category Styles */
.category {
    padding: 15px 25px;
    cursor: pointer;
    position: relative;
    transition: background 0.3s ease, padding-left 0.3s ease;
    border-left: 3px solid transparent;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 1rem;
    color: #2d3748;
}

    .category:hover {
        background: #f1f5f9;
        border-left-color: #4a5568;
        padding-left: 30px;
    }

    .category.expandable::after {
        content: '\f078';
        font-family: 'Font Awesome 5 Free';
        font-weight: 900;
        font-size: 0.8rem;
        color: #718096;
        transition: transform 0.3s ease;
    }

    .category.expandable.expanded::after,
    .category.expandable.open::after {
        transform: rotate(-180deg);
    }

/* Subcategory Indentation */
.subcategory .category {
    padding-left: 40px;
    font-size: 0.95rem;
}

.child-category .category {
    padding-left: 55px;
    font-size: 0.9rem;
    color: #718096;
}

/* Dropdown Animation */
.subcategory,
.child-category {
    display: none;
    overflow: hidden;
    transition: all 0.3s ease-out;
}

    .subcategory.open,
    .child-category.open {
        display: block;
    }

/* Add link styling */
.category-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

/* Error message styling */
.error {
    padding: 15px;
    background-color: #fed7d7;
    color: #e53e3e;
    margin: 10px;
    border-radius: 5px;
    text-align: center;
}

/* Responsive Design */
@media (max-width: 768px) {
    #sidebar {
        width: 85%;
    }

    .category:hover {
        padding-left: 25px;
    }
}

/* Custom Scrollbar Styling */
#sidebar::-webkit-scrollbar {
    width: 8px;
}

#sidebar::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 4px;
}

#sidebar::-webkit-scrollbar-track {
    background: #edf2f7;
}
