/* Sidebar Styles - Updated */
.sidebar {
    width: 280px;
    height: 100vh;
    background: linear-gradient(135deg, #000033 0%, #000066 100%);
    position: fixed;
    left: 0;
    top: 0;
    z-index: 1000;
    overflow-y: auto;
    transition: all 0.3s ease;
    box-shadow: 2px 0 5px rgba(0,0,0,0.1);
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    background: rgba(0,0,0,0.1);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    color: white;
    text-decoration: none;
}

.sidebar-logo {
    height: 40px;
    margin-right: 12px;
}

.brand-text {
    font-size: 20px;
    font-weight: 600;
}

.sidebar-menu {
    padding: 20px 0;
}

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

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

.nav-link {
    display: flex;
    align-items: center;
    padding: 14px 20px;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    cursor: pointer;
    user-select: none;
}

.nav-link:hover {
    background-color: rgba(255,255,255,0.1);
    color: white;
    text-decoration: none;
}

.nav-link.active {
    background-color: rgba(255,255,255,0.2);
    color: white;
    border-right: 4px solid #fff;
    font-weight: 600;
}

.nav-icon {
    width: 20px;
    margin-right: 15px;
    text-align: center;
    font-size: 16px;
}

.nav-text {
    flex: 1;
    font-size: 15px;
}

/* Submenu Styles - Fixed */
.has-submenu .submenu-arrow {
    margin-left: auto;
    transition: transform 0.3s ease;
    font-size: 12px;
}

.has-submenu.open .submenu-arrow {
    transform: rotate(90deg);
}

.submenu {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background-color: rgba(0,0,0,0.2);
}

.submenu-item {
    margin: 0;
}

.submenu-link {
    display: flex;
    align-items: center;
    padding: 12px 20px 12px 55px;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 14px;
    cursor: pointer;
    user-select: none;
}

.submenu-link:hover {
    background-color: rgba(255,255,255,0.1);
    color: white;
    text-decoration: none;
    padding-left: 60px;
}

.submenu-link.active {
    background-color: rgba(255,255,255,0.15);
    color: white;
    border-right: 3px solid rgba(255,255,255,0.8);
    font-weight: 500;
    padding-left: 60px;
}

.submenu-icon {
    width: 14px;
    margin-right: 12px;
    text-align: center;
    font-size: 12px;
}

/* Divider */
.nav-divider {
    height: 1px;
    background-color: rgba(255,255,255,0.2);
    margin: 20px 20px;
}

/* Logout Special Styling */
.logout-link {
    color: #ffb3b3 !important;
    margin-top: 10px;
}

.logout-link:hover {
    background-color: rgba(255,107,107,0.2) !important;
    color: #ff8a80 !important;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar.mobile-open {
        transform: translateX(0);
    }
    
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.5);
        z-index: 999;
    }
    
    body.sidebar-open .sidebar-overlay {
        display: block;
    }
    
    .mobile-menu-toggle {
        display: block;
        background: none;
        border: none;
        font-size: 20px;
        color: #333;
        cursor: pointer;
        padding: 10px;
    }
}

@media (min-width: 769px) {
    .mobile-menu-toggle {
        display: none;
    }
}

/* Main content adjustment */
.main-content {
    margin-left: 280px;
    padding: 20px;
    min-height: 100vh;
    background-color: #f8f9fa;
    transition: margin-left 0.3s ease;
}

@media (max-width: 768px) {
    .main-content {
        margin-left: 0;
    }
}

/* Loading animation for submenu */
.submenu {
    will-change: max-height;
}

/* Smooth scrolling for sidebar */
.sidebar {
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.3) transparent;
}

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

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

.sidebar::-webkit-scrollbar-thumb {
    background-color: rgba(255,255,255,0.3);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background-color: rgba(255,255,255,0.5);
}

/* Login Page Modern Styles */
.login-page {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.login-box {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

.login-logo {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo h2, .login-logo h4 {
    color: white;
    margin: 0;
    font-weight: 600;
}

.login-logo h2 {
    font-size: 2rem;
}

.login-logo h4 {
    font-size: 1.2rem;
    margin-top: 5px;
}

.card {
    border-radius: 15px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.3);
    border: none;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
}

.login-card-body {
    padding: 40px;
}

.login-box-msg {
    font-size: 1.1rem;
    color: #333;
    margin-bottom: 30px;
    text-align: center;
}

.input-group-text {
    background-color: #f8f9fa;
    border-color: #dee2e6;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 25px;
    padding: 10px 20px;
    font-weight: 600;
    transition: transform 0.2s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
}

.form-check-label {
    color: #666;
}

/* Footer for Login Page */
.login-footer {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    text-align: center;
    font-size: 0.9rem;
}

.login-footer a {
    color: #e0f7ff;
    text-decoration: none;
}

.login-footer a:hover {
    text-decoration: underline;
}
