/* ============================================================
   VINEA — Sentiment Radar · Stylesheet
   Palette: Burgunder #7b1e3b / #a4133c · Gold #d4af37 · Nacht #0d0609 / #1a0f14
   ============================================================ */

:root {
  --bg-0: #0d0609;
  --bg-1: #1a0f14;
  --wine: #7b1e3b;
  --wine-bright: #a4133c;
  --gold: #d4af37;
  --gold-dim: rgba(212, 175, 55, 0.55);
  --ink: #efe6e8;
  --muted: #8a7a80;
  --pos: #7fb069;
  --neu: #8a7a80;
  --neg: #c94b5e;
  --card-border: rgba(212, 175, 55, 0.15);
  --card-bg: rgba(26, 15, 20, 0.55);
  --font-display: "Fraunces", "Playfair Display", Georgia, serif;
  --font-ui: "Inter", "Space Grotesk", system-ui, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-ui);
  background: var(--bg-0);
  color: var(--ink);
  min-height: 100vh;
  overflow-x: hidden;
  background-image:
    radial-gradient(ellipse 80% 50% at 70% -10%, rgba(123, 30, 59, 0.35), transparent 60%),
    radial-gradient(ellipse 60% 40% at 10% 30%, rgba(164, 19, 60, 0.14), transparent 65%),
    radial-gradient(ellipse 50% 35% at 85% 75%, rgba(212, 175, 55, 0.06), transparent 60%),
    linear-gradient(180deg, var(--bg-0) 0%, var(--bg-1) 100%);
  background-attachment: fixed;
}

/* Schwebende Licht-Orbs (Wein-Textur-Imitation) */
.bg-orbs { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.5;
  animation: drift 26s ease-in-out infinite alternate;
}
.orb-1 { width: 42vw; height: 42vw; top: -14vw; right: -10vw; background: radial-gradient(circle, rgba(164, 19, 60, 0.35), transparent 70%); }
.orb-2 { width: 30vw; height: 30vw; bottom: 6vh; left: -12vw; background: radial-gradient(circle, rgba(123, 30, 59, 0.4), transparent 70%); animation-delay: -9s; }
.orb-3 { width: 22vw; height: 22vw; top: 44vh; right: 6vw; background: radial-gradient(circle, rgba(212, 175, 55, 0.10), transparent 70%); animation-delay: -17s; }

@keyframes drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(3vw, 4vh, 0) scale(1.08); }
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem clamp(1rem, 4vw, 3rem);
  background: rgba(13, 6, 9, 0.72);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--card-border);
}

.brand { display: flex; align-items: center; gap: 0.7rem; }
.brand-mark { width: 34px; height: 34px; flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: 0.14em;
  background: linear-gradient(100deg, var(--gold) 10%, #f3dfa0 45%, var(--gold) 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.brand-sub {
  font-size: 0.62rem;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--muted);
}

.header-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  color: var(--muted);
  white-space: nowrap;
}
.live-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--pos);
  box-shadow: 0 0 10px var(--pos);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: 0.35; } }

/* ---------- Layout ---------- */
.container {
  position: relative;
  z-index: 1;
  max-width: 1440px;
  margin: 0 auto;
  padding: clamp(1rem, 3vw, 2.5rem) clamp(1rem, 4vw, 3rem) 4rem;
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
}

.grid-2 { display: grid; gap: 1.4rem; }
.grid-7-5 { grid-template-columns: 7fr 5fr; }
.grid-6-6 { grid-template-columns: 1fr 1fr; }
.grid-5-7 { grid-template-columns: 5fr 7fr; }
@media (max-width: 1024px) {
  .grid-7-5, .grid-6-6, .grid-5-7 { grid-template-columns: 1fr; }
}

