/* ==========================================================================
   MODERN SIDEBAR DESIGN
   ========================================================================== */

/* Modern Sidebar Container */
.modern-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100vh;
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
}

.modern-sidebar.collapsed {
    width: 80px;
}

/* Sidebar Header */
.sidebar-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

.brand-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1rem;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
    transition: all 0.3s ease;
}

.brand-icon:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.brand-text h1 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #f1f5f9;
    margin: 0;
    line-height: 1.2;
}

.brand-tagline {
    font-size: 0.75rem;
    color: #94a3b8;
    font-weight: 500;
    margin-top: 0.25rem;
}

.sidebar-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.sidebar-collapse-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #cbd5e1;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.875rem;
}

.sidebar-collapse-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.collapse-all-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.3);
    color: #f87171;
}

/* Quick Actions */
.quick-actions {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.quick-action-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.quick-action-btn.primary {
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.quick-action-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.quick-action-btn.secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #cbd5e1;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.quick-action-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.quick-action-btn.tertiary {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.quick-action-btn.tertiary:hover {
    background: rgba(16, 185, 129, 0.25);
    transform: translateY(-1px);
}

/* Favorite Toggle Button */
.favorite-toggle {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    opacity: 0.6;
    transform: translateX(5px);
}

.nav-item:hover .favorite-toggle {
    opacity: 1;
    transform: translateX(0);
}

.favorite-toggle:hover {
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.15);
    box-shadow: 0 0 12px rgba(251, 191, 36, 0.3);
}

.favorite-toggle i.fas {
    color: #fbbf24;
    text-shadow: 0 0 8px rgba(251, 191, 36, 0.5);
}

/* Favorite Toggle in Submenu Items */
.nav-subitem {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem 0.75rem 3rem;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: all 0.2s ease;
}

.nav-subitem .favorite-toggle {
    opacity: 0.5;
    transform: translateX(5px);
    padding: 0.25rem;
    font-size: 0.875rem;
}

.nav-subitem:hover .favorite-toggle {
    opacity: 1;
    transform: translateX(0);
}

/* Navigation Menu */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1rem 0;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Navigation Items */
.nav-item {
    display: flex;
    align-items: center;
    padding: 0.875rem 1.5rem;
    color: #cbd5e1;
    text-decoration: none;
    transition: all 0.2s ease;
    position: relative;
    border-radius: 0;
    margin: 0 1rem;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #f1f5f9;
}

.nav-item.active {
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.2), transparent);
    color: #3b82f6;
    border-left: 3px solid #3b82f6;
}

.nav-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    margin-right: 1rem;
    flex-shrink: 0;
}

.nav-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.nav-title {
    font-weight: 600;
    font-size: 0.875rem;
    line-height: 1.2;
}

.nav-subtitle {
    font-size: 0.75rem;
    color: #94a3b8;
    font-weight: 400;
}


/* Navigation Groups */
.nav-group {
    display: flex;
    flex-direction: column;
}

.group-header {
    cursor: pointer;
    user-select: none;
}

.group-toggle {
    font-size: 0.75rem;
    transition: transform 0.3s ease;
    color: #94a3b8;
    opacity: 0.7;
    margin-left: 0.75rem;
}

.nav-group.expanded .group-toggle {
    transform: rotate(180deg);
}

.nav-submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(0, 0, 0, 0.1);
}

.nav-group.expanded .nav-submenu {
    max-height: 500px;
}

.nav-subitem {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem 0.75rem 3.5rem;
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    gap: 0.75rem;
}

.nav-subitem:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #cbd5e1;
}

