/* =============================================
   ENTERPRISE OFF-CANVAS SIDEBAR
   Modern, Professional Design with Orange Theme
   ============================================= */

:root {
    --sidebar-primary: #ed5233;
    --sidebar-primary-light: #f16540;
    --sidebar-primary-dark: #d63d20;
    --sidebar-secondary: #2c3e50;
    --sidebar-accent: #f8f9fa;
    --sidebar-text: #333333;
    --sidebar-text-light: #6c757d;
    --sidebar-border: #e9ecef;
    --sidebar-shadow: 0 0 30px rgba(237, 82, 51, 0.15);
    --sidebar-overlay: rgba(0, 0, 0, 0.5);
    --sidebar-width: 350px;
    --sidebar-width-mobile: 280px;
    --animation-speed: 0.3s;
    --animation-ease: cubic-bezier(0.4, 0.0, 0.2, 1);
}

/* =============================================
   SIDEBAR OVERLAY & BACKDROP
   ============================================= */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: var(--sidebar-overlay);
    z-index: 1049;
    opacity: 0;
    visibility: hidden;
    transition: all var(--animation-speed) var(--animation-ease);
    backdrop-filter: blur(4px);
}

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

/* =============================================
   MAIN SIDEBAR CONTAINER
   ============================================= */
.enterprise-sidebar {
    position: fixed;
    top: 0;
    left: -100%;
    width: var(--sidebar-width);
    height: 100vh;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    box-shadow: var(--sidebar-shadow);
    z-index: 1050;
    transition: all var(--animation-speed) var(--animation-ease);
    overflow-y: auto;
    overflow-x: hidden;
    border-right: 1px solid var(--sidebar-border);
    display: flex;
    flex-direction: column;
}

.enterprise-sidebar.active {
    left: 0;
}

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

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

.enterprise-sidebar::-webkit-scrollbar-thumb {
    background: var(--sidebar-primary);
    border-radius: 3px;
    opacity: 0.6;
}

.enterprise-sidebar::-webkit-scrollbar-thumb:hover {
    opacity: 1;
}

/* =============================================
   SIDEBAR HEADER
   ============================================= */
.sidebar-header {
    padding: 25px 20px;
    background: linear-gradient(135deg, var(--sidebar-primary) 0%, var(--sidebar-primary-light) 100%);
    color: white;
    position: relative;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="75" cy="75" r="1" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.5;
    pointer-events: none;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 15px;
    position: relative;
    z-index: 1;
}

.sidebar-brand img {
    width: 45px;
    height: 45px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    padding: 8px;
    backdrop-filter: blur(10px);
}

.brand-text {
    flex: 1;
}

.brand-title {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
    line-height: 1.2;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.brand-subtitle {
    font-size: 12px;
    opacity: 0.9;
    margin: 2px 0 0 0;
    font-weight: 400;
}

.sidebar-close {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
}

.sidebar-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

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

/* =============================================
   USER PROFILE SECTION
   ============================================= */
.sidebar-profile {
    padding: 20px;
    border-bottom: 1px solid var(--sidebar-border);
    background: linear-gradient(135deg, rgba(237, 82, 51, 0.05) 0%, rgba(248, 249, 250, 0.8) 100%);
}

.profile-card {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(237, 82, 51, 0.1);
    transition: all 0.2s ease;
    cursor: pointer;
    border: 1px solid rgba(237, 82, 51, 0.1);
}

.profile-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(237, 82, 51, 0.15);
}

.profile-avatar {
    position: relative;
}

.profile-avatar img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 3px solid var(--sidebar-primary);
    object-fit: cover;
}

.profile-status {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 14px;
    height: 14px;
    background: #28a745;
    border: 2px solid white;
    border-radius: 50%;
}

.profile-info h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--sidebar-text);
    line-height: 1.2;
}

.profile-info p {
    margin: 2px 0 0 0;
    font-size: 13px;
    color: var(--sidebar-text-light);
    line-height: 1.2;
}

