/* Sidebar Styles - Improved Design */

body.has-sidebar {
    padding-left: 280px;
}

body.sidebar-collapsed {
    padding-left: 0;
}

/* Sidebar Toggle Button */
.sidebar-toggle {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1001;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.sidebar-toggle svg {
    width: 20px;
    height: 20px;
}

.sidebar-toggle:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent);
    color: var(--accent);
    transform: scale(1.05);
}

/* Sidebar Overlay (mobile) */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 998;
    opacity: 0;
    transition: opacity 0.3s;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    padding: 24px;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    left: 0;
    top: 0;
    transition: transform 0.3s ease;
    z-index: 999;
}

.sidebar.collapsed {
    transform: translateX(-100%);
}

/* Sidebar Header */
.sidebar-header {
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-logo {
    font-size: 3em;
    margin-bottom: 12px;
    text-align: center;
}

.sidebar h2 {
    font-size: 1.5em;
    font-weight: 500;
    margin-bottom: 4px;
    color: var(--text-primary);
    text-align: center;
}

.sidebar-subtitle {
    color: var(--text-tertiary);
    font-size: 0.9em;
    display: block;
    text-align: center;
}

/* Navigation */
.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Home Link - Special Styling */
.nav-item-home {
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    color: #fff;
    border-color: var(--accent);
    font-weight: 600;
    margin-bottom: 8px;
}

.nav-item-home:hover {
    background: linear-gradient(135deg, var(--accent-hover), var(--accent-active));
    color: #fff;
    transform: translateX(4px);
}

.nav-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-section-title {
    font-size: 0.75em;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-tertiary);
    margin-bottom: 8px;
    font-weight: 600;
    padding-left: 4px;
}

/* Collapsible Nav Section */
.nav-section-collapsible .nav-section-title {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border-radius: 6px;
    margin-bottom: 0;
    transition: all 0.2s;
}

.nav-section-collapsible .nav-section-title:hover {
    background: var(--bg-primary);
    color: var(--text-secondary);
}

.toggle-icon {
    font-size: 0.8em;
    transition: transform 0.2s;
}

.nav-section-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.nav-section-collapsible.expanded .nav-section-content {
    margin-top: 12px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    border-radius: 10px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s;
    font-size: 1em;
    font-weight: 500;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
}

.nav-item:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--accent);
    transform: translateX(4px);
}

.nav-item.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.nav-icon {
    font-size: 1.5em;
    min-width: 24px;
    text-align: center;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    body.has-sidebar {
        padding-left: 0;
    }

    .sidebar {
        width: 280px;
        z-index: 999;
    }

    .sidebar.collapsed {
        transform: translateX(-100%);
    }

    .sidebar-toggle {
        left: 16px;
        top: 16px;
    }
}

/* Scrollbar for sidebar */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

/* Sidebar Footer */
.sidebar-footer {
    margin-top: auto;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.sidebar-logout {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-tertiary);
    font-size: 0.85em;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.sidebar-logout:hover {
    background: var(--bg-tertiary);
    border-color: var(--error);
    color: var(--error);
}

.logout-icon {
    font-size: 1.2em;
}
