/* FlowMind — Layout */

/* ── APP SHELL ──────────────────────────────────────────────────── */
.app-shell {
  position: relative;
  z-index: 1;
  display: flex;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

/* ── SIDEBAR ────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  transition: width 0.3s var(--ease), min-width 0.3s var(--ease);
  overflow: hidden;
}

.sidebar.collapsed { width: 58px; min-width: 58px; }

.sidebar-brand {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 16px;
  border-bottom: 1px solid var(--glass-border);
  flex-shrink: 0;
}

.brand-logo {
  width: 34px; height: 34px;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent-dim), rgba(0,217,166,0.1));
  border: 1px solid var(--accent-border);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  box-shadow: 0 0 20px var(--accent-glow);
  transition: box-shadow 0.3s;
}

.brand-logo:hover { box-shadow: 0 0 30px var(--accent-glow); }

.brand-name {
  font-family: 'JetBrains Mono', monospace;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.04em;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  white-space: nowrap;
  transition: opacity 0.2s;
}

.sidebar.collapsed .brand-name,
.sidebar.collapsed .nav-label,
.sidebar.collapsed .xp-row,
.sidebar.collapsed .xp-track,
.sidebar.collapsed .streak-label,
.sidebar.collapsed #sidebar-streak { opacity: 0; pointer-events: none; width: 0; overflow: hidden; }

.sidebar.collapsed .streak-widget { justify-content: center; }
.sidebar.collapsed .streak-fire { font-size: 18px; }

.sidebar-nav {
  flex: 1;
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-3);
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-size: 13.5px;
  font-weight: 500;
  text-align: left;
  width: 100%;
  white-space: nowrap;
  transition: all 0.18s var(--ease);
  position: relative;
  overflow: hidden;
}

.nav-item::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.02));
  opacity: 0;
  transition: opacity 0.2s;
}

.nav-item:hover {
  background: var(--glass-bg);
  color: var(--text-2);
  border-color: var(--glass-border);
}

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

.nav-item.active {
  background: var(--accent-dim);
  color: var(--accent);
  border-color: var(--accent-border);
  box-shadow: inset 0 0 0 1px rgba(79,142,255,0.1), 0 2px 12px rgba(79,142,255,0.1);
}

.nav-icon {
  font-size: 15px;
  flex-shrink: 0;
  width: 22px;
  text-align: center;
  transition: transform 0.2s var(--ease-spring);
}

.nav-item:hover .nav-icon { transform: scale(1.15); }
.nav-item.active .nav-icon { filter: drop-shadow(0 0 6px var(--accent)); }

.sidebar-footer {
  padding: 14px;
  border-top: 1px solid var(--glass-border);
  flex-shrink: 0;
}

.xp-widget { margin-bottom: 10px; }

.xp-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.xp-level-badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid var(--accent-border);
  padding: 2px 8px;
  border-radius: 20px;
  font-family: 'JetBrains Mono', monospace;
}

.xp-value {
  font-size: 11px;
  color: var(--text-3);
  font-family: 'JetBrains Mono', monospace;
}

.xp-track {
  height: 3px;
  background: rgba(255,255,255,0.06);
  border-radius: 4px;
  overflow: hidden;
}

.xp-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: 4px;
  width: 0%;
  transition: width 0.6s var(--ease);
  box-shadow: 0 0 8px var(--accent-glow);
}

.streak-widget {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text-3);
}

.streak-fire { font-size: 16px; }
.streak-label { opacity: 0.6; font-size: 11px; }

/* ── MAIN CONTENT ───────────────────────────────────────────────── */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-deep);
}

/* ── TOPBAR ─────────────────────────────────────────────────────── */
.topbar {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  flex-shrink: 0;
}

.topbar-title {
  flex: 1;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-1);
  letter-spacing: -0.01em;
}

.topbar-actions { display: flex; align-items: center; gap: 8px; }

/* ── VIEWS ──────────────────────────────────────────────────────── */
.view { display: none; flex: 1; overflow-y: auto; padding: 22px 24px; flex-direction: column; gap: 18px; }
.view.active { display: flex; }

.view-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 2px; }

.view-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text-1);
  line-height: 1.2;
}

.view-subtitle { font-size: 13px; color: var(--text-3); margin-top: 3px; }