.profile-badge {
    background: linear-gradient(135deg, var(--sidebar-primary) 0%, var(--sidebar-primary-light) 100%);
    color: white;
    font-size: 10px;
    padding: 3px 8px;
    border-radius: 12px;
    font-weight: 600;
    margin-top: 4px;
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* =============================================
   NAVIGATION MENU
   ============================================= */
.sidebar-nav {
    flex: 1;
    padding: 20px 0;
}

.nav-section {
    margin-bottom: 30px;
    padding: 0 20px;
}

.nav-section-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--sidebar-text-light);
    margin: 0 0 12px 0;
    padding: 0 5px;
}

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

.nav-item {
    margin-bottom: 4px;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    color: var(--sidebar-text);
    text-decoration: none;
    border-radius: 12px;
    transition: all 0.2s ease;
    font-weight: 500;
    font-size: 14px;
    position: relative;
    overflow: hidden;
}

.nav-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--sidebar-primary) 0%, var(--sidebar-primary-light) 100%);
    transition: all 0.3s ease;
    z-index: -1;
}

.nav-link:hover::before,
.nav-link.active::before {
    left: 0;
}

.nav-link:hover,
.nav-link.active {
    color: white;
    transform: translateX(5px);
}

.nav-link i {
    width: 20px;
    height: 20px;
    margin-right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.2s ease;
}

.nav-link .nav-text {
    flex: 1;
}

.nav-badge {
    background: var(--sidebar-primary);
    color: white;
    font-size: 10px;
    padding: 3px 8px;
    border-radius: 10px;
    font-weight: 600;
    min-width: 20px;
    text-align: center;
    line-height: 1.2;
}

.nav-link:hover .nav-badge,
.nav-link.active .nav-badge {
    background: rgba(255, 255, 255, 0.2);
}

/* =============================================
   SUBMENU STYLES
   ============================================= */
.nav-item.has-submenu {
    margin-bottom: 8px;
}

.nav-submenu {
    list-style: none;
    padding: 0;
    margin: 8px 0 0 0;
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
    background: rgba(237, 82, 51, 0.05);
    border-radius: 8px;
    margin-left: 15px;
}

.nav-item.active .nav-submenu {
    max-height: 300px;
    padding: 8px 0;
    margin-top: 8px;
}

.nav-submenu .nav-link {
    padding: 8px 15px;
    font-size: 13px;
    color: var(--sidebar-text-light);
    border-radius: 6px;
    margin: 2px 8px;
}

.nav-submenu .nav-link:hover {
    background: white;
    color: var(--sidebar-primary);
    transform: translateX(3px);
}

.nav-submenu .nav-link i {
    width: 16px;
    height: 16px;
    font-size: 12px;
}

.submenu-toggle {
    transition: transform 0.3s ease;
}

.nav-item.active .submenu-toggle {
    transform: rotate(90deg);
}

/* =============================================
   QUICK ACTIONS & UTILITIES
   ============================================= */
.sidebar-footer {
    padding: 20px;
    border-top: 1px solid var(--sidebar-border);
    background: rgba(237, 82, 51, 0.02);
}

.quick-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 20px;
}

.quick-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px 8px;
    background: white;
    border: 1px solid var(--sidebar-border);
    border-radius: 12px;
    text-decoration: none;
    color: var(--sidebar-text);
    transition: all 0.2s ease;
    font-size: 12px;
    font-weight: 500;
    text-align: center;
}

