/* Sidebar Styles */

/* Sidebar Overlay */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(2px);
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Main Sidebar Container */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 350px;
    height: 100%;
    background-color: #f8f9fa;
    z-index: 1001;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
}

.sidebar.active {
    transform: translateX(0);
}

/* Sidebar Header */
.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e0e0e0;
    background-color: white;
    position: sticky;
    top: 0;
    z-index: 1002;
    min-height: 73px;
    box-sizing: border-box;
}

.sidebar-header h2 {
    font-size: 24px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.sidebar-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    color: #666;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
}

.sidebar-close:hover {
    background-color: rgba(51, 51, 51, 0.1);
    color: #333;
    transform: scale(1.1);
}

.sidebar-close:active {
    transform: scale(0.95);
}

/* Sidebar Content */
.sidebar-content {
    padding: 20px 24px;
    flex: 1;
    overflow-y: auto;
}

/* Navigation Section */
.navigation-section {
    margin-bottom: 32px;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 24px;
}

.navigation-section h3 {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.nav-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.nav-button {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    color: #333;
    font-size: 14px;
    font-weight: 500;
    width: 100%;
    text-align: left;
    position: relative;
    overflow: hidden;
}

.nav-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.5s ease;
}

.nav-button:hover::before {
    left: 100%;
}

.nav-button:hover {
    background: #e9ecef;
    border-color: #ccc;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.nav-button svg {
    color: #666;
    transition: color 0.3s ease;
    width: 20px;
    height: 20px;
}

.nav-button:hover svg {
    color: #333;
}

