/* Websites (AnalyseDESK) - Suchzahlen aus der Google Search Console.
   Optisch an der Promptomizer-Uebersicht orientiert, aber eine eigene Datei:
   jene bleibt unveraendert, und keine Aenderung hier soll sie beruehren.
   Farben, Karten, Tabellen und Schrift kommen aus main.css. */

:root {
  /* Zwei Reihen, eine Farbe in zwei Helligkeitsstufen (wie beim Promptomizer).
     Die Klicks sind die Zielgroesse und tragen die auffaelligere Stufe. */
  --ws-klicks: #7fd6e4;
  --ws-impressionen: #0e97ad;
  --ws-flaeche: rgba(176, 207, 229, 0.055);
  --ws-raster: rgba(176, 207, 229, 0.09);
}

[data-theme="light"] {
  --ws-klicks: #0a7d94;
  --ws-impressionen: #5bbfd2;
  --ws-flaeche: rgba(14, 97, 150, 0.055);
  --ws-raster: rgba(14, 97, 150, 0.09);
}

/* --- Auswahl oben ------------------------------------------------------ */

.ws-auswahl {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: -8px;
}

.ws-schalter {
  display: inline-flex;
  padding: 3px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(176, 207, 229, 0.04);
}

.ws-schalter:empty {
  display: none;
}

.ws-schalter button {
  border: 0;
  background: transparent;
  color: var(--text-muted);
  border-radius: 999px;
  padding: 6px 15px;
  font-size: 12.5px;
  font-weight: 500;
  transition: background 0.2s ease, color 0.2s ease;
}

.ws-schalter button:hover {
  color: var(--text);
}

.ws-schalter button[aria-pressed="true"] {
  background: var(--bg-3);
  color: var(--text);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.ws-schalter--gross button {
  padding: 8px 20px;
  font-size: 14px;
}

/* --- Kopfband ---------------------------------------------------------- */

.ws-kopf {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.ws-kopfband {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.ws-zahl {
  background: var(--bg-2);
  padding: 20px 22px;
}

.ws-zahl--ziel {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.14), rgba(14, 151, 173, 0.06));
  box-shadow: inset 0 0 0 1px rgba(14, 165, 233, 0.35);
}

[data-theme="light"] .ws-zahl--ziel {
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.1), rgba(14, 151, 173, 0.04));
  box-shadow: inset 0 0 0 1px rgba(2, 132, 199, 0.3);
}

.ws-zahl-wert {
  font-size: 40px;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
}

.ws-zahl--ziel .ws-zahl-wert {
  color: var(--accent-2);
}

.ws-zahl-name {
  margin-top: 8px;
  color: var(--text-muted);
  font-size: 13.5px;
}

.ws-zahl--ziel .ws-zahl-name {
  color: var(--text);
  font-weight: 600;
}

.ws-zahl-diff {
  margin-top: 10px;
  font-size: 12.5px;
  color: var(--text-muted);
}

.ws-besser {
  color: var(--success);
  font-weight: 700;
}

.ws-gleich,
.ws-schlechter {
  color: var(--text);
  font-weight: 700;
}

.ws-zeile-klein {
  margin-top: 18px;
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.5;
}

