/* ============================================================
   DevTools Online — shell.css
   Layout principale, sidebar, topbar
   ============================================================ */

:root {
  --bg:        #080c14;
  --surface:   #0e1420;
  --surface2:  #141d2e;
  --surface3:  #1a2540;
  --border:    #1e2d45;
  --border2:   #253652;
  --accent:    #00d4ff;
  --accent2:   #0088aa;
  --green:     #00ff9d;
  --amber:     #ffb020;
  --red:       #ff4d6d;
  --text:      #dde4f0;
  --text2:     #8899bb;
  --muted:     #4a5a7a;
  --sidebar-w: 230px;
  --topbar-h:  48px;
  --radius:    10px;
  --glow-blue: 0 0 24px rgba(0,212,255,0.15);
  --glow-green:0 0 24px rgba(0,255,157,0.12);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; overflow: hidden; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Syne', sans-serif;
  font-size: 18px;
}

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

/* ── SIDEBAR ────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: transform 0.25s ease, width 0.25s ease;
  z-index: 100;
  overflow: hidden;
}

.sidebar.collapsed {
  width: 0;
  border-right: none;
}

/* Logo */
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 16px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.logo-mark {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1;
  display: flex;
  align-items: center;
  gap: 1px;
  flex-shrink: 0;
}

.logo-bracket { color: var(--accent); }
.logo-d {
  background: linear-gradient(135deg, var(--accent), #3399ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text);
  white-space: nowrap;
}

.logo-sub {
  font-size: 0.65rem;
  font-family: 'JetBrains Mono', monospace;
  white-space: nowrap;
}

/* Search */
.sidebar-search {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.sidebar-search input {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  padding: 7px 10px;
  transition: border-color 0.2s;
}

.sidebar-search input:focus {
  outline: none;
  border-color: var(--accent);
}

/* Nav scroll */
.nav-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0 16px;
  scrollbar-width: thin;
  scrollbar-color: var(--border2) transparent;
}

/* Nav groups */
.nav-group { margin-bottom: 4px; }

.nav-group-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px 4px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-family: 'JetBrains Mono', monospace;
  cursor: pointer;
  user-select: none;
  transition: color 0.2s;
}

.nav-group-label:hover { color: var(--text2); }
.nav-group-arrow { font-size: 0.6rem; transition: transform 0.2s; }
.nav-group.collapsed .nav-group-arrow { transform: rotate(-90deg); }
.nav-group.collapsed .nav-items { display: none; }

.nav-items { list-style: none; padding: 2px 8px; }

.nav-link {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: 7px;
  color: var(--text2);
  text-decoration: none;
  font-size: 0.84rem;
  font-weight: 600;
  transition: all 0.15s;
  cursor: pointer;
  margin-bottom: 1px;
  white-space: nowrap;
  position: relative;
}

.nav-link:hover:not(.nav-soon) {
  background: var(--surface3);
  color: var(--text);
}

.nav-link.active {
  background: linear-gradient(135deg, rgba(0,212,255,0.12), rgba(0,85,255,0.08));
  color: var(--accent);
  border: 1px solid rgba(0,212,255,0.18);
}

.nav-link.active::before {
  content: '';
  position: absolute;
  left: 0; top: 20%; bottom: 20%;
  width: 3px;
  background: var(--accent);
  border-radius: 0 2px 2px 0;
}

.nav-soon { opacity: 0.45; cursor: default; }
.nav-icon { font-size: 0.95rem; flex-shrink: 0; }
.nav-text { flex: 1; }

.nav-badge {
  font-size: 0.58rem;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}

.nav-badge.new  { background: rgba(0,255,157,0.15); color: var(--green); border: 1px solid rgba(0,255,157,0.3); }
.nav-badge.soon { background: rgba(255,176,32,0.1);  color: var(--amber); border: 1px solid rgba(255,176,32,0.25); }

/* Footer */
.sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid var(--border);
  font-size: 0.78rem;
  color: var(--text);
  font-family: 'JetBrains Mono', monospace;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  line-height: 1.5;
}

.footer-link {
  color: var(--text);
  text-decoration: none;
  transition: color 0.15s;
  font-weight: 600;
}

.footer-link:hover { color: var(--accent); }

.footer-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

/* ── MAIN AREA ──────────────────────────────────────────────── */
.main-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

/* Topbar */
.topbar {
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 18px;
  flex-shrink: 0;
}

.sidebar-toggle {
  background: none;
  border: none;
  color: var(--text2);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  transition: all 0.15s;
  line-height: 1;
}

.sidebar-toggle:hover { background: var(--surface2); color: var(--text); }

.breadcrumb {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  color: var(--text2);
  flex: 1;
}

.breadcrumb span { color: var(--muted); margin: 0 6px; }
.breadcrumb .current { color: var(--accent); }

.topbar-right { display: flex; align-items: center; gap: 10px; }

.topbar-badge {
  font-size: 0.65rem;
  font-family: 'JetBrains Mono', monospace;
  padding: 3px 8px;
  border-radius: 20px;
  background: rgba(0,212,255,0.08);
  color: var(--accent2);
  border: 1px solid rgba(0,212,255,0.15);
}

/* Footer principale (area destra) */
.main-footer {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 18px 14px;
  border-top: 1px solid var(--border);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  color: var(--text2);
  background: var(--surface);
  line-height: 1.5;
}

.main-footer-sep { color: var(--border2); }

.main-footer-link {
  color: var(--text2);
  text-decoration: none;
  transition: color 0.15s;
}
.main-footer-link:hover { color: var(--accent); }

/* Content area (SPA — niente iframe) */
.content-area {
  flex: 1;
  overflow-y: auto;
  overflow-x: clip;
  position: relative;
  padding: 10px 10px 30px 10px;
  scrollbar-width: thin;
  scrollbar-color: var(--border2) transparent;
  scrollbar-gutter: stable;
}

/* Loading spinner */
.loading-spinner {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 200px;
  font-size: 2rem;
  color: var(--muted);
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* Error state */
.error-state {
  text-align: center;
  padding: 80px 40px;
  color: var(--muted);
}

.error-state h2 { color: var(--text); margin: 16px 0 8px; font-size: 1.2rem; }
.error-state p  { font-family: 'JetBrains Mono', monospace; font-size: 0.82rem; margin-bottom: 24px; }
.error-state button {
  padding: 10px 22px; border-radius: 8px; border: 1px solid var(--border2);
  background: var(--surface2); color: var(--text); cursor: pointer;
  font-family: 'Syne', sans-serif; font-size: 0.9rem; font-weight: 600;
  transition: all 0.15s;
}
.error-state button:hover { border-color: var(--accent); color: var(--accent); }

/* Breadcrumb links */
.breadcrumb a {
  color: var(--text2);
  text-decoration: none;
  transition: color 0.15s;
}
.breadcrumb a:hover { color: var(--accent); }

/* ── SEARCH HIGHLIGHT ──────────────────────────────────────── */
.nav-link.hidden { display: none; }
.nav-group.all-hidden .nav-group-label { display: none; }
