/* backend/api/public/docs/css/sidebar.css */

/* Sidebar Navigation for Oliver Chat API Documentation */

:root {
    --sidebar-width: 280px;
    --sidebar-bg: #ffffff;
    --sidebar-border: #e5e7eb;
    --sidebar-text: #374151;
    --sidebar-text-muted: #6b7280;
    --sidebar-active-bg: #eff6ff;
    --sidebar-active-text: #1d4ed8;
    --sidebar-active-border: #2563eb;
    --sidebar-hover-bg: #f9fafb;
    --sidebar-hover-text: #111827;
    --sidebar-section-title: #9ca3af;
    --sidebar-scrollbar-thumb: #d1d5db;
    --sidebar-scrollbar-track: #f3f4f6;
    --sidebar-toggle-bg: #1f2937;
    --sidebar-toggle-color: #ffffff;
    --sidebar-transition: 0.3s ease;
    --sidebar-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

/* Dark theme variables */
[data-theme="dark"] {
    --sidebar-bg: #1f2937;
    --sidebar-border: #374151;
    --sidebar-text: #e5e7eb;
    --sidebar-text-muted: #9ca3af;
    --sidebar-active-bg: #1e40af;
    --sidebar-active-text: #dbeafe;
    --sidebar-active-border: #3b82f6;
    --sidebar-hover-bg: #374151;
    --sidebar-hover-text: #f3f4f6;
    --sidebar-section-title: #6b7280;
    --sidebar-scrollbar-thumb: #4b5563;
    --sidebar-scrollbar-track: #374151;
    --sidebar-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.3), 0 1px 2px 0 rgba(0, 0, 0, 0.2);
}

/* Sidebar container */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--sidebar-border);
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 40;
    transition: transform var(--sidebar-transition);
    box-shadow: var(--sidebar-shadow);
}

/* Mobile sidebar hidden by default */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.mobile-open {
        transform: translateX(0);
    }
}

/* Desktop sidebar always visible */
@media (min-width: 769px) {
    .sidebar {
        transform: translateX(0);
    }
}

/* Sidebar scrollbar styling */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: var(--sidebar-scrollbar-track);
}

.sidebar::-webkit-scrollbar-thumb {
    background-color: var(--sidebar-scrollbar-thumb);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background-color: var(--sidebar-text-muted);
}

/* Sidebar content */
.sidebar-content {
    padding: 1rem 0;
    min-height: 100%;
}

/* Mobile header */
.sidebar .mobile-header {
    display: none;
    padding: 1rem;
    border-bottom: 1px solid var(--sidebar-border);
    align-items: center;
    justify-content: space-between;
}

@media (max-width: 768px) {
    .sidebar .mobile-header {
        display: flex;
    }
}

.sidebar .mobile-header .logo {
    display: flex;
    align-items: center;
    color: var(--sidebar-text);
    text-decoration: none;
}

.sidebar .mobile-header .logo-icon {
    width: 2rem;
    height: 2rem;
    background-color: #2563eb;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.75rem;
    color: white;
    font-weight: bold;
    font-size: 0.875rem;
}

.sidebar .mobile-header .close-btn {
    background: none;
    border: none;
    color: var(--sidebar-text-muted);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 0.25rem;
    transition: color 0.2s;
}

.sidebar .mobile-header .close-btn:hover {
    color: var(--sidebar-text);
}

/* Search box */
.sidebar-search {
    padding: 0 1rem;
    margin-bottom: 1.5rem;
}

.sidebar-search .search-input {
    width: 100%;
    padding: 0.5rem 0.75rem 0.5rem 2.5rem;
    border: 1px solid var(--sidebar-border);
    border-radius: 0.375rem;
    background-color: var(--sidebar-bg);
    color: var(--sidebar-text);
    font-size: 0.875rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.sidebar-search .search-input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.sidebar-search .search-input::placeholder {
    color: var(--sidebar-text-muted);
}

.sidebar-search .search-container {
    position: relative;
}

.sidebar-search .search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--sidebar-text-muted);
    width: 1rem;
    height: 1rem;
}

