/* Sidebar Styles */
.sidebar {
    width: 280px;
    background-color: #ffffff;
    min-height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 1040;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 1px solid var(--acad-sphere-primary);
}



.user-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    text-align: center;
}

.user-avatar {
    width: 100px;
    height: 100px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    flex-shrink: 0;
}

.user-details {
    width: 100%;
}

.user-name {
    color: var(--acad-sphere-dark);
    font-weight: 600;
    margin: 0;
    font-size: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    color: var(--acad-sphere-primary);
    font-size: 0.85rem;
    margin: 0;
}

.sidebar-nav {
    padding: 1rem 0;
}

.sidebar-nav .nav {
    padding: 0 1rem;
}

.sidebar-nav .nav-link {
    color: var(--acad-sphere-dark);
    padding: 0.75rem 1rem;
    margin-bottom: 0.25rem;
    border-radius: 8px;
    text-decoration: none;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
    font-weight: 500;
    position: relative;
}

.sidebar-nav .nav-link:hover {
    background: var(--acad-sphere-primary);
    color: white;
    transform: translateX(5px);
}

.sidebar-nav .nav-link.active {
    background: var(--acad-sphere-primary);
    color: white;
    font-weight: 600;
}

.sidebar-nav .nav-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 8px;
    background: var(--acad-sphere-accent);
    border-radius: 0 4px 4px 0;
}

.sidebar-nav .nav-link i {
    width: 20px;
    text-align: center;
    font-size: 1.1rem;
}

.sidebar-nav .nav-link img,
.sidebar-nav form button.nav-link img {
    margin-right: 0.5rem;
    transition: filter 0.3s ease;
}

.sidebar-nav .nav-link:hover img,
.sidebar-nav .nav-link.active img,
.sidebar-nav form button.nav-link:hover img,
.sidebar-nav form button.nav-link.active img {
    filter: brightness(0) saturate(100%) invert(100%);
}

.sidebar-nav .badge {
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
    border-radius: 5px;
    background-color: var(--acad-sphere-secondary);
    color: white;
}

/* Responsive Design */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        width: 100%;
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }
}

/* Mobile Toggle Button */
.sidebar-toggle {
    display: none;
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 1050;
    background: var(--acad-sphere-primary);
    color: white;
    border: none;
    padding: 0.5rem;
    border-radius: 8px;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

@media (max-width: 768px) {
    .sidebar-toggle {
        display: block;
    }
}

/* Main Content Adjustment */
.main-content {
    margin-left: 280px;
    min-height: calc(100vh - 76px);
    /* Subtract header height */
    transition: margin-left 0.3s ease;
    padding: 0;
    background-color: var(--acad-sphere-background);
}

/* Navbar Adjustment for Sidebar */
.navbar-with-sidebar {
    margin-left: 150px;
    transition: margin-left 0.3s ease;
}

.navbar-with-sidebar .container {
    max-width: calc(100% - 280px);
    transition: max-width 0.3s ease;
}

/* Footer Adjustment for Sidebar */
.footer-with-sidebar {
    margin-left: 280px;
    transition: margin-left 0.3s ease;
}

.footer-with-sidebar .container {
    max-width: calc(100% - 280px);
    transition: max-width 0.3s ease;
}

@media (max-width: 768px) {
    .main-content {
        margin-left: 0;
    }

    .navbar-with-sidebar {
        margin-left: 0;
    }

    .navbar-with-sidebar .container {
        max-width: 100%;
    }

    .footer-with-sidebar {
        margin-left: 0;
    }

    .footer-with-sidebar .container {
        max-width: 100%;
    }
}

/* Overlay for mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

@media (max-width: 768px) {
    .sidebar-overlay.show {
        display: block;
    }
}