/* ---------- Hero ---------- */
.hero { padding: clamp(1.5rem, 4vw, 3.5rem) 0 0.5rem; max-width: 880px; }
.eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.38em;
  text-transform: uppercase;
  color: var(--gold-dim);
  margin-bottom: 1rem;
}
.hero h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.2rem, 5.2vw, 4rem);
  line-height: 1.06;
  letter-spacing: -0.01em;
}
.hero h1 em {
  font-style: italic;
  background: linear-gradient(95deg, var(--wine-bright), #e0567e 55%, var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.lede { margin-top: 1rem; color: var(--muted); font-size: 1.02rem; max-width: 56ch; font-weight: 300; }

/* ---------- Karten ---------- */
.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 18px;
  padding: 1.4rem 1.5rem;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition: border-color 0.35s ease, box-shadow 0.35s ease, transform 0.35s ease;
}
.card:hover {
  border-color: rgba(212, 175, 55, 0.38);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.45), 0 0 34px rgba(164, 19, 60, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.card-hero {
  border-color: rgba(212, 175, 55, 0.28);
  background:
    radial-gradient(ellipse 60% 80% at 50% 110%, rgba(123, 30, 59, 0.28), transparent 70%),
    var(--card-bg);
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.6rem;
}
.card h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.45rem;
  letter-spacing: 0.01em;
}
.card-sub { color: var(--muted); font-size: 0.82rem; margin-top: 0.25rem; font-weight: 300; }

.legend-inline {
  display: flex;
  gap: 1.1rem;
  font-size: 0.75rem;
  color: var(--muted);
  padding-top: 0.5rem;
}
.legend-inline .dot {
  display: inline-block;
  width: 9px; height: 9px;
  border-radius: 50%;
  margin-right: 0.4rem;
  vertical-align: baseline;
}

/* ---------- KPIs ---------- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1.4rem;
}
@media (max-width: 1024px) { .kpi-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px)  { .kpi-grid { grid-template-columns: 1fr; } }

.kpi-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  min-height: 132px;
  padding: 1.1rem;
}
.kpi-value {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 3vw, 2.6rem);
  font-weight: 600;
  color: var(--gold);
  line-height: 1.1;
}
.kpi-topic { font-size: clamp(1.05rem, 1.6vw, 1.35rem); line-height: 1.25; }
.kpi-label {
  margin-top: 0.45rem;
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}
.kpi-gauge { padding: 0.4rem 0.6rem 0.2rem; }
.kpi-gauge .kpi-label { margin-top: -0.6rem; }

/* ---------- Charts ---------- */
.chart { width: 100%; }
.chart-gauge { height: 118px; }
.chart-radar { height: 560px; }
.chart-timeline { height: 360px; }
.chart-heatmap { height: 420px; }
.chart-donut { height: 420px; }
.chart-regions { height: 420px; }
.chart-wordcloud { height: 420px; }
.chart-sources { height: 560px; }
@media (max-width: 640px) {
  .chart-radar { height: 420px; }
  .chart-timeline { height: 300px; }
}

/* ---------- Feed ---------- */
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.4rem 0 1rem;
}
.chip {
  font-family: var(--font-ui);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--muted);
  background: rgba(212, 175, 55, 0.06);
  border: 1px solid var(--card-border);
  border-radius: 999px;
  padding: 0.32rem 0.85rem;
  cursor: pointer;
  transition: all 0.25s ease;
}
.chip:hover { color: var(--ink); border-color: rgba(212, 175, 55, 0.45); }
.chip.active {
  color: #1a0f14;
  background: linear-gradient(120deg, var(--gold), #c39a2e);
  border-color: transparent;
  font-weight: 600;
}

.feed {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  max-height: 520px;
  overflow-y: auto;
  padding-right: 0.4rem;
}

.feed-item {
  display: block;
  text-decoration: none;
  color: inherit;
  border: 1px solid rgba(212, 175, 55, 0.09);
  border-radius: 12px;
  padding: 0.75rem 0.9rem;
  background: rgba(13, 6, 9, 0.35);
  transition: border-color 0.25s ease, background 0.25s ease, transform 0.25s ease;
}
.feed-item:hover {
  border-color: rgba(212, 175, 55, 0.4);
  background: rgba(123, 30, 59, 0.18);
  transform: translateX(4px);
}
.feed-title {
  font-size: 0.88rem;
  font-weight: 500;
  line-height: 1.35;
  margin-bottom: 0.45rem;
}
.feed-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.7rem;
  color: var(--muted);
}
.badge {
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  border-radius: 999px;
  padding: 0.12rem 0.6rem;
}
.badge-pos { color: var(--pos); background: rgba(127, 176, 105, 0.12); border: 1px solid rgba(127, 176, 105, 0.35); }
.badge-neu { color: var(--neu); background: rgba(138, 122, 128, 0.12); border: 1px solid rgba(138, 122, 128, 0.35); }
.badge-neg { color: var(--neg); background: rgba(201, 75, 94, 0.12); border: 1px solid rgba(201, 75, 94, 0.35); }
.feed-topic {
  color: var(--gold-dim);
  border: 1px solid rgba(212, 175, 55, 0.22);
  border-radius: 999px;
  padding: 0.12rem 0.6rem;
}
.feed-empty { color: var(--muted); font-size: 0.85rem; padding: 1rem 0.4rem; }

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--wine), var(--wine-bright));
  border-radius: 8px;
  border: 2px solid var(--bg-0);
}
::-webkit-scrollbar-thumb:hover { background: var(--gold-dim); }

