/* ============================================
   LEFT MENU STYLES
   ============================================ */

/* Left Menu Container */
.sw-left-menu {
    position: fixed;
    left: 0;
    top: 0;
    width: 280px;
    height: 100vh;
    background: linear-gradient(180deg, #2c3e50 0%, #1a252f 100%);
    background-color: #2c3e50;
    /* Fallback solid color */
    color: white;
    z-index: 1040;
    overflow-y: auto;
    overflow-x: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
    padding-bottom: 80px;
    isolation: isolate;
    /* Create stacking context */
}

/* Header */
.sw-left-menu-header {
    padding: 1.25rem;
    background: linear-gradient(135deg, var(--sw-primary) 0%, #c0392b 100%);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    position: relative;
}

.sw-left-menu-logo {
    height: 36px;
    width: auto;
}

.sw-left-menu-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: white;
}

.sw-left-menu-close {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}

.sw-left-menu-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* User Section */
.sw-left-menu-user {
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: #253443;
    /* Solid background to prevent content bleeding */
}

.sw-left-menu-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--sw-primary) 0%, var(--sw-primary-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: white;
    flex-shrink: 0;
}

.sw-left-menu-user-info {
    overflow: hidden;
}

.sw-left-menu-user-name {
    font-weight: 700;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sw-left-menu-user-role {
    font-size: 0.75rem;
    opacity: 0.7;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Navigation */
.sw-left-menu-nav {
    padding: 0.75rem 0 4rem 0;
}

.sw-left-menu-section {
    margin-bottom: 0.5rem;
}

.sw-left-menu-section:last-child {
    margin-bottom: 2rem;
}

.sw-left-menu-section-title {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: rgba(255, 255, 255, 0.4);
    padding: 0.75rem 1.25rem 0.5rem;
    font-weight: 600;
}

.sw-left-menu-link {
    display: flex;
    align-items: center;
    padding: 0.65rem 1.25rem;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 0.875rem;
    gap: 0.75rem;
    border-left: 3px solid transparent;
}

.sw-left-menu-link:hover {
    background: rgba(255, 255, 255, 0.08);
    color: white;
    border-left-color: rgba(255, 255, 255, 0.3);
}

.sw-left-menu-link.active {
    background: rgba(var(--sw-primary-rgb), 0.2);
    color: white;
    border-left-color: var(--sw-primary);
    font-weight: 600;
}

.sw-left-menu-link i {
    width: 20px;
    font-size: 0.9rem;
    opacity: 0.9;
    text-align: center;
}

.sw-left-menu-link-danger {
    color: #e74c3c !important;
}

.sw-left-menu-link-danger:hover {
    background: rgba(231, 76, 60, 0.15) !important;
    border-left-color: #e74c3c !important;
}

/* Mobile Menu Toggle Button */
.sw-left-menu-toggle {
    position: fixed;
    left: 1rem;
    top: 0.75rem;
    z-index: 1035;
    background: var(--sw-primary);
    color: white;
    border: none;
    width: 44px;
    height: 44px;
    border-radius: var(--sw-radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    cursor: pointer;
    box-shadow: var(--sw-shadow-md);
    transition: background 0.2s, transform 0.2s;
}

.sw-left-menu-toggle:hover {
    background: var(--sw-primary-dark);
    transform: scale(1.05);
}

/* Mobile Overlay */
.sw-left-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1039;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.sw-left-menu-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* Responsive Behavior */
/* Responsive Behavior */
@media (max-width: 991.98px) {
    /* Skater Mobile Menu - Slide Down Implementation */

    /* Reposition Toggle Button */
    .sw-left-menu-toggle {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
        left: auto;
        right: 15px;
        top: 15px;
        position: absolute;
        transition: transform 0.3s ease;
        background: transparent;
        color: var(--sw-primary);
        box-shadow: none;
        border: 2px solid var(--sw-primary);
    }

    .sw-left-menu-toggle:hover {
        background: var(--sw-primary);
        color: white;
        transform: none;
    }

    /* Arrow Rotation Logic */
    .sw-left-menu-toggle i {
        transition: transform 0.3s ease;
    }

    .sw-left-menu-toggle.active i {
        transform: rotate(180deg);
    }

    /* Menu Container - Full Width, Slide height */
    .sw-left-menu {
        width: 100%;
        max-width: 100%;
        height: auto;
        max-height: 0;
        /* Hidden by default */
        top: 72px;
        /* Below standard header height */
        left: 0;
        transform: none;
        /* Disable X translation */
        transition: max-height 0.4s ease-in-out, padding 0.4s ease, box-shadow 0.3s ease;
        overflow-y: hidden;
        border-radius: 0 0 15px 15px;
        box-shadow: none;
        /* No shadow when closed */
        padding-bottom: 0;
        z-index: 1045;
        background: linear-gradient(180deg, #2c3e50 0%, #1a252f 100%);
    }

    /* Shown State */
    .sw-left-menu.show {
        transform: none;
        /* Ensure no X translate */
        max-height: 85vh;
        overflow-y: auto;
        padding-bottom: 20px;
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
    }

    body.menu-open {
        overflow: hidden;
    }

    /* Hide Close Button inside menu */
    .sw-left-menu-close {
        display: none;
    }

    /* Adjust inner padding */
    .sw-left-menu-header {
        display: none;
    }

    .sw-left-menu-user {
        margin-top: 10px;
    }

    /* Links touch targets */
    .sw-left-menu-link {
        padding: 12px 24px;
        min-height: 48px;
    }

    /* Overlay adjustments */
    .sw-left-menu-overlay {
        z-index: 1040;
        top: 72px;
    }

    /* Hide HELP section on mobile if needed, or allow scrolling */
    .sw-left-menu-section:last-child {
        display: block;
        /* Allow scrolling now */
        margin-bottom: 40px;
    }
}

@media (min-width: 992px) {

    .sw-left-menu-toggle,
    .sw-left-menu-overlay,
    .sw-left-menu-close {
        display: none !important;
    }

    /* Page layout with left menu */
    .sw-page-with-menu {
        margin-left: 280px;
    }

    .sw-page-with-menu .sw-page-header {
        margin-left: 0;
    }
}

/* Scrollbar Styling for Left Menu */
.sw-left-menu::-webkit-scrollbar {
    width: 6px;
}

.sw-left-menu::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.sw-left-menu::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.sw-left-menu::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}



/* iPhone Safe Area Support for Left Menu */
@supports (padding: env(safe-area-inset-top)) {
    @media (max-width: 991.98px) {
        .sw-left-menu {
            padding-top: env(safe-area-inset-top);
            padding-bottom: calc(80px + env(safe-area-inset-bottom));
        }

        .sw-left-menu-header {
            padding-top: calc(1.25rem + env(safe-area-inset-top));
        }

        .sw-left-menu-toggle {
            top: calc(12px + env(safe-area-inset-top));
        }
    }
}