/**
 * Universal Sidebar Styles
 * Responsive sidebar with minimize mode
 */

/* ============================================================================
   SIDEBAR BASE STYLES
   ============================================================================ */

.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 260px;
    height: 100vh;
    background: #161b22;
    border-right: 1px solid #30363d;
    padding: 1.5rem 1rem;
    padding-bottom: 72px;
    z-index: 100;
    overflow-y: auto;
    overflow-x: hidden;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
}

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

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

.sidebar::-webkit-scrollbar-thumb {
    background: #30363d;
    border-radius: 4px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: #484f58;
}

/* ============================================================================
   SIDEBAR MINIMIZED STATE
   ============================================================================ */

.sidebar-minimized {
    width: 70px;
}

.sidebar-minimized .sidebar-title,
.sidebar-minimized .sidebar-title-text,
.sidebar-minimized .sidebar-subtitle,
.sidebar-minimized .sidebar-link span,
.sidebar-minimized .status-text,
.sidebar-minimized .status-subtitle {
    opacity: 0;
    width: 0;
    overflow: hidden;
    display: none;
}

.sidebar-minimized .sidebar-header {
    justify-content: center;
    padding: 0.75rem 0.5rem;
}

.sidebar-minimized .sidebar-link {
    justify-content: center;
    padding: 0.75rem;
}

.sidebar-minimized .sidebar-status {
    padding: 0.75rem;
}

.sidebar-minimized .status-indicator {
    justify-content: center;
}

/* Show tooltips when minimized */
.sidebar-minimized .sidebar-link:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    margin-left: 1rem;
    padding: 0.5rem 1rem;
    background: rgba(0, 0, 0, 0.95);
    color: white;
    font-size: 0.875rem;
    border-radius: 0.5rem;
    white-space: nowrap;
    z-index: 1000;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* ============================================================================
   SIDEBAR TOGGLE BUTTON
   ============================================================================ */

.sidebar-toggle {
    position: fixed;
    left: 0;
    bottom: 0;
    width: 260px;
    height: 56px;
    background: #161b22;
    border: none;
    border-top: 1px solid #30363d;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.5);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.15s ease;
    z-index: 101;
}

.sidebar-toggle:hover {
    background: #0d1117;
    color: rgba(255, 255, 255, 0.9);
}

.sidebar-toggle:active {
    background: #0d1117;
}

.sidebar-minimized .sidebar-toggle {
    width: 70px;
}

.sidebar-minimized .sidebar-toggle i {
    transform: rotate(180deg);
}

/* ============================================================================
   SIDEBAR HEADER
   ============================================================================ */

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    padding: 0.75rem;
    background: transparent;
    border-bottom: 1px solid #30363d;
    border-radius: 0;
    padding-bottom: 1rem;
    transition: all 0.15s ease;
}

.sidebar-logo {
    width: 2.5rem;
    height: 2.5rem;
    background: #667eea;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: white;
    flex-shrink: 0;
}

.sidebar-title {
    flex: 1;
    min-width: 0;
    transition: all 0.3s ease;
}

.sidebar-title-text {
    font-size: 1.125rem;
    font-weight: 600;
    color: white;
    display: block;
    transition: all 0.15s ease;
}

.sidebar-subtitle {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    transition: all 0.15s ease;
}

/* ============================================================================
   SIDEBAR NAVIGATION
   ============================================================================ */

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    flex: 1;
    overflow-y: auto;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    border-radius: 0.5rem;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.875rem;
    transition: all 0.15s ease;
    position: relative;
}

.sidebar-link i {
    width: 1.125rem;
    text-align: center;
    font-size: 1rem;
    flex-shrink: 0;
    transition: all 0.15s ease;
}

.sidebar-link span {
    transition: all 0.3s ease;
    white-space: nowrap;
}

.sidebar-link:hover {
    background: #0d1117;
    color: white;
}

.sidebar-link.active {
    background: #667eea;
    color: white;
}

.sidebar-link.active i {
    color: white;
}

/* ============================================================================
   SIDEBAR STATUS
   ============================================================================ */

.sidebar-status {
    padding: 0.75rem;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 0.5rem;
    transition: all 0.15s ease;
    margin-top: 1rem;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
    transition: all 0.3s ease;
}

.status-dot {
    width: 6px;
    height: 6px;
    background: #10b981;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-text {
    font-size: 0.8125rem;
    font-weight: 500;
    color: #10b981;
    transition: all 0.15s ease;
}

.status-subtitle {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    margin-left: 1rem;
    transition: all 0.15s ease;
}

/* ============================================================================
   MAIN CONTENT ADJUSTMENT
   ============================================================================ */

.main-content {
    margin-left: 260px;
    transition: margin-left 0.2s ease;
    min-height: 100vh;
}

.main-content-expanded {
    margin-left: 70px;
}

/* ============================================================================
   MOBILE MENU BUTTON
   ============================================================================ */

.mobile-menu-btn {
    position: fixed;
    top: 1rem;
    left: 1rem;
    width: 2.5rem;
    height: 2.5rem;
    background: #667eea;
    border: none;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1rem;
    cursor: pointer;
    z-index: 99;
    transition: all 0.15s ease;
}

.mobile-menu-btn:hover {
    background: #5568d3;
}

.mobile-menu-btn:active {
    background: #5568d3;
}

/* ============================================================================
   RESPONSIVE DESIGN
   ============================================================================ */

/* Tablet (1024px and below) */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar-mobile-open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .main-content-expanded {
        margin-left: 0;
    }
    
    .sidebar-toggle {
        display: none;
    }
}

/* Mobile (768px and below) */
@media (max-width: 768px) {
    .sidebar {
        width: 280px;
    }
    
    .mobile-menu-btn {
        top: 0.75rem;
        left: 0.75rem;
        width: 2.5rem;
        height: 2.5rem;
        font-size: 1rem;
    }
}

/* Small Mobile (640px and below) */
@media (max-width: 640px) {
    .sidebar {
        width: 260px;
    }
}

/* Desktop (1280px and above) */
@media (min-width: 1280px) {
    .sidebar {
        width: 260px;
    }
    
    .main-content {
        margin-left: 260px;
    }
    
    .sidebar-minimized {
        width: 70px;
    }
}

/* ============================================================================
   ANIMATIONS
   ============================================================================ */

@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutLeft {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(-100%);
        opacity: 0;
    }
}

/* ============================================================================
   PRINT STYLES
   ============================================================================ */

@media print {
    .sidebar,
    .mobile-menu-btn,
    .sidebar-toggle {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0 !important;
    }
}

/* ============================================================================
   ACCESSIBILITY
   ============================================================================ */

.sidebar-link:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

.sidebar-toggle:focus,
.mobile-menu-btn:focus {
    outline: 2px solid white;
    outline-offset: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .sidebar,
    .sidebar-link,
    .main-content,
    .sidebar-toggle,
    .mobile-menu-btn {
        transition: none !important;
        animation: none !important;
    }
}
