/* =============================================================
   SEOlyze CI Layout v3.0 (2026-04-21)
   -------------------------------------------------------------
   Area-adaptive Chrome (Sidebar + Topbar + Help-Panel).
   Defaults to AI area (violet) — override by setting
   `body.ci-page.area-analyse|rank|future` to switch accent.
   DOM-Struktur, Klassen und IDs bleiben 1:1 mit ci_layout.js
   kompatibel (.fd-ci-sidebar, .fd-sb-item, .fd-ci-nav, .ci-help,
   #ci-content-row, #notif-bell-wrap, .fd-ci-lang-switch).
   ============================================================= */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

/* -------------------------------------------------------------
   1. THEME VARS (area-adaptive accent + chrome surfaces)
   ------------------------------------------------------------- */
body.ci-page {
  /* Chrome-Geometrie */
  --ci-sb-w: 260px;
  --ci-help-w: 320px;
  --ci-nav-h: 56px;
  --ci-radius: 12px;
  --ci-radius-sm: 8px;
  --ci-radius-xs: 6px;

  /* Dark Sidebar (Design-Direction: Dark-Sidebar + Light-Content) */
  --ci-sb-bg: #0f1419;
  --ci-sb-bg-2: #070b10;
  --ci-sb-border: rgba(255,255,255,.07);
  --ci-sb-fg: #e3e7ee;
  --ci-sb-fg-muted: #8b94a3;
  --ci-sb-fg-heading: #5e6775;
  --ci-sb-hover: rgba(255,255,255,.06);
  --ci-sb-hover-strong: rgba(255,255,255,.10);

  /* Light Content Surfaces */
  --ci-app-bg: #fafbfc;
  --ci-card: #ffffff;
  --ci-border: #eaedf2;
  --ci-border-soft: #f4f6f8;
  --ci-t1: #1a1f2e;
  --ci-t2: #4a5163;
  --ci-t3: #9aa1ad;

  /* Area-adaptive Accent — default = AI violet */
  --ci-accent: #8f5fc4;
  --ci-accent-hover: #7849a8;
  --ci-accent-soft: rgba(143, 95, 196, .12);
  --ci-accent-strong: rgba(143, 95, 196, .20);
  --ci-accent-gradient: linear-gradient(135deg, #a074ce 0%, #7849a8 100%);
  --ci-accent-shadow: 0 4px 14px rgba(143, 95, 196, .30);
}

/* Area overrides (falls body zusätzlich .area-* Klasse trägt) */
body.ci-page.area-analyse {
  --ci-accent: #ff9000;
  --ci-accent-hover: #e07b00;
  --ci-accent-soft: rgba(255,144,0,.12);
  --ci-accent-strong: rgba(255,144,0,.20);
  --ci-accent-gradient: linear-gradient(135deg,#ffa11a 0%,#e07b00 100%);
  --ci-accent-shadow: 0 4px 14px rgba(255,144,0,.30);
}
body.ci-page.area-rank {
  --ci-accent: #97bf0d;
  --ci-accent-hover: #7da30a;
  --ci-accent-soft: rgba(151,191,13,.14);
  --ci-accent-strong: rgba(151,191,13,.22);
  --ci-accent-gradient: linear-gradient(135deg,#a5cc3a 0%,#7da30a 100%);
  --ci-accent-shadow: 0 4px 14px rgba(151,191,13,.30);
}
body.ci-page.area-future {
  --ci-accent: #1a70a1;
  --ci-accent-hover: #145a84;
  --ci-accent-soft: rgba(26,112,161,.14);
  --ci-accent-strong: rgba(26,112,161,.22);
  --ci-accent-gradient: linear-gradient(135deg,#2d86b5 0%,#145a84 100%);
  --ci-accent-shadow: 0 4px 14px rgba(26,112,161,.30);
}

/* -------------------------------------------------------------
   2. BASE — body.ci-page becomes the flex frame
   ------------------------------------------------------------- */
html, body.ci-page { margin: 0; padding: 0; height: 100%; overflow: hidden; }

body.ci-page {
  display: flex !important;
  flex-direction: row !important;
  height: 100vh !important;
  overflow: hidden !important;
  background: var(--ci-sb-bg) !important;
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: var(--ci-t1);
}

/* Legacy menu-tmpl topbar/nav sind im ci-page Layout NICHT sichtbar —
   ci_layout.js injiziert die echte Sidebar + Topbar. */
body.ci-page .seo-topbar,
body.ci-page .seo-nav { display: none !important; }

/* Das Template kann in seltenen Fällen ein verschachteltes .aiCreationTheme
   enthalten (altes menu.tmpl inside seo-page). Doppelt → verstecken. */
body.ci-page .aiCreationTheme .aiCreationTheme { display: none !important; }

/* -------------------------------------------------------------
   3. MAIN CONTENT COLUMN
   ------------------------------------------------------------- */
body.ci-page > .aiCreationTheme {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  background: var(--ci-app-bg);
}

#ci-content-row {
  flex: 1;
  display: flex;
  flex-direction: row;
  overflow: hidden;
  min-width: 0;
}

body.ci-page .seo-page {
  flex: 1;
  overflow-y: auto;
  padding: 22px 28px 36px;
  max-width: none;
  margin: 0;
  background: transparent;
}

/* Scrollbars */
body.ci-page ::-webkit-scrollbar { width: 6px; height: 6px; }
body.ci-page ::-webkit-scrollbar-track { background: transparent; }
body.ci-page ::-webkit-scrollbar-thumb { background: #d1d6dc; border-radius: 3px; }
body.ci-page ::-webkit-scrollbar-thumb:hover { background: #b8bfc9; }

/* -------------------------------------------------------------
   4. DARK LEFT SIDEBAR
   ------------------------------------------------------------- */
.fd-ci-sidebar {
  width: var(--ci-sb-w);
  min-width: var(--ci-sb-w);
  height: 100vh;
  flex-shrink: 0;
  background: linear-gradient(180deg, var(--ci-sb-bg) 0%, var(--ci-sb-bg-2) 100%);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 10px 18px;
  scrollbar-width: none;
}
.fd-ci-sidebar::-webkit-scrollbar { display: none; }

/* Logo header */
.fd-ci-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px 10px 18px;
  flex-shrink: 0;
  gap: 8px;
  border-bottom: 1px solid var(--ci-sb-border);
  margin-bottom: 8px;
}
.fd-ci-logo-img {
  height: 30px;
  width: auto;
  object-fit: contain;
  max-width: calc(var(--ci-sb-w) - 56px);
}
.fd-ci-logo-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--ci-accent);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  border-radius: 4px;
  padding: 2px 6px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1;
  flex-shrink: 0;
}

/* Sidebar group labels (collapsible headings) */
.fd-sb-group { margin-bottom: 4px; }
.fd-sb-group-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ci-sb-fg-heading);
  padding: 14px 8px 6px;
}
.fd-sb-group-label::before {
  content: '';
  display: block;
  width: 14px;
  height: 1.5px;
  flex-shrink: 0;
  background: rgba(255,255,255,.16);
  border-radius: 2px;
}
.fd-sb-toggle { user-select: none; cursor: pointer; }
.fd-sb-toggle:hover { color: #a0a8b6; }
.fd-sb-chevron {
  margin-left: auto;
  flex-shrink: 0;
  color: rgba(255,255,255,.30);
  transition: transform .2s ease;
}

/* Collapsible wrapper */
.fd-sb-items {
  overflow: hidden;
  max-height: 600px;
  transition: max-height .22s ease, opacity .18s ease;
  opacity: 1;
}
.fd-sb-items.fd-sb-collapsed {
  max-height: 0;
  opacity: 0;
}

/* Nav items */
.fd-sb-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--ci-radius-sm);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--ci-sb-fg);
  text-decoration: none;
  transition: background .12s ease, color .12s ease;
  user-select: none;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  width: 100%;
  box-sizing: border-box;
  min-height: 36px;
}
.fd-sb-item:hover {
  background: var(--ci-sb-hover);
  color: #fff;
}
/* Active state — area-adaptive gradient */
.fd-sb-item.active {
  background: var(--ci-accent-gradient);
  color: #fff;
  font-weight: 600;
  box-shadow: var(--ci-accent-shadow), inset 0 1px 0 rgba(255,255,255,.14);
}

