/* Geist Design System - Sidebar Styles */

/* Import Geist base variables */
@import url('geist-base.css');

/* Override old sidebar styles */
.layout-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Container */
nav.sidebar {
    width: 220px !important;
    height: 100vh !important;
    background-color: var(--geist-background) !important;
    border-right: 1px solid var(--accents-2) !important;
    display: flex !important;
    flex-direction: column !important;
    transition: all 0.2s ease !important;
    position: fixed !important;
    left: 0 !important;
    top: 0 !important;
    z-index: 1000 !important;
    /* Remove old neumorphic styles */
    box-shadow: none !important;
    border-radius: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    flex: none !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif !important;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
}

nav.sidebar.collapsed {
    width: 48px !important;
}

/* Logo Section */
.sidebar .logo-section {
    padding: 2rem 1.25rem 1.5rem !important;  /* More top padding to move down */
    border-bottom: 1px solid var(--accents-2) !important;
    background: transparent !important;
    box-shadow: none !important;
    margin-bottom: 0.5rem !important;  /* Add space below logo section */
}

.sidebar.collapsed .logo-section {
    padding: 0.75rem 0.5rem !important;
}

.sidebar .logo {
    font-size: 1rem !important; /* 16px */
    font-weight: 600 !important;
    color: var(--geist-foreground) !important;
    text-decoration: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 0.625rem !important;
    padding: 0 !important;
}

.sidebar .logo i {
    font-size: 1.125rem !important; /* 18px icon */
}

.sidebar.collapsed .logo span {
    display: none !important;
}

.sidebar.collapsed .logo {
    justify-content: center !important;
}

/* Navigation Section */
.sidebar .nav-section {
    flex: 1 !important;
    overflow-y: auto !important;
    padding: 1rem 0 !important;  /* More padding for cushioning */
}

/* Navigation Items */
.sidebar .nav-items,
.sidebar ul {
    list-style: none !important;
    padding: 0 0.5rem !important;  /* Add horizontal padding for cushioning */
    margin: 0 !important;
}

.sidebar .nav-item,
.sidebar li {
    margin: 0.125rem 0 !important;  /* Add vertical spacing between items */
    padding: 0 !important;
    list-style: none !important;
}

.sidebar .nav-link,
.sidebar a {
    display: flex !important;
    align-items: center !important;
    padding: 0.625rem 1.25rem !important; /* More padding for better cushioning */
    color: #666 !important; /* Match main content gray */
    text-decoration: none !important;
    font-size: 0.875rem !important; /* 14px - standard Geist body text */
    font-weight: 400 !important;
    transition: all 0.15s ease !important;
    position: relative !important;
    border-radius: 6px !important;  /* Add slight rounding for modern look */
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
    line-height: 1.4 !important;
    margin: 0 0.25rem !important;  /* Add horizontal margin */
}

.sidebar.collapsed .nav-link,
.sidebar.collapsed a {
    padding: 0.5rem !important;
    justify-content: center !important;
}

.sidebar .nav-link:hover,
.sidebar a:hover {
    color: var(--geist-foreground) !important;
    background-color: var(--accents-1) !important;
}

.sidebar .nav-link.active,
.sidebar a.active {
    color: #000 !important; /* Pure black for active */
    background-color: var(--accents-1) !important;  /* Light background for active */
    font-weight: 500 !important;
}

.sidebar .nav-link.active::before,
.sidebar a.active::before {
    content: '' !important;
    position: absolute !important;
    left: 0.25rem !important;  /* Adjust for margin */
    top: 50% !important;
    transform: translateY(-50%) !important;
    height: 20px !important;
    width: 3px !important;
    background-color: var(--geist-foreground) !important;
    border-radius: 2px !important;
}

/* Navigation Icons */
.sidebar .nav-link i,
.sidebar a i {
    width: 18px !important;
    margin-right: 0.75rem !important;
    text-align: center !important;
    font-size: 0.9375rem !important; /* 15px icons */
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
    color: inherit !important;
}

/* Remove fa-fw class effects */
.sidebar i.fa-fw {
    font-size: 0.9375rem !important;
    width: 18px !important;
}

/* Fix first nav header spacing */
.sidebar .nav-section > .nav-header:first-child,
.sidebar .nav-section > .sidebar-heading:first-child {
    margin-top: 0.5rem !important;
}

/* Ensure consistent icon colors */
.sidebar .text-danger {
    color: #dc3545 !important;
}

.sidebar.collapsed .nav-link i,
.sidebar.collapsed a i {
    margin-right: 0 !important;
}

/* Navigation Text */
.sidebar .nav-link span,
.sidebar a span {
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    font-size: 0.875rem !important; /* 14px - consistent with nav-link */
    line-height: 1.2 !important;
}

.sidebar.collapsed .nav-link span,
.sidebar.collapsed a span {
    display: none !important;
}

