/**
 * Styles für die Betreiber-Übersichtsseite (/betreiber)
 * Pfad: pages/operator/assets/operator-list.css
 * Eingebunden von: pages/operator/list.php (via page_asset_v)
 */

.ca {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  position: relative;
}

.kw {
  font-size: 0.825rem;
}

.flex-container {
  flex-direction: column;
}

.flex-container img,
.flex-container .svg {
  max-width: 160px;
  width: 100%;
  height: auto;
  margin: auto;
}

.group {
  border: 2px solid #e2e4e9;
  transform: scale(1);
  transition: all 250ms ease-in-out;
}

.group:is(:hover, :focus) {
  border-color: #2eb873;
  transform: scale(1.05);
  box-shadow: 0 0 20px #2eb87366;
}

.font-normal {
  font-weight: 500;
}

.kwh {
  border: 1px solid #eee;
}

.headl {
  text-align: center;
}

@media screen and (min-width: 786px) {
  .flex-container img,
  .flex-container .svg {
    width: auto;
    min-width: 130px;
    max-height: 130px;
    max-width: 130px;
  }
}

/* Filter-Chip Styles */
.filter-chip {
  background-color: #f3f4f6;
  color: #4b5563;
  border: 1px solid #e5e7eb;
  cursor: pointer;
  white-space: nowrap;
}

.filter-chip:hover {
  background-color: #e5e7eb;
  color: #1f2937;
}

.filter-chip.active {
  background-color: #059669;
  color: white;
  border-color: #059669;
  box-shadow: 0 0 0 2px rgba(5, 150, 105, 0.2);
}

.filter-chip.active:hover {
  background-color: #047857;
}

.operator-card.filter-hidden {
  display: none !important;
}

.operator-card {
  display: flex;
  flex-direction: column;
}

.operator-card .transition-colors {
  margin-top: auto;
}

/* Lade-Overlay für das Markt-Trend-Chart */
.chart-loading-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.7);
  color: #4b5563;
  font-size: 0.875rem;
  z-index: 5;
  border-radius: 0.5rem;
}

.chart-loading-overlay.hidden {
  display: none;
}

/* ── Markt-Trend ─────────────────────────────────────────────────────── */

/* Weicher Fade beim Länder-Wechsel (Zeitraum-Wechsel animiert Chart.js selbst) */
.trend-chart-wrap {
  transition: opacity 0.3s ease;
}

.trend-chart-wrap.trend-fading {
  opacity: 0.35;
}

/* Landesname neben der Überschrift */
.trend-country-label {
  color: #059669;
  font-weight: 700;
}

/* Zeitraum-Umschalter (7T / 30T / 90T / 1J) als Pill-Gruppe */
.trend-range-switch {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background-color: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 9999px;
  padding: 4px;
  align-self: flex-start;
  flex-shrink: 0;
}

.trend-range-btn {
  border: none;
  background: transparent;
  color: #4b5563;
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 9999px;
  cursor: pointer;
  transition: background-color 0.25s ease, color 0.25s ease,
    box-shadow 0.25s ease;
}

.trend-range-btn:hover {
  color: #111827;
  background-color: #e5e7eb;
}

.trend-range-btn.active {
  background-color: #059669;
  color: #ffffff;
  box-shadow: 0 1px 3px rgba(5, 150, 105, 0.4);
}

.trend-range-btn.active:hover {
  background-color: #047857;
}

/* ── Betreiber-Suche ──────────────────────────────────────────────────── */
.op-search {
  position: relative;
  display: flex;
  align-items: center;
  max-width: 460px;
}

/* Kompakte Variante in der Kopfzeile der Betreiber-Liste (neben Sortierung) */
.op-search--inline {
  width: 260px;
  max-width: 100%;
}

/* Einheitliche Höhe für Suche, Auswertungs-Filter und Sortierung in der
   Kopfzeile der Liste – sonst stehen die drei Pills unterschiedlich hoch */
.op-search--inline .op-search__input,
.op-stats-toggle,
.op-sort-select {
  min-height: 36px;
}

.op-search--inline .op-search__input {
  padding-top: 7px;
  padding-bottom: 7px;
  font-size: 0.875rem;
}

@media (max-width: 640px) {
  .op-search--inline {
    width: 100%;
  }
}

.op-search__icon {
  position: absolute;
  left: 14px;
  width: 18px;
  height: 18px;
  color: #9ca3af;
  pointer-events: none;
}

.op-search__input {
  width: 100%;
  padding: 10px 40px 10px 42px;
  border: 1px solid #e5e7eb;
  border-radius: 9999px;
  background-color: #ffffff;
  font-size: 0.9375rem;
  color: #111827;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.op-search__input::placeholder {
  color: #9ca3af;
}

.op-search__input:focus {
  outline: none;
  border-color: #2eb873;
  box-shadow: 0 0 0 3px rgba(46, 184, 115, 0.18);
}

/* Native Clear-Buttons von type="search" ausblenden – wir haben einen eigenen */
.op-search__input::-webkit-search-cancel-button,
.op-search__input::-webkit-search-decoration {
  -webkit-appearance: none;
  appearance: none;
}

.op-search__clear {
  position: absolute;
  right: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 9999px;
  background-color: #f3f4f6;
  color: #6b7280;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.op-search__clear:hover {
  background-color: #e5e7eb;
  color: #111827;
}

/* ── Filter „nur mit Auswertung" ──────────────────────────────────────── */
.op-stats-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border: 1px solid #e5e7eb;
  border-radius: 9999px;
  background-color: #ffffff;
  color: #4b5563;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease,
    border-color 0.2s ease, box-shadow 0.2s ease;
}

.op-stats-toggle:hover {
  border-color: #d1d5db;
  background-color: #f9fafb;
  color: #111827;
}

.op-stats-toggle.active {
  background-color: #059669;
  border-color: #059669;
  color: #ffffff;
  box-shadow: 0 1px 3px rgba(5, 150, 105, 0.4);
}

.op-stats-toggle.active:hover {
  background-color: #047857;
  border-color: #047857;
  color: #ffffff;
}

/* ── Sortier-Auswahl (optisch angeglichen an Suche & Auswertungs-Filter) ─ */
.op-sort-select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  padding: 7px 34px 7px 14px;
  border: 1px solid #e5e7eb;
  border-radius: 9999px;
  background-color: #ffffff;
  /* Chevron als Inline-SVG (lokal, kein externes Asset) */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236b7280' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 14px 14px;
  color: #4b5563;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.25;
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease,
    color 0.2s ease, box-shadow 0.2s ease;
}

.op-sort-select:hover {
  border-color: #d1d5db;
  background-color: #f9fafb;
  color: #111827;
}

.op-sort-select:focus {
  outline: none;
  border-color: #2eb873;
  box-shadow: 0 0 0 3px rgba(46, 184, 115, 0.18);
}

/* ── Badge „Auswertung vorhanden" auf der Betreiber-Karte ─────────────── */
.op-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

/* Icon-Größe hier setzen: die Tailwind-Utilities w-3.5/h-3.5 sind im lokalen
   Build nicht enthalten (Utilities werden nur bei Verwendung generiert) */
.op-stats-badge svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

.op-stats-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border: 1px solid #a7f3d0;
  border-radius: 9999px;
  background-color: #ecfdf5;
  color: #047857;
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}