/* Icon box (emoji/SVG holder) */
.fd-sb-icon {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  flex-shrink: 0;
  background: rgba(255,255,255,.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  line-height: 1;
  transition: background .12s ease;
}
.fd-sb-item:hover .fd-sb-icon  { background: rgba(255,255,255,.14); }
.fd-sb-item.active .fd-sb-icon { background: rgba(255,255,255,.22); }

/* NEU-Pill am rechten Ende (z. B. Brand Voices) */
.fd-sb-pill {
  margin-left: auto;
  background: #22c55e;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  border-radius: 10px;
  padding: 2px 7px;
  flex-shrink: 0;
  letter-spacing: 0.02em;
}

/* -------------------------------------------------------------
   5. TOPBAR / NAV
   ------------------------------------------------------------- */
.fd-ci-nav {
  height: var(--ci-nav-h);
  background: var(--ci-card);
  border-bottom: 1px solid var(--ci-border);
  box-shadow: 0 1px 3px rgba(15,20,25,.04);
  display: flex;
  align-items: center;
  padding: 0 20px 0 24px;
  gap: 14px;
  flex-shrink: 0;
  z-index: 200;
}
.fd-ci-nav-logo {
  height: 22px;
  width: auto;
  object-fit: contain;
  flex-shrink: 0;
}

.fd-nav-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--ci-app-bg);
  border: 1px solid var(--ci-border);
  border-radius: 9px;
  padding: 7px 12px;
  min-width: 180px;
  max-width: 280px;
  flex: 0 1 240px;
  transition: border-color .12s ease, background .12s ease;
}
.fd-nav-search:focus-within {
  border-color: var(--ci-accent);
  background: #fff;
  box-shadow: 0 0 0 3px var(--ci-accent-soft);
}
.fd-nav-search svg { flex-shrink: 0; color: var(--ci-t3); }
.fd-nav-search input {
  border: none;
  outline: none;
  background: transparent;
  font-family: inherit;
  font-size: 13px;
  color: var(--ci-t1);
  width: 100%;
  min-width: 0;
}

