/**
 * SIDEBAR.CSS — Exonoor Compact Sidebar
 * Minimalist, utilitarian styling matching the app's aesthetic.
 * Uses app's CSS variables: accent (red), success (green).
 */

/* ── Wrapper ───────────────────────────────────────────────── */
.sidebar-wrapper {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--bg-primary);
    overflow: hidden;
}

/* ── Navigation Section ─────────────────────────────────────── */
.sidebar-nav-vertical {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 6px;
    flex-shrink: 0;
}

.sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-secondary);
    border-radius: 4px;
    cursor: pointer;
    font-size: 12.5px;
    font-weight: 500;
    font-family: inherit;
    text-align: left;
    text-decoration: none;
    transition: all 0.15s ease;
}

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

.sidebar-nav-item.active {
    background: rgba(255, 71, 87, 0.12);
    color: var(--accent);
    border-color: rgba(255, 71, 87, 0.25);
    font-weight: 600;
}

.sidebar-nav-item i {
    font-size: 14px;
    width: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sidebar-nav-item span {
    position: relative;
    z-index: 1;
}

/* ── Divider ────────────────────────────────────────────────── */
.sidebar-divider {
    height: 1px;
    background: var(--border);
    margin: 6px;
    flex-shrink: 0;
}

.sidebar-divider-thick {
    height: 1px;
    background: var(--border);
    margin: 8px 0;
    flex-shrink: 0;
}

/* ── Content Area ───────────────────────────────────────────── */
.sidebar-content-area {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0 8px 8px;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.sidebar-content-area::-webkit-scrollbar {
    width: 3px;
}

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

.sidebar-content-area::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

/* ── Section Headers ────────────────────────────────────────── */
.sidebar-section-header {
    padding: 6px 4px 4px;
}

.sidebar-section-title {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.sidebar-section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.sidebar-group-title {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin: 10px 0 6px 0;
    padding-left: 4px;
}

/* ── Filter Stack ───────────────────────────────────────────── */
.sidebar-filter-stack {
    padding: 0;
}

.sidebar-field {
    margin-bottom: 10px;
}

.sidebar-field label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 4px;
    padding-left: 2px;
}

.sidebar-select {
    width: 100%;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 6px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-family: inherit;
    outline: none;
    cursor: pointer;
    transition: border-color 0.15s;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' fill='%237c8794' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    padding-right: 24px;
    color-scheme: dark light;
}

.sidebar-select:hover {
    border-color: var(--border-light);
}

.sidebar-select:focus {
    border-color: var(--accent);
}

/* ── Buttons ────────────────────────────────────────────────── */
.sidebar-primary-btn {
    width: 100%;
    background: var(--accent);
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 4px;
}

.sidebar-primary-btn:hover {
    background: var(--accent-hover);
}

.sidebar-primary-btn:active {
    transform: scale(0.98);
}

.sidebar-primary-btn i {
    font-size: 13px;
}

.sidebar-secondary-btn {
    width: 100%;
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border);
    padding: 7px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-bottom: 6px;
}

.sidebar-secondary-btn:hover {
    background: var(--bg-secondary);
    border-color: var(--border-light);
}

.sidebar-ghost-btn {
    background: transparent;
    color: var(--text-secondary);
    border: none;
    padding: 6px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.sidebar-ghost-btn:hover {
    color: var(--text-primary);
    background: var(--bg-secondary);
}

/* ── Future Grid ────────────────────────────────────────────── */
.sidebar-future-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
    margin-top: 4px;
}

.future-item {
    background: var(--bg-secondary);
    border: 1px dashed var(--border);
    padding: 8px 6px;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    opacity: 0.5;
    transition: all 0.15s ease;
    cursor: help;
}

.future-item:hover {
    opacity: 0.8;
    border-style: solid;
    border-color: var(--accent);
    background: rgba(255, 71, 87, 0.05);
}

.future-item i {
    font-size: 14px;
    color: var(--accent);
}

.future-item span {
    font-size: 9px;
    font-weight: 600;
    color: var(--text-muted);
    text-align: center;
    letter-spacing: 0.02em;
}

/* ── Footer Extra ───────────────────────────────────────────── */
.sidebar-footer-extra {
    padding: 0 8px 8px;
    flex-shrink: 0;
}

/* ── Badges & Tags ──────────────────────────────────────────── */
.sidebar-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    background: rgba(255, 71, 87, 0.12);
    color: var(--accent);
    border: 1px solid rgba(255, 71, 87, 0.25);
    margin-left: auto;
}

.sidebar-badge-success {
    background: rgba(16, 185, 129, 0.12);
    color: var(--success);
    border-color: rgba(16, 185, 129, 0.25);
}

.sidebar-badge-warning {
    background: rgba(245, 158, 11, 0.12);
    color: var(--warning);
    border-color: rgba(245, 158, 11, 0.25);
}

.sidebar-badge-danger {
    background: rgba(255, 71, 87, 0.12);
    color: var(--accent);
    border-color: rgba(255, 71, 87, 0.25);
}

/* ── Info Cards ─────────────────────────────────────────────── */
.sidebar-info-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 10px;
    margin-bottom: 8px;
}

.sidebar-info-card-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 3px;
}

.sidebar-info-card-desc {
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* ── Status Indicators ──────────────────────────────────────── */
.sidebar-status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.sidebar-status-dot.online {
    background: var(--success);
}

.sidebar-status-dot.offline {
    background: var(--text-muted);
}

.sidebar-status-dot.warning {
    background: var(--warning);
}

/* ── Empty State ─────────────────────────────────────────────── */
.sidebar-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px 12px;
    text-align: center;
    color: var(--text-muted);
    gap: 6px;
}

.sidebar-empty i {
    font-size: 22px;
    opacity: 0.4;
}

.sidebar-empty-text {
    font-size: 11px;
    line-height: 1.4;
}

/* ── Projects List ──────────────────────────────────────────── */
.sidebar-projects-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 6px;
}

.sidebar-project-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
    border: 1px solid transparent;
    background: transparent;
    width: 100%;
    text-align: left;
    font-family: inherit;
    font-size: 12px;
    color: var(--text-secondary);
}

.sidebar-project-item:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.sidebar-project-item.active {
    background: rgba(255, 71, 87, 0.1);
    color: var(--accent);
    border-color: rgba(255, 71, 87, 0.2);
}

.sidebar-project-item-name {
    font-weight: 500;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-project-item-meta {
    font-size: 9px;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 60px;
}

/* ── Language Selector ──────────────────────────────────────── */
.sidebar-lang-selector {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 8px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 4px;
    margin-top: 6px;
}

.sidebar-lang-selector select {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 11px;
    font-family: inherit;
    cursor: pointer;
    outline: none;
    color-scheme: dark light;
}
