/* Dashboard Sidebar - DHA Bahawalpur */

.dashboard-sidebar {
    width: 280px;
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px);
    border-right: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 
        25px 0 50px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(255, 255, 255, 0.05);
    transition: transform 0.3s ease;
    overflow-y: auto;
}

.dashboard-sidebar.hidden {
    transform: translateX(-100%);
}

/* Sidebar Header */
.sidebar-header {
    min-height: 80px;
    height: 80px;
    display: flex;
    align-items: center !important;
    justify-content: flex-start;
    padding: 0 !important;
    margin: 0 !important;
    background: #f8f8f8; /* TEMP: for debugging, remove after */
}

.logo-container {
    display: flex;
    align-items: center;
    height: 80px;
    padding: 0 0.5rem;
    position: relative;
    gap: 0.5rem;
}

.logo-spacer {
    flex: 1 1 0;
}

.logo-img {
    max-height: 40px;
    width: auto;
    display: block;
    margin: 0;
    padding: 0;
    align-self: center;
}

.logo-text {
    color: white;
    font-size: 1.1rem;
    font-weight: 700;
    background: linear-gradient(45deg, #ffffff, var(--accent-color));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-toggle {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    transition: all 0.3s ease;
    display: none;
}

.sidebar-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

/* Sidebar Menu */
.sidebar-menu {
    padding: 1rem 0;
    height: calc(100vh - 120px);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.menu-list {
    list-style: none;
    padding: 0 1rem;
}

.menu-item {
    margin-bottom: 0.5rem;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.menu-item:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: translateX(5px);
}

.menu-item.active {
    background: linear-gradient(135deg, 
        rgba(234, 85, 71, 0.2), 
        rgba(253, 198, 44, 0.15)
    );
    border: 1px solid rgba(253, 198, 44, 0.3);
    box-shadow: 0 8px 20px rgba(234, 85, 71, 0.2);
}

.menu-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.2rem;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.menu-link:hover {
    color: white;
}

.menu-item.active .menu-link {
    color: white;
    font-weight: 600;
}

.menu-link i {
    font-size: 1.1rem;
    min-width: 20px;
    transition: all 0.3s ease;
}

.menu-item.active .menu-link i {
    color: var(--accent-color);
    text-shadow: 0 0 10px rgba(253, 198, 44, 0.5);
}

.menu-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 3px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    transform: scaleY(0);
    transition: transform 0.3s ease;
    border-radius: 0 3px 3px 0;
}

.menu-item.active .menu-link::before {
    transform: scaleY(1);
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.logout-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    padding: 1rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 10px;
    color: #ef4444;
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(239, 68, 68, 0.2);
}

.logout-btn i {
    font-size: 1rem;
}

/* Menu Animation */
@keyframes menuSlideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.menu-item {
    animation: menuSlideIn 0.5s ease-out;
    animation-fill-mode: both;
}

.menu-item:nth-child(1) { animation-delay: 0.1s; }
.menu-item:nth-child(2) { animation-delay: 0.2s; }
.menu-item:nth-child(3) { animation-delay: 0.3s; }
.menu-item:nth-child(4) { animation-delay: 0.4s; }
.menu-item:nth-child(5) { animation-delay: 0.5s; }

/* Sidebar Backdrop for Mobile */
.sidebar-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.sidebar-backdrop.active {
    opacity: 1;
    visibility: visible;
}

/* Sidebar Collapsed State */
.dashboard-sidebar.collapsed {
    width: 80px;
}

.dashboard-sidebar.collapsed .logo-text,
.dashboard-sidebar.collapsed .menu-link span {
    opacity: 0;
    visibility: hidden;
}

.dashboard-sidebar.collapsed .logo-container {
    justify-content: center;
}

.dashboard-sidebar.collapsed .menu-link {
    justify-content: center;
    padding: 1rem;
}

.dashboard-sidebar.collapsed .sidebar-footer .logout-btn span {
    display: none;
}

/* Sidebar Scrollbar */
.dashboard-sidebar::-webkit-scrollbar {
    width: 4px;
}

.dashboard-sidebar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.dashboard-sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
}

