/* Sidebar Styles */

.sidebar {
    width: 280px;
    height: 100vh;
    background-color: #2a2d35;
    border-right: 1px solid #383b43;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 250;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    transition: transform 0.3s ease;
}

/* Mobile Topbar */
.mobile-topbar {
    display: none;
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 200;
    justify-content: space-between;
    align-items: center;
}

.mobile-topbar-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

/* Mobile Hamburger Menu */
.nav-menu {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    margin: 0;
    background: none;
    border: none;
}

.hamburger {
    stroke: var(--text-primary);
    transition: translate 1s, rotate 1s;
}

.nav-menu[aria-expanded="true"] .hamburger {
    rotate: 0.125turn;
}

.nav-menu .line {
    transition: 1s;
    stroke-dasharray: 60 31 60 300;
}

.nav-menu[aria-expanded="true"] .line {
    stroke-dasharray: 60 105 60 300;
    stroke-dashoffset: -90;
}

/* Mobile-specific styles */
@media (max-width: 767px) {
    .mobile-topbar {
        display: flex;
    }
    
    /* Add top padding to body to account for fixed topbar */
    body {
        padding-top: 70px;
    }
    
    .sidebar {
        /* Mobile: Hidden by default */
        transform: translateX(-100%);
        top: 0;
        height: 100vh;
    }
    
    .sidebar.open {
        /* Mobile: Show when open class is added */
        transform: translateX(0);
    }
}

/* Desktop-specific styles */
@media (min-width: 768px) {
    .sidebar {
        /* Desktop: Always visible */
        transform: translateX(0);
    }
    
    .mobile-topbar {
        display: none;
    }
    
    .nav-menu {
        display: none;
    }
    
    .sidebar-overlay {
        display: none;
    }
    
    /* Remove body padding on desktop */
    body {
        padding-top: 0;
    }
}

/* Sidebar Header */
.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid #383b43;
    background-color: #2a2d35;
    text-align: center;
}

/* Sidebar Logo */
.sidebar-logo {
    margin-bottom: 1rem;
    display: flex;
    justify-content: center;
}

.sidebar-logo-image {
    width: 60px;
    height: 60px;
    object-fit: contain;
    border-radius: 8px;
    background-color: rgba(255, 255, 255, 0.1);
    padding: 8px;
    transition: all 0.3s ease;
}

.sidebar-logo-image:hover {
    background-color: rgba(255, 255, 255, 0.15);
    transform: scale(1.05);
}

.sidebar-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
    line-height: 1.2;
}

.sidebar-subtitle {
    font-size: 0.875rem;
    color: #9ca3af;
    margin: 0.25rem 0 0 0;
    font-weight: 500;
}

/* Sidebar Navigation */
.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
    list-style: none;
    margin: 0;
}

.sidebar-nav li {
    margin: 0;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 1.5rem;
    color: #9ca3af;
    text-decoration: none;
    transition: all 0.2s ease;
    position: relative;
    font-weight: 500;
}

.sidebar-nav a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background-color: var(--accent-primary);
    transform: scaleY(0);
    transition: transform 0.2s ease;
}

.sidebar-nav a:hover {
    background-color: #383b43;
    color: #ffffff;
}

.sidebar-nav a:hover::before {
    transform: scaleY(1);
}

.sidebar-nav a.active {
    background-color: #383b43;
    color: #ffffff;
    font-weight: 600;
}

.sidebar-nav a.active::before {
    transform: scaleY(1);
}

.sidebar-nav .material-icons {
    font-size: 1.25rem;
    color: inherit;
}

/* Sidebar Footer/Profile */
.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid #383b43;
    background-color: #2a2d35;
}

.sidebar-profile {
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 0.5rem;
    background-color: #383b43;
    color: #ffffff;
    text-decoration: none;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.sidebar-profile:hover {
    background-color: #4b5563;
    transform: translateY(-1px);
}

.sidebar-profile.active {
    background-color: #4b5563;
    color: #ffffff;
    border: 2px solid var(--accent-primary);
}

.sidebar-profile.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background-color: var(--accent-primary);
}

.sidebar-profile-info {
    flex: 1;
    min-width: 0;
}

.sidebar-profile-text {
    font-size: 0.65rem;
    color: #9ca3af;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
    line-height: 1.4;
}

.sidebar-profile .user-name {
    font-size: 0.875rem;
    color: #ffffff;
    font-weight: 600;
    text-transform: none;
    letter-spacing: normal;
    max-width: 5ch;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
}

.sidebar-profile-icon {
    font-size: 1.5rem;
    color: #9ca3af;
    flex-shrink: 0;
}

