/* Sidebar Component - Traffic Count */

/* Modern Dark Sidebar */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    background: var(--dark-gradient);
    border-right: 1px solid var(--border-color);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 50;
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow-xl);
}

.sidebar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="32" height="32" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg"><defs><pattern id="dots" width="16" height="16" patternUnits="userSpaceOnUse"><circle cx="8" cy="8" r="1" fill="rgba(59,130,246,0.1)"/></pattern></defs><rect width="100%" height="100%" fill="url(%23dots)"/></svg>');
    opacity: 0.3;
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

.sidebar.collapsed .sidebar-text {
    opacity: 0;
    visibility: hidden;
    transform: translateX(-10px);
}

.sidebar.collapsed .sidebar-brand-text {
    display: none;
}

.sidebar.collapsed .sidebar-item {
    justify-content: center;
    padding: 1rem;
    position: relative;
}

.sidebar.collapsed .sidebar-item-text {
    display: none;
}

.sidebar.collapsed .sidebar-item-icon {
    margin-right: 0;
}

/* Sidebar Header */
.sidebar-brand {
    display: flex;
    align-items: center;
    padding: 1.5rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
    backdrop-filter: blur(10px);
    position: relative;
    z-index: 10;
}

.sidebar-brand img {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
}

.sidebar-brand-text {
    margin-left: 0.75rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Sidebar Navigation */
.sidebar nav {
    padding: 1rem 0;
    height: calc(100vh - 80px);
    overflow-y: auto;
    position: relative;
    z-index: 10;
}

.sidebar nav::-webkit-scrollbar {
    width: 4px;
}

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

.sidebar nav::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 2px;
}

.sidebar nav::-webkit-scrollbar-thumb:hover {
    background: var(--border-hover);
}

.sidebar-item {
    display: flex;
    align-items: center;
    padding: 0.875rem 1.25rem;
    margin: 0.25rem 0.75rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 12px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    font-weight: 500;
    letter-spacing: -0.025em;
}

.sidebar-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 0;
    background: var(--primary-gradient);
    border-radius: 0 2px 2px 0;
    transition: height 0.2s ease;
}

.sidebar-item:hover {
    background: var(--bg-card);
    color: var(--text-accent);
    transform: translateX(4px);
}

.sidebar-item:hover::before {
    height: 60%;
}

.sidebar-item.active {
    background: var(--accent-gradient);
    color: var(--text-on-primary);
    box-shadow: var(--shadow-md);
    transform: translateX(0);
}

.sidebar-item.active::before {
    height: 100%;
    background: rgba(255, 255, 255, 0.3);
}

.sidebar-item-icon {
    width: 20px;
    height: 20px;
    margin-right: 0.875rem;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.sidebar-item:hover .sidebar-item-icon {
    transform: scale(1.1);
}

.sidebar-text {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.875rem;
}

/* Mobile Sidebar */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        position: fixed;
        height: 100vh;
        z-index: 60;
    }
    
    .sidebar.mobile-open {
        transform: translateX(0);
    }
}

/* Tooltip for collapsed sidebar */
.tooltip {
    position: relative;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    margin-left: 0.5rem;
    z-index: 100;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
}

.tooltip:hover::after {
    opacity: 1;
    visibility: visible;
}