/**
 * Sidebar Component Styles
 * =========================
 */

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    z-index: var(--z-sticky);
    transition: transform var(--duration-slow) var(--ease-default);
}

/* Sidebar Header */
.sidebar-header {
    padding: var(--space-5);
    border-bottom: 1px solid var(--border-subtle);
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.logo-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-primary);
}

.logo-icon svg {
    width: 100%;
    height: 100%;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.5;
}

.logo-text {
    font-size: var(--text-lg);
    font-weight: 700;
    letter-spacing: var(--tracking-tight);
    color: var(--text-primary);
}

/* Sidebar Navigation */
.sidebar-nav {
    flex: 1;
    padding: var(--space-4);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
}

.nav-section {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.nav-section-title {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: var(--tracking-widest);
    color: var(--text-tertiary);
    padding: var(--space-2) var(--space-3);
    margin-bottom: var(--space-1);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-3);
    border-radius: var(--radius-lg);
    color: var(--text-secondary);
    font-size: var(--text-sm);
    font-weight: 500;
    transition: all var(--duration-fast) var(--ease-default);
    cursor: pointer;
    position: relative;
}

.nav-item svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
}

.nav-item:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--accent-soft);
    color: var(--accent-primary);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 20px;
    background: var(--accent-primary);
    border-radius: 0 var(--radius-xs) var(--radius-xs) 0;
}

/* Navigation Section Divider */
.nav-section-divider {
    height: 1px;
    background: var(--border-subtle);
    margin: var(--space-3) 0;
}

/* Navigation Section Label */
.nav-section-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: var(--tracking-widest);
    color: var(--text-tertiary);
    padding: var(--space-2) var(--space-3);
}

/* Sidebar Footer */
.sidebar-footer {
    padding: var(--space-4);
    border-top: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

/* Theme Toggle */
.theme-toggle {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3);
    border-radius: var(--radius-lg);
    color: var(--text-secondary);
    font-size: var(--text-sm);
    font-weight: 500;
    transition: all var(--duration-fast) var(--ease-default);
    width: 100%;
}

.theme-toggle:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.theme-toggle svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
}

.theme-toggle .icon-sun {
    display: block;
}

.theme-toggle .icon-moon {
    display: none;
}

[data-theme="light"] .theme-toggle .icon-sun {
    display: none;
}

[data-theme="light"] .theme-toggle .icon-moon {
    display: block;
}

/* User Profile */
.user-profile {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3);
    border-radius: var(--radius-lg);
    transition: background var(--duration-fast) var(--ease-default);
    cursor: pointer;
}

.user-profile:hover {
    background: var(--bg-card);
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-sm);
    font-weight: 600;
    flex-shrink: 0;
}

.avatar-sand {
    background: var(--accent-soft);
    color: var(--accent-primary);
}

.avatar-terracotta {
    background: var(--terracotta-soft);
    color: var(--terracotta);
}

.avatar-olive {
    background: var(--olive-soft);
    color: var(--olive);
}

.avatar-clay {
    background: var(--clay-soft);
    color: var(--clay);
}

.user-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.user-name {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-primary);
}

.user-plan {
    font-size: var(--text-xs);
    color: var(--accent-primary);
}

.user-plan-date {
    font-size: 10px;
    color: var(--text-muted);
    display: block;
}

/* User Profile Section with Menu */
.user-profile-section {
    position: relative;
}

.user-profile .profile-chevron {
    margin-left: auto;
    color: var(--text-tertiary);
    transition: transform var(--duration-fast) var(--ease-default);
}

.user-profile-section.menu-open .profile-chevron {
    transform: rotate(180deg);
}

.user-profile .avatar-emoji {
    font-size: 18px;
}

/* Profile Menu Dropdown */
.profile-menu {
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    padding: var(--space-2);
    margin-bottom: var(--space-2);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all var(--duration-fast) var(--ease-default);
    box-shadow: var(--shadow-lg);
    z-index: 100;
    backdrop-filter: blur(12px);
}

.user-profile-section.menu-open .profile-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.profile-menu-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    width: 100%;
    padding: var(--space-3);
    border-radius: var(--radius-md);
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: var(--text-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-default);
}

.profile-menu-item:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.profile-menu-item svg {
    flex-shrink: 0;
}

.profile-menu-logout {
    color: var(--terracotta);
}

.profile-menu-logout:hover {
    background: rgba(180, 83, 63, 0.1);
    color: var(--terracotta);
}

/* Avatar colors for profiles */
.avatar-ochre {
    background: rgba(199, 163, 89, 0.15);
    color: var(--ochre);
}

.avatar-sage {
    background: rgba(156, 175, 136, 0.15);
    color: var(--sage);
}
