/* Shared Sidebar Styles */

.sidebar {
    width: 240px;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.logo {
    padding: 24px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-img {
    display: block;
    width: 36px;
    height: 36px;
    object-fit: contain;
}

.logo-title {
    display: flex;
    flex-direction: column;
    font-size: 18px;
    font-weight: 800;
    line-height: 1.1;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.logo-title span:first-child {
    /* color: var(--accent-blue); */
}

.nav {
    padding: 16px 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
}

.nav-item:hover {
    background: var(--bg-hover);
}

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

.nav-item .material-symbols-rounded {
    font-size: 20px;
}

.nav-footer {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
    margin-left: -12px;
    margin-right: -12px;
    padding-left: 12px;
    padding-right: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.theme-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.15s;
    font-family: inherit;
}

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

.theme-toggle .material-symbols-rounded {
    font-size: 20px;
}

/* Hide light icon by default, show when dark */
.theme-toggle .icon-light {
    display: none;
}

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

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

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

/* Handle system dark preference for icons if no manual theme is set */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .theme-toggle .icon-light {
        display: block;
    }

    :root:not([data-theme="light"]) .theme-toggle .icon-dark {
        display: none;
    }
}

/* Responsive Sidebar Collapse */
@media (max-width: 768px) {
    .sidebar {
        width: 64px !important;
        transition: width 0.2s ease;
    }

    .logo {
        padding: 16px 0;
        text-align: center;
        display: flex;
        justify-content: center;
        border-bottom: 1px solid var(--border-color);
    }

    .logo-title,
    .logo-subtitle {
        display: none;
    }

    .logo-img {
        display: block;
    }

    .nav {
        padding: 12px 8px;
    }

    .nav-item {
        justify-content: center;
        padding: 10px 0;
        gap: 0;
    }

    .nav-item span:not(.material-symbols-rounded) {
        display: none;
    }

    .nav-footer {
        padding: 12px 0;
        margin: 0;
        align-items: center;
        border-top: 1px solid var(--border-color);
    }

    .theme-toggle {
        justify-content: center;
        padding: 10px 0;
        gap: 0;
    }

    .theme-label {
        display: none;
    }
}