.sidebar-logout {
    width: 100%;
    padding: 0.75rem 1rem;
    background-color: #383b43;
    color: #ffffff;
    border: 1px solid #4b5563;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.sidebar-logout:hover {
    background-color: #4b5563;
    border-color: #6b7280;
    transform: translateY(-1px);
}

.sidebar-logout .material-icons {
    font-size: 1.125rem;
}

/* Mobile Topbar - Only show on mobile */
.mobile-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    background-color: #2a2d35;
    border-bottom: 1px solid #383b43;
    padding: 1rem 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

@media (min-width: 768px) {
    .mobile-topbar {
        display: none;
    }
}

.mobile-topbar-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #ffffff;
    margin: 0;
}

.mobile-menu-toggle {
    display: block;
    background-color: transparent;
    color: #ffffff;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 0.375rem;
}

@media (min-width: 768px) {
    .mobile-menu-toggle {
        display: none;
    }
}

.mobile-menu-toggle:hover {
    background-color: #383b43;
}

.mobile-menu-toggle .material-icons {
    font-size: 1.5rem;
}

/* Sidebar Overlay for Mobile */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 99;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.sidebar-overlay.show {
    opacity: 1;
    visibility: visible;
}

@media (min-width: 768px) {
    .sidebar-overlay {
        display: none;
    }
}

/* Main Content Adjustment */
.main-content {
    margin-left: 0;
    min-height: 100vh;
    padding-top: 5rem;
    /* Extra padding for mobile topbar */
}

@media (min-width: 768px) {
    .main-content {
        margin-left: 280px;
        padding-top: 2rem;
    }
}

/* Notification Bell Styling - Inline with Profile */
.sidebar-footer {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.sidebar-notifications {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

/* Profile button - made narrower */
.sidebar-notifications .sidebar-profile {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: transparent;
    border: 1px solid #383b43;
    border-radius: 0.5rem;
    text-decoration: none;
    transition: all 0.2s ease;
    color: inherit;
    margin-bottom: 0;
    min-width: 0;
}

.sidebar-profile-info {
    flex: 1;
    min-width: 0;
}

.sidebar-profile-icon {
    margin-left: 0.75rem;
    flex-shrink: 0;
}

/* Notification bell - inline next to profile */
.notification-bell {
    background: transparent;
    border: none;
    padding: 0.75rem;
    color: #a8adb8;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.2s ease;
    border-radius: 0.5rem;
    flex-shrink: 0;
    min-width: 48px;
    height: 48px;
}

.notification-bell:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

.notification-bell.has-notifications {
    color: #ef4444;
}

.notification-bell.has-notifications:hover {
    color: white;
}

.notification-bell .material-icons {
    font-size: 1.25rem;
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ef4444;
    color: white;
    border-radius: 50%;
    min-width: 18px;
    height: 18px;
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #2a2d35;
}

/* Notifications Dropdown */
.notifications-dropdown {
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    margin-bottom: 0.5rem;
    max-height: 400px;
    z-index: 1000;
}

.notifications-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.notifications-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.mark-all-read {
    background: transparent;
    border: none;
    color: var(--accent-primary);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 0.25rem;
    display: flex;
    align-items: center;
    transition: background 0.2s ease;
}

.mark-all-read:hover {
    background: rgba(59, 130, 246, 0.1);
}

.mark-all-read .material-icons {
    font-size: 1.125rem;
}

.notifications-list {
    max-height: 300px;
    overflow-y: auto;
}

.notification-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background 0.2s ease;
    position: relative;
}

.notification-item:last-child {
    border-bottom: none;
}

.notification-item:hover {
    background: var(--bg-secondary);
}

.notification-item.unread {
    background: rgba(59, 130, 246, 0.05);
    border-left: 3px solid var(--accent-primary);
}

.notification-item.unread::before {
    content: '';
    position: absolute;
    top: 50%;
    right: 1rem;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    background: var(--accent-primary);
    border-radius: 50%;
}

.notification-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    font-size: 0.875rem;
}

.notification-message {
    color: var(--text-secondary);
    font-size: 0.8rem;
    line-height: 1.4;
    margin-bottom: 0.25rem;
}

.notification-time {
    color: var(--text-muted);
    font-size: 0.75rem;
}

.notification-priority-high {
    border-left-color: #ef4444 !important;
}

.notification-priority-urgent {
    border-left-color: #dc2626 !important;
    background: rgba(239, 68, 68, 0.05) !important;
}

.no-notifications {
    padding: 2rem 1rem;
    text-align: center;
    color: var(--text-muted);
}

.no-notifications .material-icons {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    opacity: 0.5;
}

.no-notifications p {
    margin: 0;
    font-size: 0.875rem;
}

/* Sidebar Overlay */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 200;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.sidebar-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* Prevent body scroll when sidebar is open on mobile */
body.sidebar-open {
    overflow: hidden;
}