/* Section Headers */
.sidebar .nav-header,
.sidebar .sidebar-heading {
    padding: 0.5rem 1.75rem !important;  /* More padding for alignment */
    font-size: 0.6875rem !important; /* 11px - small caps */
    font-weight: 600 !important;
    color: var(--accents-4) !important;
    text-transform: uppercase !important;
    letter-spacing: 0.1em !important;
    margin-top: 1.75rem !important;  /* More space above sections */
    margin-bottom: 0.5rem !important;  /* More space below headers */
    background: transparent !important;
    border: none !important;
}

.sidebar.collapsed .nav-header {
    display: none;
}

/* Dividers */
.sidebar .nav-divider,
.sidebar .sidebar-divider,
.sidebar hr {
    height: 1px !important;
    background-color: var(--accents-2) !important;
    margin: 1.25rem 1.5rem !important;  /* More spacing around dividers */
    border: none !important;
    opacity: 1 !important;
}

.sidebar.collapsed .nav-divider,
.sidebar.collapsed .sidebar-divider,
.sidebar.collapsed hr {
    margin: 0.5rem !important;
}

/* Bottom Section */
.sidebar .sidebar-bottom {
    padding: 1.5rem 1.25rem !important;  /* More cushioning */
    border-top: 1px solid var(--accents-2) !important;
    margin-top: auto !important;
    background: var(--geist-background) !important;
}

.sidebar.collapsed .sidebar-bottom {
    padding: 0.5rem !important;
}

.sidebar .user-info {
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    padding: 0.5rem 0 !important;
    color: var(--accents-5) !important;
    font-size: 0.875rem !important;
}

.sidebar .logout-link {
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    padding: 0.5rem 0 !important;
    color: var(--accents-5) !important;
    text-decoration: none !important;
    font-size: 0.875rem !important;
    transition: color 0.15s ease !important;
}

.sidebar .logout-link:hover {
    color: var(--geist-foreground) !important;
}

/* Theme Toggle */
.theme-toggle {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    padding: 0.375rem !important;
    background-color: var(--accents-1) !important;
    border: 1px solid var(--accents-2) !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    transition: all 0.15s ease !important;
    margin-bottom: 0 !important;
    box-shadow: none !important;
}

.theme-toggle:hover {
    background-color: var(--accents-2) !important;
}

.theme-toggle i {
    font-size: 0.875rem !important; /* 14px */
    color: var(--accents-5) !important;
}

/* Collapse Toggle */
.sidebar-toggle {
    position: absolute;
    right: -12px;
    top: 20px;
    width: 24px;
    height: 24px;
    background-color: var(--geist-background);
    border: 1px solid var(--accents-2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
    z-index: 1001;
}

.sidebar-toggle:hover {
    background-color: var(--accents-1);
}

.sidebar-toggle i {
    font-size: var(--geist-font-size-12);
    color: var(--accents-5);
}

/* Main Content Adjustment */
.main-content,
.layout-container .main-content {
    margin-left: 220px !important;
    transition: margin-left 0.2s ease !important;
    min-height: 100vh !important;
    background-color: var(--geist-background) !important;
    padding: 1.5rem !important;
    width: calc(100% - 220px) !important;
    box-sizing: border-box !important;
    position: relative !important;
}

.main-content.sidebar-collapsed,
.layout-container .main-content.sidebar-collapsed {
    margin-left: 48px !important;
    width: calc(100% - 48px) !important;
}

/* Ensure body and html don't interfere */
body {
    margin: 0 !important;
    padding: 0 !important;
    overflow-x: hidden !important;
}

/* Override any conflicting layout styles */
.layout-container {
    display: flex !important;
    min-height: 100vh !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        width: 240px !important;
    }
    
    .sidebar.mobile-open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0 !important;
    }
    
    .sidebar-toggle {
        display: none;
    }
}

/* Tooltips for collapsed sidebar */
.sidebar.collapsed .nav-link {
    position: relative;
}

.sidebar.collapsed .nav-link:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    margin-left: var(--geist-space-2);
    padding: var(--geist-space-2) var(--geist-space-3);
    background-color: var(--geist-foreground);
    color: var(--geist-background);
    border-radius: var(--geist-radius);
    font-size: var(--geist-font-size-12);
    white-space: nowrap;
    z-index: 1002;
}

/* Dark mode adjustments */
[data-theme="dark"] .sidebar {
    background-color: var(--geist-background);
    border-right-color: var(--accents-2);
}

[data-theme="dark"] .sidebar .nav-link,
[data-theme="dark"] .sidebar a {
    color: #999 !important;
}

[data-theme="dark"] .sidebar .nav-link.active,
[data-theme="dark"] .sidebar a.active {
    color: #fff !important;
}

[data-theme="dark"] .theme-toggle {
    background-color: var(--accents-1);
    border-color: var(--accents-2);
}

[data-theme="dark"] .sidebar-toggle {
    background-color: var(--geist-background);
    border-color: var(--accents-2);
}

/* Hide old theme switch wrapper */
.theme-switch-wrapper {
    display: none !important;
}