.ws-fahne {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.ws-fahne--gut {
  background: rgba(34, 197, 94, 0.12);
  color: var(--success);
}

.ws-fahne--warnung {
  background: var(--warning-bg);
  color: var(--warning);
}

/* --- Tagesbalken ------------------------------------------------------- */

.ws-diagramm-kopf {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.ws-steuerung {
  display: flex;
  gap: 22px;
  margin-top: 22px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.ws-legende {
  display: flex;
  gap: 22px;
  align-items: center;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--text-muted);
}

.ws-legende span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.ws-legende span.is-aus {
  opacity: 0.35;
}

.ws-legende-punkt {
  width: 11px;
  height: 11px;
  border-radius: 3px;
}

.ws-plotzeile {
  display: flex;
  gap: 12px;
  margin-top: 18px;
}

.ws-achse {
  flex: none;
  width: 34px;
  height: 240px;
  position: relative;
  font-size: 11px;
  color: var(--text-muted);
  text-align: right;
}

.ws-achse span {
  position: absolute;
  right: 0;
}

.ws-plot {
  flex: 1 1 auto;
  min-width: 0;
}

.ws-balkenfeld {
  position: relative;
  height: 240px;
  border-bottom: 1px solid var(--border);
  background-image: linear-gradient(var(--ws-raster) 1px, transparent 1px);
  background-size: 100% 120px;
}

.ws-spalten {
  position: absolute;
  inset: 0;
  display: flex;
  gap: 3px;
  align-items: stretch;
}

.ws-spalte {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  flex: 1 1 0;
  min-width: 0;
  border-radius: 3px;
}

.ws-spalte--wochenende {
  background: var(--ws-flaeche);
}

.ws-paar {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 2px;
  height: 100%;
}

.ws-balken {
  border-radius: 4px 4px 0 0;
  width: 46%;
  max-width: 15px;
  transition: height 0.18s ease;
}

.ws-spalten--einzeln .ws-balken {
  width: 72%;
  max-width: 26px;
}

.ws-balken--klicks {
  background: var(--ws-klicks);
}

.ws-balken--impressionen {
  background: var(--ws-impressionen);
}

/* Ein Tag mit null hat stattgefunden - er bekommt eine Spur auf der Grundlinie. */
.ws-balken--null {
  height: 2px;
  border-radius: 0;
  opacity: 0.45;
}

/* Ein Tag ohne Abruf ist keine Null. Er bekommt eine Luecke. */
.ws-luecke {
  width: 78%;
  max-width: 26px;
  height: 100%;
  border-radius: 4px;
  border: 1px dashed rgba(176, 207, 229, 0.28);
  background: repeating-linear-gradient(135deg, rgba(176, 207, 229, 0.07) 0 5px, transparent 5px 10px);
}

[data-theme="light"] .ws-luecke {
  border-color: rgba(14, 97, 150, 0.3);
  background: repeating-linear-gradient(135deg, rgba(14, 97, 150, 0.07) 0 5px, transparent 5px 10px);
}

/* Vorlaeufig heisst schraffiert: der Wert steht da, aber Google korrigiert noch. */
.ws-balken--vorlaeufig.ws-balken--klicks {
  background: repeating-linear-gradient(135deg, var(--ws-klicks) 0 5px,
    color-mix(in srgb, var(--ws-klicks) 45%, transparent) 5px 10px);
}

.ws-balken--vorlaeufig.ws-balken--impressionen {
  background: repeating-linear-gradient(135deg, var(--ws-impressionen) 0 5px,
    color-mix(in srgb, var(--ws-impressionen) 45%, transparent) 5px 10px);
}

.ws-tipp {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translate(-50%, 4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.14s ease, transform 0.14s ease;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  white-space: nowrap;
  z-index: 5;
  box-shadow: var(--shadow);
  font-size: 12px;
  line-height: 1.5;
}

.ws-spalte:hover .ws-tipp {
  opacity: 1;
  transform: translate(-50%, 0);
}

.ws-spalte:first-child .ws-tipp,
.ws-spalte:nth-child(2) .ws-tipp {
  left: 0;
  transform: translate(0, 4px);
}

.ws-spalte:first-child:hover .ws-tipp,
.ws-spalte:nth-child(2):hover .ws-tipp {
  transform: translate(0, 0);
}

.ws-spalte:last-child .ws-tipp,
.ws-spalte:nth-last-child(2) .ws-tipp {
  left: auto;
  right: 0;
  transform: translate(0, 4px);
}

.ws-spalte:last-child:hover .ws-tipp,
.ws-spalte:nth-last-child(2):hover .ws-tipp {
  transform: translate(0, 0);
}

.ws-xachse {
  display: flex;
  gap: 3px;
  margin-top: 8px;
}

.ws-xachse div {
  flex: 1 1 0;
  min-width: 0;
  text-align: center;
  font-size: 10.5px;
  color: var(--text-muted);
  white-space: nowrap;
}

/* --- Verlauf je Woche / Monat ------------------------------------------ */

.ws-verlauf {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.ws-verlaufsfeld {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  background: color-mix(in srgb, var(--bg-2) 50%, transparent);
}

.ws-verlaufsfeld--ziel {
  border-color: rgba(14, 165, 233, 0.28);
  background: rgba(14, 165, 233, 0.05);
}

.ws-verlaufswert {
  margin-top: 6px;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
}

.ws-verlaufsbalken {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 72px;
  margin-top: 18px;
}

.ws-verlaufsbalken div {
  flex: 1;
  background: var(--ws-impressionen);
  border-radius: 4px 4px 0 0;
  opacity: 0.45;
}

.ws-verlaufsfeld--ziel .ws-verlaufsbalken div {
  background: var(--ws-klicks);
}

.ws-verlaufsbalken div:last-child {
  opacity: 1;
}

.ws-verlaufsbalken div.is-null {
  height: 2px !important;
  border-radius: 0;
}

.ws-verlaufsachse {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}

.ws-verlaufsachse span {
  flex: 1;
  text-align: center;
  font-size: 10.5px;
  color: var(--text-muted);
  white-space: nowrap;
}

/* --- Tabellen ---------------------------------------------------------- */

.ws-zwei {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.ws-tabelle td.num,
.ws-tabelle th.num {
  text-align: right;
  white-space: nowrap;
}

/* Getrennt wird nur, was nicht passt - lange Pfade am Bindestrich, nicht mitten im Wort. */
.ws-tabelle td.ws-name {
  overflow-wrap: break-word;
  hyphens: auto;
}

.ws-tabelle td.ws-stark {
  font-weight: 700;
  font-size: 15px;
}

.ws-tabelle tr.ws-leer td {
  color: var(--text-muted);
}

/* --- Geraete und Laender: waagrechte Balken ---------------------------- */

.ws-liste {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.ws-listenzeile {
  display: grid;
  grid-template-columns: minmax(90px, 30%) 1fr auto;
  gap: 12px;
  align-items: center;
  font-size: 13.5px;
}

.ws-listenspur {
  height: 10px;
  border-radius: 999px;
  background: var(--ws-flaeche);
  overflow: hidden;
}

.ws-listenspur div {
  height: 100%;
  border-radius: 999px;
  background: var(--ws-impressionen);
}

.ws-listenzahl {
  color: var(--text-muted);
  font-size: 12.5px;
  white-space: nowrap;
}

.ws-listenzahl strong {
  color: var(--text);
}

@media (max-width: 900px) {
  .ws-zwei {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .ws-kopfband,
  .ws-verlauf {
    grid-template-columns: 1fr;
  }

  .ws-steuerung {
    align-items: flex-start;
  }

  .ws-tabelle th,
  .ws-tabelle td {
    padding-left: 8px;
    padding-right: 8px;
    font-size: 13px;
  }

  .ws-tabelle td.ws-stark {
    font-size: 13px;
  }

  .ws-listenzeile {
    grid-template-columns: minmax(80px, 34%) 1fr;
  }

  .ws-listenzahl {
    grid-column: 1 / -1;
    margin-top: -6px;
  }
}