.quick-action:hover {
    background: var(--sidebar-primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(237, 82, 51, 0.2);
}

.quick-action i {
    font-size: 20px;
    margin-bottom: 6px;
}

.sidebar-settings {
    text-align: center;
}

.settings-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    color: var(--sidebar-text-light);
    text-decoration: none;
    font-size: 13px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.settings-link:hover {
    background: rgba(237, 82, 51, 0.1);
    color: var(--sidebar-primary);
}

/* =============================================
   MOBILE RESPONSIVE DESIGN
   ============================================= */
@media (max-width: 768px) {
    :root {
        --sidebar-width: var(--sidebar-width-mobile);
    }
    
    .enterprise-sidebar {
        width: var(--sidebar-width-mobile);
    }
    
    .sidebar-header {
        padding: 20px 15px;
    }
    
    .brand-title {
        font-size: 16px;
    }
    
    .sidebar-profile {
        padding: 15px;
    }
    
    .profile-card {
        padding: 12px;
    }
    
    .profile-avatar img {
        width: 45px;
        height: 45px;
    }
    
    .nav-section {
        padding: 0 15px;
        margin-bottom: 25px;
    }
    
    .nav-link {
        padding: 10px 12px;
        font-size: 13px;
    }
    
    .sidebar-footer {
        padding: 15px;
    }
    
    .quick-actions {
        gap: 8px;
    }
    
    .quick-action {
        padding: 10px 6px;
        font-size: 11px;
    }
    
    .quick-action i {
        font-size: 18px;
        margin-bottom: 4px;
    }
}

@media (max-width: 480px) {
    :root {
        --sidebar-width: 260px;
    }
    
    .enterprise-sidebar {
        width: 260px;
    }
    
    .sidebar-header {
        padding: 15px 12px;
    }
    
    .brand-title {
        font-size: 15px;
    }
    
    .brand-subtitle {
        font-size: 11px;
    }
    
    .sidebar-close {
        width: 35px;
        height: 35px;
    }
    
    .nav-link {
        padding: 9px 10px;
        font-size: 12px;
    }
}

/* =============================================
   THEME VARIATIONS
   ============================================= */
.enterprise-sidebar.theme-dark {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
}

.enterprise-sidebar.theme-dark .sidebar-header {
    background: linear-gradient(135deg, var(--sidebar-primary-dark) 0%, var(--sidebar-primary) 100%);
}

.enterprise-sidebar.theme-dark .nav-link {
    color: #ecf0f1;
}

.enterprise-sidebar.theme-dark .nav-link:hover,
.enterprise-sidebar.theme-dark .nav-link.active {
    background: var(--sidebar-primary);
    color: white;
}

/* =============================================
   ANIMATIONS & EFFECTS
   ============================================= */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.enterprise-sidebar.active .nav-item {
    animation: slideInLeft 0.3s ease forwards;
}

.enterprise-sidebar.active .nav-item:nth-child(1) { animation-delay: 0.1s; }
.enterprise-sidebar.active .nav-item:nth-child(2) { animation-delay: 0.15s; }
.enterprise-sidebar.active .nav-item:nth-child(3) { animation-delay: 0.2s; }
.enterprise-sidebar.active .nav-item:nth-child(4) { animation-delay: 0.25s; }
.enterprise-sidebar.active .nav-item:nth-child(5) { animation-delay: 0.3s; }
.enterprise-sidebar.active .nav-item:nth-child(6) { animation-delay: 0.35s; }

.enterprise-sidebar.active .sidebar-profile {
    animation: fadeIn 0.4s ease forwards;
    animation-delay: 0.2s;
}

.enterprise-sidebar.active .sidebar-footer {
    animation: fadeIn 0.4s ease forwards;
    animation-delay: 0.4s;
}

/* =============================================
   ACCESSIBILITY IMPROVEMENTS
   ============================================= */
.nav-link:focus,
.quick-action:focus,
.sidebar-close:focus {
    outline: 2px solid var(--sidebar-primary);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* =============================================
   HIGH CONTRAST MODE
   ============================================= */
@media (prefers-contrast: high) {
    .enterprise-sidebar {
        border: 2px solid var(--sidebar-primary);
    }
    
    .nav-link {
        border: 1px solid transparent;
    }
    
    .nav-link:hover,
    .nav-link.active {
        border-color: white;
    }
}