/* Navigation sections */
.sidebar-nav {
    padding: 0 1rem;
}

.sidebar-section {
    margin-bottom: 2rem;
}

.sidebar-section-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--sidebar-section-title);
    margin-bottom: 0.75rem;
    padding: 0 0.75rem;
}

.sidebar-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-nav li {
    margin: 0;
}

/* Navigation links */
.nav-link {
    display: flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    color: var(--sidebar-text);
    text-decoration: none;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
    position: relative;
    margin-bottom: 0.125rem;
}

.nav-link:hover {
    background-color: var(--sidebar-hover-bg);
    color: var(--sidebar-hover-text);
    text-decoration: none;
}

.nav-link.active,
.nav-link[class*="bg-blue-50"] {
    background-color: var(--sidebar-active-bg);
    color: var(--sidebar-active-text);
    border-right: 2px solid var(--sidebar-active-border);
}

.nav-link svg {
    width: 1rem;
    height: 1rem;
    margin-right: 0.5rem;
    flex-shrink: 0;
}

/* Nested navigation */
.nav-link.nested {
    margin-left: 1rem;
    font-size: 0.8125rem;
}

.nav-link.nested::before {
    content: '';
    width: 0.5rem;
    height: 1px;
    background-color: var(--sidebar-border);
    margin-right: 0.5rem;
}

/* Footer info */
.sidebar-footer {
    margin-top: auto;
    padding: 1.5rem 1rem 1rem;
    border-top: 1px solid var(--sidebar-border);
}

.sidebar-footer-info {
    font-size: 0.75rem;
    color: var(--sidebar-text-muted);
    line-height: 1.4;
}

.sidebar-footer-info p {
    margin: 0 0 0.5rem 0;
}

.sidebar-footer-info p:last-child {
    margin-bottom: 0;
}

/* Version selector */
.version-selector {
    padding: 0 1rem;
    margin-bottom: 1rem;
}

.version-selector select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--sidebar-border);
    border-radius: 0.375rem;
    background-color: var(--sidebar-bg);
    color: var(--sidebar-text);
    font-size: 0.875rem;
    cursor: pointer;
}

.version-selector select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Mobile overlay */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 30;
    transition: opacity var(--sidebar-transition);
}

@media (min-width: 769px) {
    .sidebar-overlay {
        display: none;
    }
}

/* Animation states */
.sidebar-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.sidebar-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

/* Badge styles for navigation items */
.nav-badge {
    display: inline-block;
    padding: 0.125rem 0.375rem;
    background-color: #ef4444;
    color: white;
    font-size: 0.625rem;
    font-weight: 600;
    border-radius: 9999px;
    margin-left: auto;
}

.nav-badge.new {
    background-color: #10b981;
}

.nav-badge.beta {
    background-color: #f59e0b;
}

.nav-badge.deprecated {
    background-color: #6b7280;
}

/* Collapsible sections */
.sidebar-section.collapsible .sidebar-section-title {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-section.collapsible .sidebar-section-title::after {
    content: '';
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 4px solid currentColor;
    transition: transform 0.2s ease;
}

.sidebar-section.collapsible.collapsed .sidebar-section-title::after {
    transform: rotate(-90deg);
}

.sidebar-section.collapsible.collapsed ul {
    display: none;
}

/* Focus states for accessibility */
.nav-link:focus {
    outline: 2px solid #2563eb;
    outline-offset: -2px;
}

.sidebar-search .search-input:focus {
    outline: 2px solid #2563eb;
    outline-offset: -2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .sidebar {
        border-right-width: 2px;
    }
    
    .nav-link {
        border: 1px solid transparent;
    }
    
    .nav-link:hover,
    .nav-link:focus {
        border-color: currentColor;
    }
    
    .nav-link.active {
        border-color: var(--sidebar-active-border);
        border-width: 2px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .sidebar,
    .nav-link,
    .sidebar-overlay {
        transition: none;
    }
}

/* Print styles */
@media print {
    .sidebar {
        display: none;
    }
}