/* ============================================================
   EasySlide — X-Feed Instagram Slide Generator
   ============================================================ */

:root {
  --xf-blue: #1e8bf0;
  --xf-blue-deep: #0a63d8;
  --xf-blue-light: #4aa6ff;
  --ink: #0d1320;
  --paper: #f6f7f9;
  --border: #e4e7ec;
  --muted: #6b7280;

  --side-w: 380px;
  --slide-size: 1080px; /* logische Slide-Größe = Export-Größe */
}

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

html, body { height: 100%; }

body {
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  background: #eceef2;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

.app {
  display: grid;
  grid-template-columns: var(--side-w) 1fr;
  height: 100vh;
  overflow: hidden;
}

/* ===================== SIDEBAR ===================== */
.sidebar {
  background: #fff;
  border-right: 1px solid var(--border);
  padding: 22px 22px 28px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-logo {
  width: 46px; height: 46px;
  border-radius: 12px;
  box-shadow: 0 4px 14px rgba(30, 139, 240, .35);
}
.brand h1 { font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
.brand p { font-size: 12px; color: var(--muted); margin-top: 2px; }

.field { display: flex; flex-direction: column; gap: 7px; }
.field > label {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--muted);
}

textarea, input[type="text"] {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 13.5px;
  line-height: 1.4;
  color: var(--ink);
  resize: vertical;
  background: #fbfcfd;
  transition: border-color .15s, box-shadow .15s;
}
textarea:focus, input[type="text"]:focus {
  outline: none;
  border-color: var(--xf-blue);
  box-shadow: 0 0 0 3px rgba(30, 139, 240, .15);
  background: #fff;
}

/* Theme-Auswahl */
.theme-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.theme-chip {
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  transition: all .15s;
}
.theme-chip:hover { border-color: var(--xf-blue-light); }
.theme-chip.active {
  border-color: var(--xf-blue);
  box-shadow: 0 0 0 3px rgba(30, 139, 240, .14);
}
.theme-swatch {
  width: 26px; height: 26px; border-radius: 7px; flex: 0 0 auto;
  border: 1px solid rgba(0,0,0,.06);
}
.theme-chip span { font-size: 12.5px; font-weight: 600; }

/* Bild-Upload */
.image-drop {
  position: relative;
  border: 1.5px dashed var(--border);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 16 / 9;
  background: #fbfcfd;
}
.image-drop img { width: 100%; height: 100%; object-fit: cover; display: block; }
.image-drop-hint {
  position: absolute; inset: 0;
  display: flex; align-items: flex-end; justify-content: center;
  padding: 8px;
  background: linear-gradient(to top, rgba(0,0,0,.55), transparent 55%);
  opacity: 0; transition: opacity .15s;
}
.image-drop:hover .image-drop-hint, .image-drop.dragover .image-drop-hint { opacity: 1; }
.image-drop.dragover { border-color: var(--xf-blue); }
.image-drop-hint span { color: #fff; font-size: 12px; font-weight: 600; }

/* Buttons */
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 4px; }
.btn {
  border: none; border-radius: 10px; padding: 12px 14px;
  font-family: inherit; font-size: 13px; font-weight: 700;
  cursor: pointer; transition: transform .08s, box-shadow .15s, background .15s;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: linear-gradient(135deg, var(--xf-blue), var(--xf-blue-deep));
  color: #fff;
  box-shadow: 0 6px 16px rgba(30, 139, 240, .35);
}
.btn-primary:hover { box-shadow: 0 8px 22px rgba(30, 139, 240, .45); }
.btn-ghost { background: #eef1f5; color: var(--ink); }
.btn-ghost:hover { background: #e4e8ee; }
.hint-foot { font-size: 11px; color: var(--muted); text-align: center; }

/* ===================== STAGE ===================== */
.stage {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: radial-gradient(circle at 50% 0%, #f3f5f8, #e2e6ec);
}
.stage-toolbar {
  padding: 16px 24px;
  display: flex;
  justify-content: center;
}
.slide-tabs { display: flex; gap: 8px; background: #fff; padding: 6px; border-radius: 12px; box-shadow: 0 2px 10px rgba(0,0,0,.06); }
.slide-tab {
  width: 38px; height: 34px; border-radius: 8px;
  border: none; background: transparent; cursor: pointer;
  font-weight: 700; font-size: 13px; color: var(--muted);
  transition: all .15s;
}
.slide-tab:hover { background: #f1f3f6; color: var(--ink); }
.slide-tab.active { background: var(--xf-blue); color: #fff; }

.preview-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 24px 28px;
  overflow: hidden;
}
.slides {
  position: relative;
  width: var(--slide-size);
  height: var(--slide-size);
  transform-origin: center center;
  border-radius: 28px;
  box-shadow: 0 24px 70px rgba(15, 25, 45, .28);
}

/* ============================================================
   SLIDE GRUNDGERÜST (1080x1080)
   ============================================================ */
.slide {
  position: absolute; inset: 0;
  width: var(--slide-size); height: var(--slide-size);
  overflow: hidden;
  border-radius: 28px;
  display: none;
  font-family: "Inter", sans-serif;
  --accent: var(--xf-blue); /* wird je Kategorie überschrieben */
}
.slide.is-active { display: block; }

/* Bei Export brauchen wir keine runden Ecken (Instagram beschneidet eckig) */
.slide.exporting { border-radius: 0; }

/* gemeinsame Bausteine */
.s-topbar {
  position: absolute; top: 0; left: 0; right: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: 54px 60px 0;
  z-index: 5;
}
.s-brand { display: flex; align-items: center; gap: 16px; }
.s-logo { width: 64px; height: 64px; border-radius: 16px; }
.s-name { font-size: 30px; font-weight: 800; letter-spacing: -.02em; }
.s-kicker {
  font-size: 22px; font-weight: 800; letter-spacing: .14em;
  padding: 12px 22px; border-radius: 100px;
}
.s-foot {
  position: absolute; left: 60px; right: 60px; bottom: 54px;
  display: flex; align-items: center; justify-content: space-between;
  z-index: 5;
}
.s-handle { font-size: 24px; font-weight: 600; opacity: .85; }
.s-dots { display: flex; gap: 10px; }
.s-dots i { width: 13px; height: 13px; border-radius: 50%; background: currentColor; opacity: .3; }
.s-dots i.on { opacity: 1; width: 34px; border-radius: 7px; background: var(--accent); }

.s-num {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700; line-height: .9;
}

/* ============================================================
   THEME 1 — EDITORIAL (hell, Magazin, Serif)
   ============================================================ */
.theme-editorial { background: #ffffff; color: #14171f; }
.theme-editorial .s-kicker { background: #14171f; color: #fff; }
.theme-editorial .s-name { color: #14171f; }

.theme-editorial.slide--cover .cover-img {
  position: absolute; top: 0; left: 0; right: 0; height: 640px;
  object-fit: cover; width: 100%;
}
.theme-editorial.slide--cover .cover-panel {
  position: absolute; left: 0; right: 0; bottom: 0; height: 460px;
  background: #fff; padding: 70px 64px;
  display: flex; flex-direction: column; justify-content: center;
}
.theme-editorial.slide--cover .cover-rule { width: 90px; height: 7px; background: var(--accent); margin-bottom: 30px; }
.theme-editorial.slide--cover h2 {
  font-family: "Playfair Display", serif;
  font-size: 70px; font-weight: 800; line-height: 1.04; letter-spacing: -.01em;
}

.theme-editorial.slide--text { padding: 0; }
.theme-editorial.slide--text .txt-wrap {
  position: absolute; inset: 0;
  padding: 340px 70px 90px;
  display: flex; flex-direction: column; justify-content: flex-start;
}
.theme-editorial.slide--text .big-num {
  font-family: "Playfair Display", serif;
  font-size: 150px; color: var(--accent); line-height: .8; margin-bottom: 26px;
  font-weight: 800;
}
.theme-editorial.slide--text p {
  font-family: "Playfair Display", serif;
  font-size: 56px; line-height: 1.28; font-weight: 700; color: #14171f;
}
.theme-editorial.slide--text .thumb {
  position: absolute; top: 150px; right: 70px;
  width: 150px; height: 150px; border-radius: 18px; object-fit: cover;
  border: 6px solid #fff; box-shadow: 0 10px 30px rgba(0,0,0,.18);
}

/* ============================================================
   THEME 2 — BOLD (dunkel, kontrastreich, Blau-Akzent)
   ============================================================ */
.theme-bold { background: #0d1320; color: #fff; }
.theme-bold .s-kicker { background: var(--accent); color: #fff; }

.theme-bold .bg-img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover;
}
.theme-bold.slide--cover .scrim {
  position: absolute; inset: 0;
  background: linear-gradient(to top, #0d1320 8%, rgba(13,19,32,.2) 60%, rgba(13,19,32,.65) 100%);
}
.theme-bold.slide--cover h2 {
  position: absolute; left: 60px; right: 60px; bottom: 150px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 82px; font-weight: 700; line-height: 1.02; letter-spacing: -.02em;
}
.theme-bold.slide--cover .accent-bar { position: absolute; left: 60px; bottom: 350px; width: 110px; height: 9px; background: var(--accent); }

.theme-bold.slide--text .bg-img { filter: blur(26px) brightness(.4) saturate(1.1); transform: scale(1.15); }
.theme-bold.slide--text .scrim { position: absolute; inset: 0; background: linear-gradient(135deg, rgba(10,40,90,.55), rgba(13,19,32,.78)); }
.theme-bold.slide--text .txt-wrap {
  position: absolute; inset: 0; padding: 410px 64px 90px;
  display: flex; flex-direction: column; justify-content: flex-start;
}
.theme-bold.slide--text .big-num {
  font-size: 220px; color: rgba(74,166,255,.28);
  position: absolute; top: 130px; right: 50px;
}
.theme-bold.slide--text p {
  font-family: "Space Grotesk", sans-serif;
  font-size: 60px; line-height: 1.25; font-weight: 600;
}

/* ============================================================
   THEME 3 — MINIMAL (hell, viel Weißraum, clean)
   ============================================================ */
.theme-minimal { background: #f4f5f7; color: #11151c; }
.theme-minimal .s-kicker { background: transparent; color: var(--accent); border: 3px solid var(--accent); }
.theme-minimal .s-name { color: #11151c; }

.theme-minimal.slide--cover .frame {
  position: absolute; top: 180px; left: 70px; right: 70px; height: 560px;
  border-radius: 26px; overflow: hidden; box-shadow: 0 26px 60px rgba(0,0,0,.16);
}
.theme-minimal.slide--cover .frame img { width: 100%; height: 100%; object-fit: cover; }
.theme-minimal.slide--cover h2 {
  position: absolute; left: 70px; right: 70px; bottom: 105px;
  font-size: 62px; font-weight: 800; line-height: 1.08; letter-spacing: -.02em;
}

.theme-minimal.slide--text .txt-wrap {
  position: absolute; inset: 0; padding: 320px 80px 90px;
  display: flex; flex-direction: column; justify-content: flex-start;
}
.theme-minimal.slide--text .big-num {
  font-size: 120px; color: #11151c; line-height: 1; margin-bottom: 34px;
}
.theme-minimal.slide--text .big-num small { color: var(--accent); }
.theme-minimal.slide--text p { font-size: 58px; line-height: 1.3; font-weight: 600; color: #20262f; letter-spacing: -.01em; }
/* Strich wächst dynamisch mit dem Inhalt: nur so tief wie Nummer + Satz */
.theme-minimal.slide--text .txt-wrap.with-rule { padding-left: 80px; }
.theme-minimal.slide--text .rule-body { border-left: 6px solid var(--accent); padding-left: 44px; }

/* ============================================================
   THEME 4 — BRAND (X-Feed Blau-Verlauf, app-nah)
   ============================================================ */
.theme-brand { background: linear-gradient(155deg, #2e9bff 0%, #1e8bf0 45%, #0a63d8 100%); color: #fff; }
.theme-brand .s-kicker { background: rgba(255,255,255,.18); color: #fff; }

.theme-brand.slide--cover .frame {
  position: absolute; top: 170px; left: 62px; right: 62px; height: 590px;
  border-radius: 30px; overflow: hidden; box-shadow: 0 30px 60px rgba(0,40,90,.4);
  border: 8px solid rgba(255,255,255,.9);
}
.theme-brand.slide--cover .frame img { width: 100%; height: 100%; object-fit: cover; }
.theme-brand.slide--cover h2 {
  position: absolute; left: 62px; right: 62px; bottom: 100px;
  font-size: 66px; font-weight: 800; line-height: 1.06; letter-spacing: -.02em;
  text-shadow: 0 2px 14px rgba(0,30,70,.25);
}

.theme-brand.slide--text .watermark {
  position: absolute; right: -60px; bottom: -40px; width: 560px; opacity: .12;
}
.theme-brand.slide--text .txt-wrap {
  position: absolute; inset: 0; padding: 340px 70px 90px;
  display: flex; flex-direction: column; justify-content: flex-start;
}
.theme-brand.slide--text .big-num {
  font-size: 150px; color: rgba(255,255,255,.35); line-height: .85; margin-bottom: 20px;
}
.theme-brand.slide--text p { font-size: 62px; line-height: 1.24; font-weight: 700; }

/* ============================================================
   SLIDE 5 — CTA (gilt für alle Themes, themed)
   ============================================================ */
.slide--cta .cta-wrap {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 80px;
  gap: 0;
}
.slide--cta .cta-logo { width: 200px; height: 200px; border-radius: 48px; box-shadow: 0 24px 60px rgba(0,0,0,.3); }
.slide--cta .cta-title { font-size: 60px; font-weight: 800; margin-top: 64px; max-width: 840px; line-height: 1.18; letter-spacing: -.025em; }
.slide--cta .cta-kicker { font-size: 26px; font-weight: 700; margin-top: 118px; text-transform: uppercase; letter-spacing: .26em; color: var(--accent); }
.slide--cta .stores { display: flex; gap: 30px; margin-top: 56px; }
.slide--cta .store-img { height: 112px; width: auto; display: block; }

/* CTA Theming (offizielle Badges, themeübergreifend identisch) */
.theme-editorial.slide--cta { background: #fff; color: #14171f; }
.theme-minimal.slide--cta  { background: #f4f5f7; color: #11151c; }
.theme-bold.slide--cta { background: radial-gradient(circle at 50% 35%, #15233d, #0d1320 70%); color: #fff; }
.theme-brand.slide--cta { color: #fff; }
.theme-brand.slide--cta .cta-kicker { color: rgba(255,255,255,.9); }

.store-ico svg { width: 100%; height: 100%; display: block; }

/* Off-screen Render-Container für den Export */
#exportHolder { position: fixed; left: -99999px; top: 0; width: 1080px; height: 1080px; pointer-events: none; }

/* ============================================================
   LOGIN
   ============================================================ */
.login-screen {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 50% 30%, #1c2740, #0c1018 70%);
  padding: 24px;
}
.login-card {
  width: 100%; max-width: 380px; background: #fff; border-radius: 24px;
  padding: 44px 38px; text-align: center;
  box-shadow: 0 30px 80px rgba(0,0,0,.45);
  display: flex; flex-direction: column; gap: 14px;
}
.login-logo { width: 84px; height: 84px; border-radius: 22px; margin: 0 auto 6px; }
.login-card h1 { font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.login-sub { color: var(--muted); font-size: 15px; margin-top: -6px; }
.login-card input {
  width: 100%; padding: 15px 18px; font-size: 16px; text-align: center;
  border: 2px solid var(--border); border-radius: 14px; outline: none;
  transition: border-color .15s;
}
.login-card input:focus { border-color: var(--xf-blue); }
.login-card .btn { width: 100%; padding: 15px; font-size: 16px; }
.login-msg { font-size: 14px; min-height: 18px; color: var(--muted); }
.login-msg.error { color: #e23b3b; font-weight: 600; }

/* ============================================================
   HUB
   ============================================================ */
.hub { max-width: 1100px; margin: 0 auto; padding: 28px 24px 60px; }
.hub-head {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 16px; margin-bottom: 22px;
}
.hub-brand { display: flex; align-items: center; gap: 14px; }
.hub-brand img { width: 56px; height: 56px; border-radius: 14px; }
.hub-brand h1 { font-size: 24px; font-weight: 800; letter-spacing: -.02em; }
.hub-brand p { font-size: 14px; color: var(--muted); }
.hub-head-actions { display: flex; gap: 10px; }

.hub-tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.hub-tab {
  border: none; background: #fff; cursor: pointer;
  padding: 11px 18px; border-radius: 12px; font-weight: 700; font-size: 15px;
  color: var(--muted); display: flex; align-items: center; gap: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,.05);
}
.hub-tab.active { background: var(--ink); color: #fff; }
.hub-tab .cnt {
  font-size: 12px; background: rgba(0,0,0,.1); color: inherit;
  padding: 1px 8px; border-radius: 100px; font-weight: 800;
}
.hub-tab.active .cnt { background: rgba(255,255,255,.22); }

.cat-filter { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.cat-chip {
  --accent: #888;
  border: 2px solid var(--border); background: #fff; cursor: pointer;
  padding: 7px 14px; border-radius: 100px; font-weight: 600; font-size: 13px;
  color: var(--muted); display: flex; align-items: center; gap: 7px;
  opacity: .5; transition: all .15s;
}
.cat-chip .dot { width: 11px; height: 11px; border-radius: 50%; background: var(--accent); }
.cat-chip.active { opacity: 1; color: var(--ink); border-color: var(--accent); }

.hub-list {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}
.hub-loading, .hub-empty { color: var(--muted); padding: 30px 4px; font-size: 15px; }

.news-card {
  --accent: #888;
  background: #fff; border-radius: 18px; overflow: hidden;
  box-shadow: 0 4px 16px rgba(0,0,0,.06);
  border-left: 5px solid var(--accent);
  display: flex; flex-direction: column;
}
.news-thumb { height: 150px; background: #e9edf2; overflow: hidden; }
.news-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.news-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.news-meta { display: flex; align-items: center; justify-content: space-between; }
.cat-badge {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 13px; font-weight: 700; color: var(--accent);
}
.cat-badge .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.rating-pill {
  font-size: 13px; font-weight: 800; color: var(--ink);
  background: #f1f3f6; padding: 3px 11px; border-radius: 100px;
}
.news-title { font-size: 17px; font-weight: 700; line-height: 1.3; flex: 1; }
.news-actions { display: flex; align-items: center; gap: 10px; margin-top: 2px; }
.news-actions .btn { padding: 10px 16px; font-size: 14px; }
.reject-note { font-size: 12px; color: var(--muted); }

/* Editor: Zurück-zum-Hub-Link + Kategorie-Auswahl */
.back-hub {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 600; color: var(--muted);
  text-decoration: none; margin-bottom: 10px;
}
.back-hub:hover { color: var(--xf-blue); }
.cat-select {
  display: flex; flex-wrap: wrap; gap: 7px;
}
.cat-select .cat-chip { opacity: .55; }
.cat-select .cat-chip.active { opacity: 1; }

/* Fertig / Mülleimer im Editor */
.finish-actions { display: flex; gap: 10px; margin-top: 18px; }
.btn-done {
  flex: 1; background: #1faf5a; color: #fff; border: none;
  font-weight: 700;
}
.btn-done:hover { background: #1a9c50; }
.btn-trash {
  width: 52px; flex: 0 0 auto; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: #fff; color: #e23b3b; border: 2px solid #f0d2d2;
}
.btn-trash:hover { background: #fdecec; border-color: #e23b3b; }
#exportHolder .slide { position: relative; }

