/* ============================================================
   Neural Frontier — sidebar.css
   Sidebar icon-only (siempre estrecho, sin toggle)
   ============================================================ */

.sidebar {
  width: var(--sidebar-collapsed);
  min-width: var(--sidebar-collapsed);
  height: 100dvh;
  background: var(--bg-sidebar);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-right: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  z-index: 100;
  flex-shrink: 0;
}

/* ---------- Header del Sidebar ---------- */
.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px 0 14px;
  flex-shrink: 0;
  min-height: 64px;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(192, 132, 252, 0.1);
  border-radius: var(--r-md);
  box-shadow: 0 0 0 1px rgba(192, 132, 252, 0.25);
}

/* ---------- Separador ---------- */
.sidebar-separator {
  height: 1px;
  background-color: var(--border);
  margin: 0 12px;
  flex-shrink: 0;
  transition: background-color var(--transition);
}

/* ---------- Navegación ---------- */
.sidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 12px 0;
  gap: 2px;
  overflow-y: auto;
  overflow-x: hidden;
}

.nav-item {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  position: relative;
  transition: background-color var(--transition), color var(--transition);
  cursor: pointer;
  margin: 0 8px;
}

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

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

.nav-item.active:hover {
  background-color: var(--accent-subtle);
}

/* Empujar configuración al fondo */
.nav-item--bottom {
  margin-top: auto;
}

.nav-flex-spacer {
  flex: 1;
  min-height: 8px;
}

.nav-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: currentColor;
}

/* Ocultar labels (siempre icon-only) */
.nav-label {
  display: none;
}

/* ---------- Tooltip siempre activo (hover) ---------- */
.nav-item::after {
  content: attr(data-tooltip);
  position: absolute;
  left: calc(var(--sidebar-collapsed) - 8px);
  top: 50%;
  transform: translateY(-50%);
  background-color: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-size: 0.82rem;
  font-weight: var(--fw-medium);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
  box-shadow: var(--shadow-md);
  z-index: 200;
}

.nav-item:hover::after {
  opacity: 1;
}

/* ---------- Responsive Mobile ---------- */
@media (max-width: 768px) {
  .sidebar {
    width: 100%;
    min-width: unset;
    height: auto;
    flex-direction: row;
    border-right: none;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
  }

  .sidebar-header {
    padding: 8px 12px;
    min-height: unset;
  }

  .sidebar-separator {
    display: none;
  }

  .sidebar-nav {
    flex-direction: row;
    padding: 8px 4px;
    gap: 2px;
    overflow-x: auto;
    overflow-y: hidden;
    flex: 1;
  }

  .nav-item--bottom {
    margin-top: 0;
    margin-left: auto;
  }

  .nav-item::after {
    display: none;
  }
}