.fd-nav-spacer { flex: 1; }

.fd-nav-badge {
  background: var(--ci-accent-soft);
  border: 1px solid var(--ci-accent-strong);
  color: var(--ci-accent-hover);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 4px 10px;
  border-radius: 7px;
  white-space: nowrap;
  flex-shrink: 0;
  text-transform: uppercase;
}

.fd-nav-divider {
  width: 1px;
  height: 26px;
  background: var(--ci-border);
  flex-shrink: 0;
}

.fd-nav-profile {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px 9px;
  border-radius: 10px;
  cursor: pointer;
  transition: background .12s ease;
  flex-shrink: 0;
}
.fd-nav-profile:hover { background: var(--ci-app-bg); }
.fd-nav-uname { font-size: 12.5px; font-weight: 700; color: var(--ci-t1); line-height: 1.2; }
.fd-nav-urole { font-size: 10.5px; font-weight: 500; color: var(--ci-t3); }

.fd-nav-page-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ci-t1);
  white-space: nowrap;
  flex-shrink: 0;
}
.fd-nav-page-label .ico { font-size: 16px; }
.fd-nav-page-label .fd-nav-page-ico { display:inline-flex; align-items:center; justify-content:center; opacity:.75; color:var(--ci-accent); }
.fd-nav-page-label .fd-nav-page-ico svg { width:16px; height:16px; }

/* Notification Bell (injected by ci_layout.js) — area-adaptive */
#notif-bell-wrap {
  position: relative;
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--ci-accent-soft) !important;
  border: 1px solid var(--ci-accent-strong) !important;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background .15s ease, border-color .15s ease;
  color: var(--ci-accent);
}
#notif-bell-wrap:hover {
  background: var(--ci-accent-strong) !important;
}
#notif-bell-wrap svg {
  stroke: currentColor !important;
}
#notif-badge {
  display: none;
  position: absolute;
  top: 0;
  right: 0;
  background: #dc2626;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  border-radius: 50%;
  min-width: 14px;
  height: 14px;
  line-height: 14px;
  text-align: center;
  padding: 0 2px;
  pointer-events: none;
}

