/* ═══════════════════════════════════════════════════════════════════════════
   NoteHub — UI Lesbarkeits-Verbesserungen
   Wird am Ende von notehub_browser.css eingefügt.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Typografie & Lesbarkeit ─────────────────────────────────────────────── */

/* Bessere Schriftfamilie mit Fallback-Kette */
:root {
  --font-sans: "Inter", ui-sans-serif, -apple-system, BlinkMacSystemFont,
               "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", "Fira Code", "Cascadia Code",
               ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, monospace;

  /* Verbesserte Farbkontraste (WCAG AA-konform) */
  --fg-3: #4b5563;    /* War #64748b — besser lesbar (Kontrastverh. > 4.5:1) */
  --fg-4: #6b7280;    /* War #94a3b8 */

  /* Fokus-Ring */
  --focus-ring: 0 0 0 3px rgba(37, 99, 235, 0.25);

  /* Tabellen */
  --table-stripe: #fafbfc;
  --table-border: #eaedf1;
}

body {
  font-family: var(--font-sans);
  line-height: 1.6;        /* War implizit ~1.4 — besser lesbar */
  font-size: 14.5px;       /* Minimal größer für bessere Lesbarkeit */
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Bessere Link-Lesbarkeit */
a {
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

/* ── Verbesserte Fokus-Indikatoren (Accessibility) ───────────────────────── */
*:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 3px;
}
button:focus-visible, a:focus-visible {
  box-shadow: var(--focus-ring);
}

/* ── Tabellen-Lesbarkeit ─────────────────────────────────────────────────── */
.nh-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  line-height: 1.5;
}
.nh-table th {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--fg-3);
  padding: 10px 14px;
  background: var(--bg-1);
  border-bottom: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
}
.nh-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--table-border);
  color: var(--fg);
  vertical-align: middle;
  line-height: 1.5;
}
.nh-table tbody tr:nth-child(even) { background: var(--table-stripe); }
.nh-table tbody tr:hover           { background: var(--hover); }
.nh-table tbody tr:last-child td   { border-bottom: none; }

/* Zellen mit sekundären Infos */
.nh-table .cell-meta {
  font-size: 12.5px;
  color: var(--fg-3);
}
.nh-table .cell-name {
  font-weight: 500;
  color: var(--fg);
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Verbesserte Card-Lesbarkeit ─────────────────────────────────────────── */
.nh-card-header {
  font-size: 13.5px;    /* War 13px */
  font-weight: 600;
  letter-spacing: -.01em;
}

/* ── Verbesserte Form-Elemente ───────────────────────────────────────────── */
.nh-input {
  padding: 8px 11px;          /* War 7px 10px — besser klickbar */
  font-size: 14px;            /* War 13.5px */
  line-height: 1.5;
}
.nh-input::placeholder { color: var(--fg-4); }
.nh-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--fg-2);
  margin-bottom: 6px;
}
.nh-form-group { margin-bottom: 18px; }

/* Textarea */
textarea.nh-input {
  resize: vertical;
  min-height: 80px;
}

/* ── Verbesserte Buttons ─────────────────────────────────────────────────── */
.btn-nh-primary {
  padding: 7px 16px;    /* War 6px 14px */
  font-size: 13.5px;
  letter-spacing: -.01em;
  transition: background .12s, box-shadow .12s, transform .08s;
}
.btn-nh-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(37,99,235,.3); }
.btn-nh-primary:active { transform: none; }

.btn-nh-ghost {
  padding: 6px 13px;    /* War 5px 12px */
  font-size: 13.5px;
  transition: background .12s, border-color .12s;
}

/* Danger-Button */
.btn-nh-danger {
  background: var(--danger);
  color: #fff;
  border: none;
  border-radius: var(--r-sm);
  padding: 7px 16px;
  font-size: 13.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  cursor: pointer;
  transition: background .12s, box-shadow .12s;
}
.btn-nh-danger:hover { background: #b91c1c; color: #fff; }

/* ── Verbesserte Badges & Tags ───────────────────────────────────────────── */
.nh-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--r-pill);
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
}
.nh-badge-blue   { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.nh-badge-green  { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
.nh-badge-yellow { background: #fefce8; color: #a16207; border: 1px solid #fde68a; }
.nh-badge-red    { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.nh-badge-gray   { background: var(--bg-2); color: var(--fg-2); border: 1px solid var(--border); }

/* ── Verbesserte Empty-States ────────────────────────────────────────────── */
.nh-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 64px 32px;
  text-align: center;
  color: var(--fg-3);
}
.nh-empty-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--bg-2);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  font-size: 24px;
  color: var(--fg-4);
  margin-bottom: 16px;
}
.nh-empty-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 6px;
}
.nh-empty-sub {
  font-size: 13.5px;
  color: var(--fg-3);
  line-height: 1.6;
  max-width: 360px;
  margin-bottom: 20px;
}

/* ── Verbesserte Sidebar-Lesbarkeit ──────────────────────────────────────── */
.sidebar-section-label {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--sidebar-fg-3);
  padding: 4px 8px;
  margin: 10px 0 4px;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;       /* Mehr vertikaler Platz */
  border-radius: var(--r);
  font-size: 13.5px;       /* War 13px */
  color: var(--sidebar-fg);
  text-decoration: none;
  transition: background .1s, color .1s;
  line-height: 1.4;
}
.sidebar-item:hover  { background: var(--sidebar-bg-hover); }
.sidebar-item.active {
  background: var(--sidebar-bg-active);
  color: var(--sidebar-accent);
  font-weight: 600;
}
.sidebar-item i { font-size: 14px; flex-shrink: 0; }

/* ── Verbesserte Nav-Links ───────────────────────────────────────────────── */
.nh-nav-link {
  font-size: 14px;       /* War 13.5px */
  padding: 6px 11px;     /* War 5px 10px */
}

/* ── Detail-Panel Lesbarkeit ─────────────────────────────────────────────── */
.detail-meta-label {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--fg-4);
  margin-bottom: 2px;
}
.detail-meta-value {
  font-size: 13.5px;
  color: var(--fg-2);
  line-height: 1.5;
}

/* ── Code / Mono-Bereiche ────────────────────────────────────────────────── */
code, kbd, pre, samp {
  font-family: var(--font-mono);
  font-size: .875em;
}
code {
  background: var(--bg-2);
  padding: 1px 5px;
  border-radius: 4px;
  border: 1px solid var(--border);
  color: var(--fg-2);
}
pre {
  background: var(--bg-2);
  padding: 14px 16px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  overflow-x: auto;
  line-height: 1.6;
}
pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: inherit;
}

/* ── Toast-Verbesserungen ────────────────────────────────────────────────── */
.nh-toast {
  font-size: 14px;     /* War 13px */
  padding: 11px 18px;
  border-radius: var(--r-md);
  box-shadow: 0 8px 32px rgba(15, 23, 42, .18), 0 2px 8px rgba(15, 23, 42, .1);
}

/* ── Scrollbar-Styling (WebKit) ──────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg-3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-strong); }

/* ── Responsive: Bessere mobile Abstände ─────────────────────────────────── */
@media (max-width: 768px) {
  .nh-page { padding: 16px; }
  .page-title { font-size: 18px; }
  .nh-table th, .nh-table td { padding: 9px 10px; }
}

/* ── Print-Styles ────────────────────────────────────────────────────────── */
@media print {
  .nh-nav, .sidebar, .detail-panel,
  .btn-nh-primary, .btn-nh-ghost, .btn-nh-danger { display: none !important; }
  body { font-size: 12pt; color: #000; background: #fff; }
  a { color: #000; text-decoration: underline; }
}
