/* Sidebar Styles */
.sidebar {
    width: 280px;
    background: #1f1f1f;
    display: flex;
    flex-direction: column;
    height: 100vh;
    color: white;
    padding: 0;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.logo-container {
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.logo {
    width: 48px;
    height: 48px;
    object-fit: contain;
    opacity: 0.9;
}

.logo-text {
    font-size: 16px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
}

.sidebar-menu {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: 24px 0;
    overflow-y: auto;
}

.menu-section {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 0 16px;
}

.menu-section:not(:last-child) {
    padding-bottom: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.menu-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: all 0.2s ease;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-family: inherit;
    font-size: 14px;
    cursor: pointer;
    border-radius: 8px;
    margin-bottom: 2px;
}

.menu-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.9);
}

.menu-item.active {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    font-weight: 500;
}

.menu-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    opacity: 0.9;
    font-size: 18px;
}

.menu-text {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Profile Section Styles */
.profile-section {
    position: relative;
    padding: 5px 5px;
    margin-top: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.profile-button {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.03);
    border: none;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    z-index: 10;
    margin-bottom: 2px;
}

.profile-button:hover {
    background: rgba(255, 255, 255, 0.08);
}

.profile-avatar {
    width: 20px;
    height: 20px;
    background: #ff6b35;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    margin-right: 10px;
    font-size: 10px;
    color: white;
    flex-shrink: 0;
}

.profile-info {
    text-align: left;
    flex: 1;
    min-width: 0;
}

.profile-name {
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 1px;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile-role {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Profile Menu */
.profile-menu {
    position: absolute;
    bottom: 100%;
    left: 16px;
    right: 16px;
    background: #2a2a2a;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    padding: 8px;
    display: none;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.profile-menu.show {
    display: block;
    animation: slideUp 0.2s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive overrides moved from main.css to keep sidebar consistent */
@media (max-width: 767px) {
    .sidebar {
        width: 100%;
        height: auto;
        min-height: auto;
        flex-direction: row;
        padding: 12px;
        position: fixed;
        top: 0;
        left: 0;
        z-index: 1000;
        border-bottom: 1px solid var(--border-color);
    }
}

@media (max-width: 480px) {
    .sidebar {
        padding: 8px 12px;
    }
}

@media (min-width: 1200px) {
    .sidebar {
        width: 280px;
    }
}

.profile-menu-item {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 10px 12px;
    border: none;
    background: none;
    color: white;
    font-size: 14px;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.profile-menu-item .menu-icon {
    font-size: 16px;
    margin-right: 12px;
    opacity: 0.9;
}

.profile-menu-item .menu-text {
    flex: 1;
    font-weight: 500;
}

.profile-menu-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.menu-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    margin: 8px 0;
}

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

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

.sidebar-menu::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.sidebar-menu::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Main Content */
.main-content {
    margin-left: 280px;
    padding: 20px;
    min-height: 100vh;
}

/* Mobile Menu Toggle Button */
.menu-toggle {
    display: none;
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 1001;
    width: 44px;
    height: 44px;
    background: #1f1f1f;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.2s ease;
}

.menu-toggle:hover {
    background: #333;
}

.menu-toggle.active {
    background: #333;
}

.hamburger {
    position: relative;
    display: block;
    width: 20px;
    height: 2px;
    background: white;
    margin: 0 auto;
    transition: all 0.3s ease;
}

.hamburger:before,
.hamburger:after {
    content: '';
    position: absolute;
    width: 20px;
    height: 2px;
    background: white;
    transition: all 0.3s ease;
}

.hamburger:before {
    top: -6px;
}

.hamburger:after {
    top: 6px;
}

.menu-toggle.active .hamburger {
    background: transparent;
}

.menu-toggle.active .hamburger:before {
    top: 0;
    transform: rotate(45deg);
}

.menu-toggle.active .hamburger:after {
    top: 0;
    transform: rotate(-45deg);
}

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

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

/* Responsive Design */
@media (max-width: 480px) {
    .menu-toggle {
        display: block;
    }

    .sidebar {
        position: fixed;
        left: -280px;
        transition: left 0.3s ease;
        z-index: 1000;
    }

    .sidebar.show {
        left: 0;
    }

    .main-content {
        margin-left: 0;
    }
}

/* Large Screen Adjustments */
@media (min-width: 1200px) {
    .profile-button {
        padding: 7px 15px !important;
    }
    
    .profile-avatar {
        width: 40px !important;
        height: 40px !important;
        font-size: 22px !important;
    }
}

/* CSS Variables for theming */
:root {
    --primary-color: #ff6b35;
    --sidebar-bg: #1f1f1f;
    --sidebar-text: rgba(255, 255, 255, 0.7);
    --sidebar-text-active: white;
    --sidebar-hover: rgba(255, 255, 255, 0.08);
}

/* Hide unsupported profile menu items globally */
.profile-menu [data-action="change-password"],
.profile-menu [data-action="help"],
#changePasswordModal {
    display: none !important;
}