/* ---------- Footer ---------- */
.site-footer {
  margin-top: 1.5rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--card-border);
  color: var(--muted);
  font-size: 0.76rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.footer-cmd code {
  font-family: "SF Mono", Menlo, monospace;
  color: var(--gold-dim);
  background: rgba(212, 175, 55, 0.07);
  padding: 0.1rem 0.45rem;
  border-radius: 6px;
}

/* ---------- Entrance-Animationen ---------- */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1), transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal.visible { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .orb { animation: none; }
}

/* ---------- Rollen-Switch (Header) ---------- */
.role-switch {
  display: flex;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  border: 1px solid var(--card-border);
  background: rgba(13, 6, 9, 0.55);
}
.role-btn {
  font-family: var(--font-ui);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  background: transparent;
  border: none;
  border-radius: 999px;
  padding: 0.34rem 0.95rem;
  cursor: pointer;
  transition: all 0.25s ease;
  white-space: nowrap;
}
.role-btn:hover { color: var(--ink); }
.role-btn.active {
  color: #1a0f14;
  background: linear-gradient(120deg, var(--gold), #c39a2e);
  font-weight: 600;
  box-shadow: 0 2px 12px rgba(212, 175, 55, 0.35);
}
@media (max-width: 720px) {
  .site-header { flex-wrap: wrap; justify-content: center; }
  .role-switch { order: 3; width: 100%; justify-content: center; }
  .role-btn { flex: 1; }
}

/* ---------- Frühwarn-Signale ---------- */
.signals-panel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
}
.signals-panel[hidden] { display: none; }
.signal-card {
  border-radius: 14px;
  border: 1px solid var(--card-border);
  background: var(--card-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 0.95rem 1.1rem;
  border-left-width: 3px;
  transition: border-color 0.3s ease, transform 0.3s ease;
}
.signal-card:hover { transform: translateY(-2px); }
.signal-warn { border-left-color: var(--wine-bright); background: linear-gradient(120deg, rgba(164, 19, 60, 0.14), var(--card-bg) 55%); }
.signal-pos { border-left-color: var(--gold); background: linear-gradient(120deg, rgba(212, 175, 55, 0.12), var(--card-bg) 55%); }
.signal-info { border-left-color: var(--neu); }
.signal-type {
  font-size: 0.62rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--muted);
}
.signal-warn .signal-type { color: #e0567e; }
.signal-pos .signal-type { color: var(--gold); }
.signal-title {
  font-family: var(--font-display);
  font-size: 1.02rem;
  font-weight: 600;
  margin: 0.3rem 0 0.35rem;
}
.signal-detail { font-size: 0.78rem; color: var(--muted); line-height: 1.5; font-weight: 300; }

/* ---------- Produzenten-Segmente ---------- */
.segment-panel[hidden] { display: none; }
.segment-head { margin-bottom: 0.9rem; }
.segment-head h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.45rem;
}
.segment-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.4rem;
}
@media (max-width: 900px) { .segment-grid { grid-template-columns: 1fr; } }
.segment-card {
  border-radius: 18px;
  border: 1px solid var(--card-border);
  background: var(--card-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 1.2rem 1.3rem;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition: border-color 0.35s ease, box-shadow 0.35s ease;
}
.segment-card:hover {
  border-color: rgba(212, 175, 55, 0.38);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.45), 0 0 34px rgba(164, 19, 60, 0.14);
}
.segment-name {
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.7rem;
}
.segment-row {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.segment-count {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 600;
  color: var(--gold);
  line-height: 1;
}
.segment-count-label { font-size: 0.75rem; color: var(--muted); }
.segment-bar {
  margin-top: 0.9rem;
  height: 6px;
  border-radius: 999px;
  background: rgba(138, 122, 128, 0.16);
  overflow: hidden;
}
.segment-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}
.segment-empty { color: var(--muted); font-size: 0.85rem; }

