/* ============================================================
   EMMI – ChatGPT-inspiriertes UI
   ============================================================ */

/* ------------------------------------------------------------
   Theme Basis-Variablen
------------------------------------------------------------ */

:root {
  --accent: #6e86ff;
  --accent-soft: rgba(110, 134, 255, 0.16);

  --bg: #f5f5f5;
  --bg-secondary: #ffffff;
  --bg-tertiary: #ececec;
  --card-bg: #ffffff;

  --border: #dadada;
  --border-light: #cfcfcf;

  --text: #1f1f1f;
  --text-muted: #6a6a6a;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 22px;

  --shadow-soft: 0 6px 18px rgba(0, 0, 0, 0.25);
  --shadow-medium: 0 12px 28px rgba(0, 0, 0, 0.35);
}

/* ------------------------------------------------------------
   Global Styles
------------------------------------------------------------ */

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  transition: background 0.25s ease, color 0.25s ease;
}

.app-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

button {
  font-family: inherit;
}

.top-nav {
  position: sticky;
  top: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

.top-nav-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.app-icon {
  border: none;
  background: transparent;
  padding: 6px;
  cursor: pointer;
}

.top-nav-title {
  font-weight: 700;
  font-size: 1.1rem;
}

.main-menu {
  display: flex;
  gap: 8px;
  margin-left: 12px;
}

.main-menu-btn {
  border: 1px solid var(--border);
  background: var(--bg-tertiary);
  color: var(--text);
  padding: 6px 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.main-menu-btn.active {
  background: var(--accent-soft);
  border-color: var(--accent);
}

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

.burger {
  border: 1px solid var(--border);
  background: var(--bg-tertiary);
  padding: 6px 10px;
  border-radius: var(--radius-md);
  cursor: pointer;
}

.section-tabs {
  position: sticky;
  top: 58px;
  z-index: 1000;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 6px 16px;
  display: flex;
  gap: 8px;
}

.section-tab-btn {
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  padding: 8px 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
}

.section-tab-btn.active {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.mobile-menu {
  position: fixed;
  top: 58px;
  right: 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 1500;
}

.mobile-menu-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mobile-menu-title {
  font-weight: 700;
  color: var(--text-muted);
}

.mobile-menu-item {
  border: 1px solid var(--border-light);
  background: var(--bg-tertiary);
  padding: 8px 10px;
  border-radius: var(--radius-md);
  text-align: left;
  cursor: pointer;
}

.inspiration-table tbody tr:nth-child(even) {
  background: var(--bg-tertiary);
}

.inspiration-table th,
.inspiration-table td {
  font-size: 0.82rem;
  line-height: 1.2;
}

.desktop-only {
  display: flex;
}

.mobile-only {
  display: none;
}

/* ------------------------------------------------------------
   SVG – Grabstein mit Animation
------------------------------------------------------------ */

.tombstone-svg {
  width: 32px;
  height: 32px;
  display: block;
}

/* gemeinsame Linie-Effekte */
.tombstone-lines .line {
  transition: transform 0.25s ease, opacity 0.2s ease;
  transform-origin: 4px 2px;
  transform-box: fill-box;
}

/* BURGER (geschlossen) */
.tombstone-svg.closed .line1,
.tombstone-svg.closed .line3 {
  transform: rotate(0deg);
}
.tombstone-svg.closed .line2 {
  opacity: 1;
}

/* X (geöffnet) */
.tombstone-svg.open .line1 {
  transform: rotate(45deg);
}
.tombstone-svg.open .line3 {
  transform: rotate(-45deg);
}
.tombstone-svg.open .line2 {
  opacity: 0;
}

/* ------------------------------------------------------------
   CONTENT
------------------------------------------------------------ */

.content {
  flex: 1 1 auto;
  padding: 22px;
  display: flex;
  flex-direction: column;
}

.content-inner {
  width: 100%;
}

/* TOP BAR */
.top-bar {
  display: flex;
  justify-content: space-between;
  margin-bottom: 16px;
}

.top-bar-right {
  display: flex;
  gap: 10px;
}

.theme-toggle,
.filter-toggle {
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  color: var(--text);
  padding: 6px 12px;
  font-size: 0.85rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 0.2s;
}

.theme-toggle:hover,
.filter-toggle:hover {
  background: var(--bg-tertiary);
}

/* ------------------------------------------------------------
   FILTERPANEL
------------------------------------------------------------ */

.filter-panel {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  padding: 14px;
  border-radius: var(--radius-lg);
  margin-bottom: 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
}

.filter-input {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-light);
  padding: 7px 10px;
  color: var(--text);
  border-radius: var(--radius-md);
}

.filter-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 160px;
}

.filter-inline {
  flex: 1 1 170px;
}

.date-range-field {
  position: relative;
}

.date-range-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border-light);
  background: var(--bg-tertiary);
  cursor: pointer;
  min-width: 220px;
}

.date-range-popover {
  position: absolute;
  top: 105%;
  left: 0;
  z-index: 4000;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  padding: 12px;
  min-width: 420px;
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 12px;
}

