/* 
 * sidebar.css
 * Dedicated styles for the responsive mobile sidebar
 */

/* Overlay/Backdrop */
.mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    backdrop-filter: blur(2px);
}

.mobile-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Sidebar Container */
.mobile-sidebar {
    position: fixed;
    top: 110px;
    right: -300px;
    /* Start off-screen */
    width: 280px;
    max-width: 85vw;
    height: 100%;
    background: #ffffff;
    z-index: 2001;
    /* box-shadow: -4px 0 15px rgba(0, 0, 0, 0.1); */
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
}

.mobile-sidebar.active {
    transform: translateX(-300px);
    /* Slide in */
}

/* Sidebar Header - Removed per user request */
/* .sidebar-header {
    display: none;
} */


.close-sidebar-btn {
    background: transparent;
    border: none;
    font-size: 1.25rem;
    color: #6b7280;
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.close-sidebar-btn:hover {
    background: #f3f4f6;
    color: #ef4444;
}

/* Sidebar Navigation */
.sidebar-nav {
    padding: 1rem 0;
    flex: 1;
}

.sidebar-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-item {
    border-bottom: 1px solid #f9fafb;
}

.sidebar-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 1.5rem;
    text-decoration: none;
    color: #374151;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.sidebar-link:hover {
    color: #d4af37;
    /* Primary Color */
    background: #fffdf5;
}

.sidebar-link.active {
    color: #d4af37;
    background: #fffdf5;
    border-left: 3px solid #d4af37;
}

.sidebar-link i.arrow-icon {
    font-size: 1.1rem;
    color: #9ca3af;
    transition: transform 0.3s ease;
}

.sidebar-item.expanded>.sidebar-link i.arrow-icon {
    transform: rotate(180deg);
    color: #d4af37;
}

/* Nested Submenu (Level 1) */
.sidebar-submenu {
    max-height: 0;
    overflow: hidden;
    background: #fafbfc;
    transition: max-height 0.3s cubic-bezier(0, 1, 0, 1);
    /* Smooth accordion */
}

.sidebar-item.expanded>.sidebar-submenu {
    max-height: 1000px;
    /* Arbitrary large height for expansion */
    transition: max-height 0.5s ease-in-out;
}

.submenu-item {
    margin: 0;
}

.submenu-link {
    padding: 0.75rem 1.5rem 0.75rem 1.5rem;
    /* Indented */
    font-size: 0.9rem;
    color: #4b5563;
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-decoration: none;
    transition: all 0.2s;
    border-bottom: 1px solid #f3f4f6;
}

.submenu-link:hover {
    color: #d4af37;
    background: #f3f4f6;
}

.submenu-link.active {
    color: #d4af37;
    font-weight: 600;
}

/* Nested Submenu (Level 2 - Grandchildren) */
.sidebar-grandmenu {
    max-height: 0;
    overflow: hidden;
    background: #f3f4f6;
    transition: max-height 0.3s cubic-bezier(0, 1, 0, 1);
}

.submenu-item.expanded>.sidebar-grandmenu {
    max-height: 500px;
    transition: max-height 0.4s ease-in-out;
}

.grandmenu-link {
    padding: 0.65rem 1.5rem 0.65rem 1.5rem;
    /* More Indented */
    font-size: 0.85rem;
    color: #6b7280;
    display: block;
    text-decoration: none;
    transition: color 0.2s;
}

.grandmenu-link:hover {
    color: #d4af37;
}

.grandmenu-link i {
    font-size: 0.8rem;
    opacity: 0.7;
    margin-right: 0.5rem;
    color: #d4af37;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid #e5e7eb;
    background: #ffffff;
}

.sidebar-cta-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0.875rem;
    background: #d4af37;
    color: #ffffff !important;
    font-weight: 600;
    border-radius: 8px;
    text-decoration: none;
    transition: background 0.2s ease;
    gap: 0.5rem;
}

.sidebar-cta-btn:hover {
    background: #b8941f;
}

/* Scroll Lock helper */
body.no-scroll {
    overflow: hidden !important;
    height: 100vh;
}

/* Hide on Desktop */
@media (min-width: 992px) {

    .mobile-sidebar,
    .mobile-overlay {
        display: none !important;
    }
}