/* ---------- Neue Charts ---------- */
.chart-matrix { height: 420px; }
.chart-grapes { height: 420px; }
.chart-markets { height: 420px; }

/* ---------- Ereignis-Legende ---------- */
.events-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.7rem;
  padding-top: 0.8rem;
  border-top: 1px solid rgba(212, 175, 55, 0.08);
}
.events-title {
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  margin-right: 0.3rem;
}
.event-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.7rem;
  color: var(--muted);
  border: 1px solid rgba(212, 175, 55, 0.14);
  border-radius: 999px;
  padding: 0.22rem 0.7rem;
  background: rgba(212, 175, 55, 0.04);
}
.event-chip.in-range { color: var(--ink); border-color: rgba(212, 175, 55, 0.4); }
.event-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--gold);
  flex: none;
}
.event-chip:not(.in-range) .event-dot { background: var(--neu); opacity: 0.6; }

/* ---------- CSV-Export-Button ---------- */
.csv-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--font-ui);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--gold-dim);
  background: rgba(212, 175, 55, 0.06);
  border: 1px solid rgba(212, 175, 55, 0.28);
  border-radius: 999px;
  padding: 0.4rem 0.95rem;
  cursor: pointer;
  transition: all 0.25s ease;
}
.csv-btn:hover {
  color: #1a0f14;
  background: linear-gradient(120deg, var(--gold), #c39a2e);
  border-color: transparent;
}

/* ---------- Feed-Meta: Märkte ---------- */
.feed-market {
  color: var(--muted);
  border: 1px solid rgba(138, 122, 128, 0.3);
  border-radius: 999px;
  padding: 0.12rem 0.6rem;
}

/* ---------- Methodik ---------- */
.methodik-link {
  font-family: var(--font-ui);
  font-size: 0.76rem;
  color: var(--gold-dim);
  background: none;
  border: none;
  border-bottom: 1px dashed rgba(212, 175, 55, 0.45);
  padding: 0 0 1px;
  cursor: pointer;
  transition: color 0.25s ease;
}
.methodik-link:hover { color: var(--gold); }

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.2rem;
  background: rgba(13, 6, 9, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.modal-overlay[hidden] { display: none; }
.modal-card {
  width: min(640px, 100%);
  max-height: 84vh;
  overflow-y: auto;
  border-radius: 18px;
  border: 1px solid rgba(212, 175, 55, 0.3);
  background: #1a0f14;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6), 0 0 40px rgba(164, 19, 60, 0.18);
  padding: 1.6rem 1.8rem;
}
.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.8rem;
}
.modal-head h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.5rem;
}
.modal-close {
  font-size: 1.4rem;
  line-height: 1;
  color: var(--muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  transition: color 0.2s ease;
}
.modal-close:hover { color: var(--gold); }
.modal-body h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--gold);
  margin: 1.1rem 0 0.35rem;
}
.modal-body p {
  font-size: 0.84rem;
  color: var(--muted);
  line-height: 1.6;
  font-weight: 300;
}