.date-quick {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.date-quick button {
  border: 1px solid var(--border-light);
  background: var(--bg-tertiary);
  padding: 8px 10px;
  border-radius: var(--radius-md);
  cursor: pointer;
  text-align: left;
}

.date-quick button:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.date-inputs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.date-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
}

/* ------------------------------------------------------------
   STATUS
------------------------------------------------------------ */

.status-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.status-card {
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #f0f0f3, #e4e4e8);
  padding: 10px 12px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 6px 12px rgba(0, 0, 0, 0.08);
  position: relative;
}

.status-card-label {
  font-size: 0.9rem;
  color: #4a4a4a;
  margin-bottom: 4px;
}

.status-card-value {
  font-size: 1.2rem;
  font-weight: 700;
  color: #1f1f1f;
}

.status-card-sub-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.status-card-sub-row .pill {
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.06);
  color: #2b2b2b;
  font-weight: 600;
  font-size: 0.66rem;
}

.status-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: #ff3b30;
  color: #fff;
  font-weight: 700;
  font-size: 0.78rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.6);
}

/* ------------------------------------------------------------
   LISTE + NEWSLETTER CARDS
------------------------------------------------------------ */

.list-wrapper {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  padding: 14px;
  border-radius: var(--radius-lg);
}

.news-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  border: none;
  border-radius: 999px;
  background: #2f343d;
  color: #f5f7fb;
  font-weight: 600;
  font-size: 0.78rem;
}

.tag.secondary {
  background: #3b404a;
  color: #eef1f6;
  border: none;
}

.newsletter-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-secondary);
  padding: 12px;
  box-shadow: var(--shadow-soft);
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.newsletter-card-panel {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.news-list > * {
  min-width: 0;
}

.thumb-wrap {
  position: relative;
}

.thumb-img {
  transition: transform 0.2s ease-out;
}

.brand-link {
  background: none;
  border: none;
  color: var(--accent);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  padding: 0;
  margin-top: 6px;
  text-decoration: underline;
}

.brand-link:hover {
  text-decoration: none;
  opacity: 0.85;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  width: 100%;
  justify-content: space-between;
}

.brand-row-left {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.brand-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-wrap: nowrap;
}

.brand-add,
.brand-action {
  opacity: 0;
  transform: translateX(-2px);
  transition: opacity 0.15s ease, transform 0.15s ease;
  border: 1px solid var(--border-light);
  background: var(--bg-tertiary);
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.brand-row:hover .brand-add,
.brand-row-left:hover .brand-add,
.brand-row:focus-within .brand-add,
.brand-row:hover .brand-action,
.brand-row-left:hover .brand-action,
.brand-row:focus-within .brand-action,
.brand-link:hover + .brand-actions .brand-action,
.brand-actions:hover .brand-action {
  opacity: 1;
  transform: translateX(0);
}

@media (hover: none) {
  .brand-add,
  .brand-action {
    opacity: 1;
    transform: translateX(0);
  }
}

.btn-delete-toggle {
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  border-radius: 999px;
}

.btn-delete-toggle.is-deleted {
  background: var(--danger, #c00);
  color: #ffffff;
}

@media (min-width: 960px) {
  .news-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }
}

@media (max-width: 768px) {
  .brand-row-left {
    flex-wrap: nowrap;
    gap: 4px;
  }

  .brand-actions {
    gap: 3px;
  }

  .brand-action,
  .brand-add {
    padding: 4px;
  }
}


/* ------------------------------------------------------------
   MODAL PREVIEW
------------------------------------------------------------ */

.preview-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  z-index: 20000;
}

.preview-box {
  width: 90vw;
  max-width: 1200px;
  max-height: 90vh;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-medium);
  position: relative;
}

.brand-modal {
  max-width: 900px;
}

.brand-modal-content {
  padding: 16px 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.brand-stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin: 12px 0 16px;
}

.brand-stat-card {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 12px;
}

.brand-stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.brand-stat-value {
  font-weight: 700;
  font-size: 1.05rem;
}

.brand-stat-compare {
  margin-top: 4px;
  font-size: 0.7rem;
  color: var(--text-muted);
}

.brand-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.brand-meta-item {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: #fff;
}

.brand-meta-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.brand-meta-value {
  font-weight: 600;
}

.info-icon-btn {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 0.9rem;
  line-height: 1;
  padding: 2px;
}

.scroll-top-btn {
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  font-size: 1.1rem;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3000;
}

.scroll-top-btn:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.preview-close {
  position: absolute;
  top: 8px;
  right: 12px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-light);
  padding: 4px 8px;
  border-radius: var(--radius-md);
  cursor: pointer;
}

/* ------------------------------------------------------------
   MOBILE FIX – Sidebar sichtbar
------------------------------------------------------------ */

@media (max-width: 768px) {
  .desktop-only {
    display: none;
  }

  .mobile-only {
    display: inline-flex;
  }

  .section-tabs {
    top: 54px;
    padding: 6px 12px;
    overflow-x: auto;
  }

  .content {
    padding: 14px;
  }

  .status-row {
    grid-template-columns: repeat(2, 1fr);
  }
}
