/**
 * SIDEBAR MODULE: Navigation
 * Year and month selection sidebar
 */

.sidebar {
    position: fixed;
    left: 0;
    top: var(--header-height);
    width: var(--sidebar-width);
    height: calc(100vh - var(--header-height));
    background-color: white;
    box-shadow: 2px 0 5px rgba(0,0,0,0.1);
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px;
    z-index: 900;
    transition: transform 0.3s ease;
}

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

.sidebar-section {
    margin-bottom: 30px;
}

.sidebar-section-title {
    font-size: 14px;
    text-transform: uppercase;
    color: var(--dark-gray);
    margin-bottom: 15px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

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

.sidebar-item {
    margin-bottom: 5px;
}

.sidebar-button {
    width: 100%;
    padding: 12px 15px;
    border: none;
    background-color: transparent;
    text-align: left;
    cursor: pointer;
    border-radius: var(--border-radius);
    transition: var(--transition);
    font-size: 14px;
    color: #333;
    font-weight: 500;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-button:hover {
    background-color: var(--light-gray);
}

.sidebar-button.active {
    background-color: var(--secondary-color);
    color: white;
}

.sidebar-button-badge {
    background-color: var(--light-gray);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.sidebar-button.active .sidebar-button-badge {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
}

/* Toggle Button */
.sidebar-toggle {
    position: fixed;
    left: 10px;
    top: calc(var(--header-height) + 10px);
    width: 40px;
    height: 40px;
    background-color: white;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 901;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: var(--transition);
}

.sidebar-toggle:hover {
    background-color: var(--light-gray);
}

.sidebar-toggle-icon {
    width: 20px;
    height: 2px;
    background-color: var(--primary-color);
    position: relative;
}

.sidebar-toggle-icon::before,
.sidebar-toggle-icon::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 2px;
    background-color: var(--primary-color);
    left: 0;
}

.sidebar-toggle-icon::before {
    top: -6px;
}

.sidebar-toggle-icon::after {
    top: 6px;
}

/* Sidebar Overlay for Mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 899;
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

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

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

.sidebar::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* Responsive */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
        z-index: 1001;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .sidebar-toggle {
        display: flex;
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 280px;
    }
}

@media (max-width: 480px) {
    .sidebar {
        width: 100%;
        max-width: 320px;
    }
}

/* Loading State */
.sidebar-loading {
    padding: 20px;
    text-align: center;
    color: var(--dark-gray);
}

/* Empty State */
.sidebar-empty {
    padding: 20px;
    text-align: center;
    color: var(--dark-gray);
    font-size: 14px;
}

/* Divider */
.sidebar-divider {
    height: 1px;
    background-color: var(--light-gray);
    margin: 15px 0;
}