/* -------------------------------------------------------------
   6. RIGHT HELP PANEL
   ------------------------------------------------------------- */
.ci-help {
  width: var(--ci-help-w);
  min-width: var(--ci-help-w);
  height: 100%;
  flex-shrink: 0;
  background: var(--ci-card);
  border-left: 1px solid var(--ci-border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: -2px 0 10px rgba(15,20,25,.04);
}
.ci-help-inner { flex: 1; overflow-y: auto; }
.ci-help-inner::-webkit-scrollbar { width: 4px; }
.ci-help-inner::-webkit-scrollbar-thumb { background: #d1d6dc; border-radius: 3px; }

/* ── Language Switcher ─────────────────────────────────────────────────────── */
.fd-ci-lang-switch {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px;
  padding: 12px 10px 16px; margin-top: auto;
  border-top: 1px solid rgba(255,255,255,.07);
  flex-shrink: 0;
}
.fd-ci-lang-btn {
  display: flex; align-items: center; justify-content: center; gap: 4px;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.10);
  border-radius: 7px; padding: 5px 6px; cursor: pointer;
  font-size: 11px; font-weight: 600; color: rgba(255,255,255,.45);
  font-family: 'Inter', sans-serif; letter-spacing: .3px;
  transition: background .15s, color .15s, border-color .15s;
  line-height: 1;
}
.fd-ci-lang-btn:hover {
  background: rgba(255,255,255,.11); color: rgba(255,255,255,.8);
  border-color: rgba(255,255,255,.22);
}
.fd-ci-lang-btn.active {
  background: var(--ci-accent-soft); border-color: var(--ci-accent);
  color: var(--ci-accent); font-weight: 700;
}
.fd-ci-lang-flag { font-size: 14px; line-height: 1; }
.fd-ci-lang-label { font-size: 10px; }

/* Titlebar — area-adaptive bottom border */
.ci-help-hd {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 3px solid var(--ci-accent);
  background: linear-gradient(135deg, var(--ci-accent-soft) 0%, rgba(255,255,255,0) 100%);
  box-shadow: 0 2px 8px rgba(0,0,0,.04);
  position: sticky;
  top: 0;
  z-index: 1;
  flex-shrink: 0;
}
.ci-help-hd-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--ci-t1);
  margin: 0;
  letter-spacing: -.2px;
  flex: 1;
}
.ci-help-hd-sub {
  font-size: 10.5px;
  color: var(--ci-t3);
  margin: 0;
}
.ci-help-hd-icon {
  font-size: 20px;
  line-height: 1;
  color: var(--ci-accent);
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

/* Help panel body content */
.ci-help-body { padding: 14px 16px; }

.ci-h-sect { margin-bottom: 16px; }
.ci-h-sect-t {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1.2px;
  color: var(--ci-t2);
  text-transform: uppercase;
  margin: 0 0 8px;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 10px 0 4px;
}
.ci-h-item {
  font-size: 12px;
  color: var(--ci-t2);
  line-height: 1.6;
  margin-bottom: 6px;
  padding: 8px 10px;
  background: var(--ci-app-bg);
  border-radius: 8px;
  border-left: 3px solid var(--ci-border);
}
.ci-h-item strong {
  color: var(--ci-t1);
  display: block;
  margin-bottom: 2px;
  font-size: 12px;
}
.ci-h-tip {
  font-size: 12px;
  color: #065f46;
  line-height: 1.55;
  padding: 8px 10px;
  background: #f0fdf4;
  border-radius: 8px;
  border-left: 3px solid #10b981;
  margin-bottom: 6px;
}
.ci-h-warn {
  font-size: 12px;
  color: #92400e;
  line-height: 1.55;
  padding: 8px 10px;
  background: #fffbeb;
  border-radius: 8px;
  border-left: 3px solid #f59e0b;
  margin-bottom: 6px;
}
.ci-h-step {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  margin-bottom: 6px;
}
.ci-h-step-n {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--ci-accent-gradient);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}
.ci-h-step-t {
  font-size: 12px;
  color: var(--ci-t2);
  line-height: 1.55;
}

/* Onboarding inject slot inside ci-help-body */
.ci-ob-inject { margin-bottom: 16px; }