/* Responsive Sidebar CSS for MindEverest */

/* Mobile Menu Toggle Button */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1001;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    outline: none;
}

.mobile-menu-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.mobile-menu-toggle:active {
    transform: scale(0.95);
}

.mobile-menu-toggle.active {
    background: #e74c3c;
}

.mobile-menu-toggle:focus {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}

/* Overlay for mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.sidebar-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* Enhanced Sidebar Styles */
.sidebar {
    width: 280px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
    transition: transform 0.3s ease, width 0.3s ease;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    transform: translateX(0);
}

.sidebar.active {
    transform: translateX(0);
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    position: relative;
    background: rgba(255, 255, 255, 0.05);
}

.sidebar-header h2 {
    font-size: 1.5rem;
    margin-bottom: 5px;
    font-weight: 600;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.sidebar-header p {
    font-size: 0.9rem;
    opacity: 0.9;
    color: rgba(255, 255, 255, 0.9);
}

.sidebar-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-nav li {
    margin: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
    position: relative;
    overflow: hidden;
    font-weight: 500;
    font-size: 1rem;
}

.sidebar-nav a::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s ease;
}

.sidebar-nav a:hover::before {
    left: 100%;
}

.sidebar-nav a:hover,
.sidebar-nav li.active a {
    background-color: rgba(255, 255, 255, 0.15);
    border-left-color: #fff;
    transform: translateX(5px);
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.sidebar-nav i {
    margin-right: 12px;
    width: 20px;
    text-align: center;
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.9);
}

.sidebar-nav a:hover i,
.sidebar-nav li.active a i {
    color: white;
}

/* Enhanced button styles in sidebar */
.sidebar .btn {
    margin: 10px 20px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.sidebar .btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* Main Content Adjustments */
.main-content {
    flex: 1;
    margin-left: 280px;
    padding: 20px;
    transition: margin-left 0.3s ease;
    min-height: 100vh;
}

/* Desktop sidebar visibility - ALWAYS SHOW ON DESKTOP */
@media (min-width: 1025px) {
    .sidebar {
        transform: translateX(0) !important;
        display: block !important;
    }
    
    .main-content {
        margin-left: 280px !important;
    }
    
    .mobile-menu-toggle {
        display: none !important;
    }
    
    .sidebar-overlay {
        display: none !important;
    }
}

/* Responsive Breakpoints */
@media (max-width: 1024px) {
    .mobile-menu-toggle {
        display: flex !important;
        align-items: center;
        justify-content: center;
        position: fixed;
        top: 20px;
        left: 20px;
        z-index: 1001;
    }
    
    .sidebar {
        transform: translateX(-100%);
        width: 280px;
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
        padding-top: 80px;
    }
    
    .sidebar-overlay {
        display: block;
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        max-width: 300px;
    }
    
    .sidebar-header {
        padding: 15px;
    }
    
    .sidebar-header h2 {
        font-size: 1.3rem;
    }
    
    .sidebar-nav a {
        padding: 12px 15px;
        font-size: 0.95rem;
    }
    
    .sidebar-nav i {
        font-size: 1rem;
    }
    
    .main-content {
        padding: 15px;
        padding-top: 70px;
    }
    
    .mobile-menu-toggle {
        top: 15px;
        left: 15px;
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
    }
    
    .sidebar-nav a {
        padding: 15px 20px;
        font-size: 1rem;
    }
    
    .sidebar-nav a:hover {
        background-color: rgba(255, 255, 255, 0.2);
    }
    
    .sidebar-nav i {
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .sidebar {
        width: 100%;
        max-width: 280px;
    }
    
    .sidebar-header {
        padding: 12px;
    }
    
    .sidebar-header h2 {
        font-size: 1.2rem;
    }
    
    .sidebar-nav a {
        padding: 10px 12px;
        font-size: 0.9rem;
    }
    
    .sidebar-nav i {
        font-size: 0.9rem;
    }
    
    .main-content {
        padding: 10px;
        padding-top: 60px;
    }
    
    .mobile-menu-toggle {
        top: 10px;
        left: 10px;
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .sidebar-nav a {
        padding: 12px 15px;
        font-size: 0.9rem;
    }
    
    .sidebar-nav i {
        font-size: 1rem;
    }
}

/* Animation for sidebar items */
.sidebar-nav li {
    animation: slideInLeft 0.5s ease forwards;
    opacity: 0;
    transform: translateX(-20px);
}

.sidebar-nav li:nth-child(1) { animation-delay: 0.1s; }
.sidebar-nav li:nth-child(2) { animation-delay: 0.2s; }
.sidebar-nav li:nth-child(3) { animation-delay: 0.3s; }
.sidebar-nav li:nth-child(4) { animation-delay: 0.4s; }
.sidebar-nav li:nth-child(5) { animation-delay: 0.5s; }
.sidebar-nav li:nth-child(6) { animation-delay: 0.6s; }
.sidebar-nav li:nth-child(7) { animation-delay: 0.7s; }
.sidebar-nav li:nth-child(8) { animation-delay: 0.8s; }
.sidebar-nav li:nth-child(9) { animation-delay: 0.9s; }
.sidebar-nav li:nth-child(10) { animation-delay: 1.0s; }

@keyframes slideInLeft {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Custom scrollbar for sidebar */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Focus styles for accessibility */
.sidebar-nav a:focus {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: -2px;
}

.mobile-menu-toggle:focus {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}

/* Loading state for sidebar */
.sidebar.loading {
    position: relative;
}

.sidebar.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Print styles */
@media print {
    .sidebar,
    .mobile-menu-toggle,
    .sidebar-overlay {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0 !important;
        padding: 0 !important;
    }
}

/* Additional mobile optimizations */
@media (max-width: 768px) {
    .sidebar-nav a {
        padding: 15px 20px;
        font-size: 1rem;
        border-radius: 0;
    }
    
    .mobile-menu-toggle {
        position: fixed;
        top: 15px;
        left: 15px;
        z-index: 1001;
    }
}

/* Ensure sidebar is always visible on desktop */
.sidebar {
    display: block;
    visibility: visible;
}

.sidebar-nav a {
    cursor: pointer;
    user-select: none;
}

.sidebar-nav a:hover,
.sidebar-nav li.active a {
    background-color: rgba(255, 255, 255, 0.15);
    border-left-color: #fff;
    transform: translateX(5px);
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.sidebar-header h2 {
    font-size: 1.5rem;
    margin-bottom: 5px;
    font-weight: 600;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.sidebar-header p {
    font-size: 0.9rem;
    opacity: 0.9;
    color: rgba(255, 255, 255, 0.9);
}

/* Desktop specific overrides */
@media (min-width: 1025px) {
    .sidebar {
        transform: translateX(0) !important;
        display: block !important;
        visibility: visible !important;
    }
    
    .main-content {
        margin-left: 280px !important;
    }
    
    .sidebar-overlay {
        display: none !important;
    }
}