.nav-button.active {
    background: linear-gradient(135deg, #333 0%, #555 100%);
    color: white;
    border-color: #333;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.nav-button.active svg {
    color: white;
}

.nav-button.active::before {
    display: none;
}

/* Quick Actions Section */
.quick-actions-section {
    margin-bottom: 20px;
}

.quick-actions-section h3 {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.action-button {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: linear-gradient(135deg, #333 0%, #555 100%);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: white;
    font-size: 14px;
    font-weight: 500;
    width: 100%;
    text-align: left;
    position: relative;
    overflow: hidden;
}

.action-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.action-button:hover::before {
    left: 100%;
}

.action-button:hover {
    background: linear-gradient(135deg, #444 0%, #666 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.action-button svg {
    color: white;
    width: 20px;
    height: 20px;
}

.action-button:active {
    transform: translateY(0px);
}

/* Theme Toggle in Sidebar */
.sidebar .theme-toggle-btn {
    background: none;
    border: 1px solid #e0e0e0;
    color: #333;
    cursor: pointer;
    padding: 12px 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: all 0.3s ease;
    width: 100%;
    font-size: 14px;
    font-weight: 500;
}

.sidebar .theme-toggle-btn:hover {
    background-color: #e9ecef;
    border-color: #ccc;
    transform: translateY(-1px);
}

.sidebar .theme-toggle-btn svg {
    transition: transform 0.3s ease;
    width: 20px;
    height: 20px;
}

.sidebar .theme-toggle-btn:hover svg {
    transform: scale(1.1);
}

/* User Profile Section */
.user-profile-section {
    padding: 20px 16px;
    border-top: 1px solid #e0e0e0;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    margin-top: auto;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #333 0%, #555 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 16px;
}

.user-info {
    flex: 1;
}

.user-name {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin: 0 0 4px 0;
}

.user-email {
    font-size: 12px;
    color: #666;
    margin: 0;
}

/* Dark Mode Styles */
body.dark-mode .sidebar {
    background-color: #2d2d2d;
    border-color: #404040;
}

body.dark-mode .sidebar-header {
    background-color: #2d2d2d;
    border-bottom-color: #404040;
}

body.dark-mode .sidebar-header h2 {
    color: #ffffff;
}

body.dark-mode .sidebar-close {
    color: #cccccc;
}

body.dark-mode .sidebar-close:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

body.dark-mode .navigation-section h3,
body.dark-mode .quick-actions-section h3 {
    color: #ffffff;
}

body.dark-mode .navigation-section {
    border-bottom-color: #404040;
}

body.dark-mode .nav-button {
    background-color: #404040;
    border-color: #555555;
    color: #ffffff;
}

body.dark-mode .nav-button:hover {
    background-color: #4a4a4a;
    border-color: #666666;
}

body.dark-mode .nav-button svg {
    color: #cccccc;
}

body.dark-mode .nav-button:hover svg {
    color: #ffffff;
}

body.dark-mode .nav-button.active {
    background: linear-gradient(135deg, #ffffff 0%, #e0e0e0 100%);
    color: #333333;
    border-color: #ffffff;
}

body.dark-mode .nav-button.active svg {
    color: #333333;
}

body.dark-mode .action-button {
    background: linear-gradient(135deg, #555555 0%, #777777 100%);
}

body.dark-mode .action-button:hover {
    background: linear-gradient(135deg, #666666 0%, #888888 100%);
}

body.dark-mode .sidebar .theme-toggle-btn {
    background-color: #404040;
    border-color: #555555;
    color: #ffffff;
}

body.dark-mode .sidebar .theme-toggle-btn:hover {
    background-color: #4a4a4a;
    border-color: #666666;
}

body.dark-mode .user-profile-section {
    background: linear-gradient(135deg, #2d2d2d 0%, #404040 100%);
    border-top-color: #404040;
}

body.dark-mode .user-name {
    color: #ffffff;
}

body.dark-mode .user-email {
    color: #cccccc;
}

body.dark-mode .user-avatar {
    background: linear-gradient(135deg, #ffffff 0%, #e0e0e0 100%);
    color: #333333;
}

/* Responsive Design */
@media (max-width: 768px) {
    .sidebar {
        width: 300px;
    }
    
    .sidebar-content {
        padding: 16px 20px;
    }
    
    .sidebar-header {
        padding: 16px 20px;
    }
    
    .sidebar-header h2 {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .sidebar {
        width: 100%;
        max-width: 320px;
    }
    
    .nav-button, 
    .action-button,
    .sidebar .theme-toggle-btn {
        padding: 14px 16px;
        font-size: 15px;
    }
    
    .navigation-section h3,
    .quick-actions-section h3 {
        font-size: 16px;
    }
    
    .sidebar-content {
        padding: 16px;
    }
    
    .sidebar-header {
        padding: 16px;
    }
}

/* Animation for sidebar items */
.sidebar.active .nav-button {
    animation: slideInLeft 0.3s ease forwards;
}

.sidebar.active .action-button {
    animation: slideInLeft 0.4s ease forwards;
}

.sidebar.active .nav-button:nth-child(1) { animation-delay: 0.1s; }
.sidebar.active .nav-button:nth-child(2) { animation-delay: 0.15s; }
.sidebar.active .nav-button:nth-child(3) { animation-delay: 0.2s; }
.sidebar.active .nav-button:nth-child(4) { animation-delay: 0.25s; }
.sidebar.active .nav-button:nth-child(5) { animation-delay: 0.3s; }

.sidebar.active .action-button:nth-child(1) { animation-delay: 0.35s; }
.sidebar.active .action-button:nth-child(2) { animation-delay: 0.4s; }
.sidebar.active .action-button:nth-child(3) { animation-delay: 0.45s; }

@keyframes slideInLeft {
    0% {
        opacity: 0;
        transform: translateX(-20px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

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

.sidebar::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

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

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

body.dark-mode .sidebar::-webkit-scrollbar-track {
    background: #404040;
}

body.dark-mode .sidebar::-webkit-scrollbar-thumb {
    background: #666;
}

body.dark-mode .sidebar::-webkit-scrollbar-thumb:hover {
    background: #888;
}