.dashboard-sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Sidebar Styles */
.sidebar {
    width: 280px;
    background: white;
    border-right: 1px solid #e2e8f0;
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    z-index: 1000;
    overflow-y: auto;
    transition: transform 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.sidebar.hidden {
    transform: translateX(-100%);
}

.sidebar-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #f1f5f9;
    background: linear-gradient(135deg, #fef7f0 0%, #ffffff 100%);
    text-align: center;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-img {
    max-height: 48px;
    width: auto;
    transition: all 0.3s ease;
    cursor: pointer;
}

.logo-img:hover {
    transform: scale(1.1);
    filter: brightness(1.1);
}

.logo-text {
    text-align: center;
}

.logo-text h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0;
    transition: all 0.3s ease;
}

.logo-text span {
    font-size: 0.7rem;
    color: var(--secondary-color);
    font-weight: 500;
    display: block;
    margin-top: 0.1rem;
}

.logo-container:hover .logo-text h3 {
    color: #d63431;
}

.sidebar-close {
    background: #fff;
    border-radius: 50%;
    border: none;
    font-size: 2rem;
    color: #ea5547;
    cursor: pointer;
    z-index: 2;
    padding: 0;
    line-height: 1;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: center;
}

/* Navigation */
.nav-menu {
    padding: 1rem 0;
}

.nav-item {
    margin: 0.5rem 1rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 12px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.nav-link:hover {
    background: #f8fafc;
    color: var(--text-primary);
    transform: translateX(5px);
}

.nav-item.active .nav-link {
    background: linear-gradient(135deg, rgba(234, 85, 71, 0.1) 0%, rgba(234, 85, 71, 0.05) 100%);
    color: var(--primary-color);
    border: 1px solid rgba(234, 85, 71, 0.2);
    box-shadow: 0 4px 12px rgba(234, 85, 71, 0.15);
}

.nav-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-text {
    font-weight: 500;
    font-size: 0.9rem;
}

.nav-item.active .nav-text {
    font-weight: 600;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid #f1f5f9;
    background: #fafbfc;
    margin-top: auto;
}

.logout-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem;
    background: transparent;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    color: var(--text-secondary);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    background: #fee2e2;
    border-color: #fecaca;
    color: #dc2626;
    transform: translateY(-2px);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        z-index: 1001;
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .sidebar-close {
        display: block;
    }
}

/* Large Screen Sidebar Optimization (2198px - 2560px) */
@media (min-width: 2198px) and (max-width: 2560px) {
    .sidebar {
        width: 400px !important;
        min-width: 400px !important;
        padding: 3rem 0;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
    }
    
    .sidebar-header {
        padding: 0 3rem 3rem 3rem;
        margin-bottom: 3rem;
        height: 130px;
    }
    
    .logo-img {
        height: 80px;
        width: auto;
        max-height: 80px;
    }
    
    .logo-text h3 {
        font-size: 1.5rem;
        font-weight: 800;
    }
    
    .logo-text span {
        font-size: 0.95rem;
        font-weight: 600;
    }
    
    .nav-menu {
        padding: 0 2.5rem;
    }
    
    .nav-item {
        margin-bottom: 1rem;
    }
    
    .nav-link {
        padding: 2rem 2.5rem;
        border-radius: 20px;
        font-size: 1.3rem;
        min-height: 80px;
        align-items: center;
    }
    
    .nav-icon {
        width: 30px;
        height: 30px;
        font-size: 1.6rem;
        margin-right: 1.6rem;
    }
    
    .nav-text {
        font-size: 1.3rem;
        font-weight: 700;
        letter-spacing: 0.5px;
    }
    
    .nav-item.active .nav-link {
        box-shadow: 0 10px 30px rgba(234, 85, 71, 0.3);
        border: 3px solid rgba(234, 85, 71, 0.5);
    }
    
    .sidebar-footer {
        padding: 3rem 2.5rem 2.5rem 2.5rem;
        margin-top: 3rem;
    }
    
    .logout-btn {
        padding: 2rem 2.5rem;
        font-size: 1.3rem;
        border-radius: 20px;
        min-height: 80px;
        font-weight: 700;
    }
    
    .logout-btn i {
        font-size: 1.6rem;
        margin-right: 1.4rem;
    }
}

@media (max-width: 900px) {
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 260px;
    height: 100vh;
    background: #fff;
    z-index: 1200;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
    box-shadow: 2px 0 8px rgba(0,0,0,0.08);
    display: block;
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .backdrop {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4);
    z-index: 1100;
    display: block;
    pointer-events: auto;
  }
  .sidebar-close {
    display: block;
  }
} 