/* ============================================================================
   GitHubDB · css/app.css — SHELL (App-Gerüst)
   ----------------------------------------------------------------------------
   Zuständig für das App-Skelett aus index.html (baut auf css/base.css auf).
   EIGENE COMPONENT-CLASSES (ausschließlich hier definieren):
     .topbar, .topbar-inner, .brand, .brand-mark, .tabs, .tab,
     .topbar-right, .ratelimit(.low), .dropdown, .dropdown-menu,
     .dialog, .dialog-actions, .token-steps, .token-get, .tooltip,
     .footer
   Die kritischen JS-Bindungen von js/app.js (Element-IDs
   #view, #ratelimit, #tokenBtn, #tokenDialog, #tokenInput, #tokenSave,
   #tokenClear, #moreBtn, #moreMenu, #moreDropdown, #tooltip) dürfen in
   index.html NICHT geändert werden.
   ========================================================================== */

/* ---------- Topbar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: var(--z-nav);
  background: var(--bg-elev);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.topbar-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-5);
  height: 56px;
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--text-1);
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.brand:hover { text-decoration: none; }
.brand-mark { flex-shrink: 0; }
.brand em {
  color: var(--accent);
  font-style: normal;
}

/* ---------- Navigation ---------- */
.tabs {
  display: flex;
  gap: 2px;
  flex: 1;
  align-items: center;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }

.tab {
  background: none;
  border: none;
  color: var(--text-2);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  font-family: inherit;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
  transition: background-color var(--transition-fast) var(--ease-out),
              color var(--transition-fast) var(--ease-out);
}
.tab:hover { color: var(--text-1); background: var(--surface-2); text-decoration: none; }
.tab.active {
  color: var(--accent);
  background: var(--accent-muted);
}

/* ---------- Rechte Topbar (Rate-Limit + Token) ---------- */
.topbar-right { display: flex; align-items: center; gap: var(--space-2); }

/* Sprachumschalter (js/i18n.js) */
.lang-select {
  max-width: 140px;
  font-size: var(--text-xs);
  padding: 4px 6px;
  cursor: pointer;
}

.ratelimit {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.ratelimit::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 2px rgba(63, 185, 80, 0.2);
}
.ratelimit.low { color: var(--danger); }
.ratelimit.low::before {
  background: var(--danger);
  box-shadow: 0 0 0 2px rgba(248, 81, 73, 0.2);
}

/* ---------- "Mehr"-Dropdown ---------- */
.dropdown { position: relative; }

.dropdown-menu {
  position: fixed;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 6px;
  min-width: 176px;
  box-shadow: var(--shadow-pop);
  z-index: var(--z-dropdown);
}
.dropdown-menu a {
  display: block;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-size: var(--text-sm);
  transition: background-color var(--transition-fast) var(--ease-out),
              color var(--transition-fast) var(--ease-out);
}
.dropdown-menu a:hover { background: var(--surface-2); color: var(--text-1); text-decoration: none; }
.dropdown-menu a.active { background: var(--accent-muted); color: var(--accent); }

/* ---------- Dialog (Token) ---------- */
.dialog {
  background: var(--surface-1);
  color: var(--text-1);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: var(--space-6);
  max-width: 480px;
  width: min(90vw, 480px);
  box-shadow: var(--shadow-pop);
  z-index: var(--z-dialog);
}
.dialog::backdrop { background: rgba(0, 0, 0, 0.65); z-index: var(--z-overlay); }
.dialog h3 { margin-bottom: var(--space-2); }
.dialog p { color: var(--text-2); font-size: var(--text-sm); margin-bottom: var(--space-4); }
.dialog .input { width: 100%; margin-bottom: var(--space-4); }

.token-steps {
  font-size: var(--text-sm);
  color: var(--text-2);
  margin: 0 0 var(--space-3) 18px;
}
.token-steps li { margin-bottom: 4px; }

.token-get {
  display: inline-flex;
  width: 100%;
  text-align: center;
  justify-content: center;
  margin-bottom: var(--space-3);
}
.token-get:hover { text-decoration: none; }

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-2);
}

/* ---------- Tooltip ---------- */
.tooltip {
  position: fixed;
  z-index: var(--z-tooltip);
  background: var(--surface-3);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 5px 10px;
  font-size: var(--text-xs);
  line-height: var(--leading-xs);
  color: var(--text-1);
  pointer-events: none;
  box-shadow: var(--shadow-pop);
  max-width: 280px;
}

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--border);
  padding: var(--space-5) var(--space-4);
  text-align: center;
  color: var(--text-3);
  font-size: var(--text-xs);
  line-height: var(--leading-sm);
}
.footer p { max-width: 720px; margin: 0 auto; }

/* ---------- Responsive Shell ---------- */
@media (max-width: 860px) {
  .topbar-inner { gap: var(--space-3); }
  .brand-text { display: none; }  /* Marke bleibt als reines Symbol */
}
@media (max-width: 480px) {
  .ratelimit { display: none; }  /* Meta auf kleinsten Screens ausblenden */
}