.nav-subitem.active {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.footer-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: #cbd5e1;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.footer-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

.theme-toggle-btn i {
    width: 16px;
    text-align: center;
}

/* Language Switcher */
.language-switcher {
    position: relative;
}

.language-btn {
    width: 100%;
}

.language-dropdown {
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    margin-bottom: 0.5rem;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.language-switcher.active .language-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.language-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: #cbd5e1;
    text-decoration: none;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.language-option:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #f1f5f9;
}

.language-option.active {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
}

.flag {
    font-size: 1rem;
}

/* Collapsed State - Icon Only Mode */
.modern-sidebar.collapsed .brand-text,
.modern-sidebar.collapsed .nav-subtitle,
.modern-sidebar.collapsed .quick-actions,
.modern-sidebar.collapsed .nav-content {
    display: none;
}

/* Keep dropdowns functional in collapsed mode */
.modern-sidebar.collapsed .nav-group.expanded .nav-submenu {
    display: block;
    position: absolute;
    left: 80px;
    top: 0;
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    min-width: 200px;
    z-index: 1000;
    padding: 0.5rem 0;
}

.modern-sidebar.collapsed .nav-group.expanded .nav-submenu .nav-subitem {
    padding: 0.75rem 1rem;
    color: #cbd5e1;
    text-decoration: none;
    display: block;
    transition: all 0.2s ease;
}

.modern-sidebar.collapsed .nav-group.expanded .nav-submenu .nav-subitem:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #f1f5f9;
}

/* Force collapsed sidebar styles with higher specificity */
aside.modern-sidebar.collapsed .sidebar-header,
.collapsed .sidebar-header {
    justify-content: center !important;
    padding: 0.5rem 0 !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    height: 45px !important;
    background: transparent !important;
}

.modern-sidebar.collapsed .brand,
.collapsed .brand {
    justify-content: center;
}

aside.modern-sidebar.collapsed .brand .brand-icon,
.collapsed .brand .brand-icon {
    width: 24px !important;
    height: 24px !important;
    font-size: 0.75rem !important;
}

aside.modern-sidebar.collapsed .sidebar-collapse-btn,
.collapsed .sidebar-collapse-btn {
    position: absolute !important;
    top: 0.25rem !important;
    right: 0.25rem !important;
    width: 18px !important;
    height: 18px !important;
    padding: 0 !important;
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 0.5rem !important;
}

.modern-sidebar.collapsed .nav-item {
    padding: 0.5rem 0 !important;
    margin: 0.125rem 1rem !important;
    justify-content: flex-start !important;
    border-radius: 6px !important;
    transition: all 0.2s ease !important;
    background: transparent !important;
    display: flex !important;
    align-items: center !important;
}

.modern-sidebar.collapsed .nav-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.modern-sidebar.collapsed .nav-item.active {
    background: rgba(59, 130, 246, 0.2);
    border-left: 3px solid #3b82f6;
    border-radius: 0 8px 8px 0;
}

.modern-sidebar.collapsed .nav-icon {
    margin: 0 !important;
    font-size: 1.25rem !important;
    width: 24px !important;
    height: 24px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #cbd5e1 !important;
}

.modern-sidebar.collapsed .nav-item:hover .nav-icon {
    color: #f1f5f9;
}

.modern-sidebar.collapsed .nav-item.active .nav-icon {
    color: #3b82f6;
}

.modern-sidebar.collapsed .nav-group .group-header {
    padding: 0.5rem 0 !important;
    margin: 0.125rem 1rem !important;
    justify-content: flex-start !important;
    border-radius: 6px !important;
    background: transparent !important;
    display: flex !important;
    align-items: center !important;
}

.modern-sidebar.collapsed .footer-btn {
    padding: 0.5rem 0 !important;
    justify-content: center;
    margin: 0.0625rem 1rem !important;
    border-radius: 4px !important;
    min-height: 28px !important;
    background: transparent;
    border: none;
}

.modern-sidebar.collapsed .footer-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.modern-sidebar.collapsed .footer-btn span:not(.flag) {
    display: none;
}

.modern-sidebar.collapsed .language-switcher {
    margin: 0.25rem 1rem;
}

.modern-sidebar.collapsed .language-btn {
    min-height: 36px;
    border-radius: 6px;
    background: transparent;
    border: none;
}

/* Dark Mode Adjustments */
[data-theme="dark"] .modern-sidebar {
    background: linear-gradient(180deg, #0f172a 0%, #020617 100%);
    border-right-color: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .sidebar-header {
    border-bottom-color: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .sidebar-footer {
    border-top-color: rgba(255, 255, 255, 0.05);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .modern-sidebar {
        transform: translateX(-100%);
        width: 280px;
    }
    
    .modern-sidebar.active {
        transform: translateX(0);
    }
    
    .modern-sidebar.collapsed {
        transform: translateX(-100%);
    }
}

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

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

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

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