/** ChallengeFlow: 10-extras.css */
@layer components {
  /* Weitere Komponenten */
  .divider {
    height: 1px;
    background: var(--line);
    margin: 6px 0;
  }
  .country-challenges {
    display: grid;
    gap: 12px;
  }
  .country-feed-empty {
    display: grid;
    gap: 10px;
    justify-items: start;
  }
  .country-feed-empty p {
    margin: 0;
  }
  .no-results {
    padding: 14px;
    text-align: center;
    border: 1px dashed var(--line-strong);
    border-radius: 0;
  }
  .collapsible .section-toggle-row {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
  }
  .collapsible.collapsed .section-body {
    display: none;
  }
  .section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
  }
  .section-head h2 {
    margin: 0;
  }
  .discover-intro h1 {
    font-size: 32px;
    line-height: 1.03;
  }
  .ui-icon {
    width: 18px;
    height: 18px;
    display: block;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
  }
  .card {
    margin-bottom: 20px;
  }
  .feed-country-panel {
    border-top: 1px solid var(--line);
    display: grid;
    gap: 8px;
    margin-top: 18px;
    padding-top: 18px;
    border-color: rgba(0,0,0,.08);
  }
  .feed-multi-combobox {
    display: grid;
    min-width: 0;
    gap: 8px;
  }
  .feed-selected-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }
  .location-line {
    margin: 2px 0 8px;
    font-size: 12.5px;
    color: #767676;
    font-weight: 550;
  }
  /* Der Entdecken-Kopf besitzt bewusst eine eigene, von generischen .row-
     Regeln unabhängige Struktur. Titel, Status und beide Bedienelemente
     bleiben dadurch in Updates und Challenges exakt gleich breit/zentriert. */
  .discover-intro {
    width: 100%;
    max-width: 100%;
    margin-inline: auto;
  }
  .discover-intro.compact-panel {
    padding-top: 26px;
    padding-bottom: 26px;
  }
  .discover-intro-stack {
    width: 100%;
    display: grid;
    justify-items: center;
    gap: 16px;
  }
  .discover-intro-copy {
    width: 100%;
    min-width: 0;
    text-align: center;
  }
  .discover-intro .muted {
    margin: 6px 0 0;
    text-align: center;
  }
  .discover-intro-actions {
    width: min(100%,560px);
    margin-inline: auto;
    display: flex;
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }
  .discover-intro-actions > .segmented-control,
  .discover-intro-actions > .discover-settings-toggle {
    width: 100%;
  }
  .discover-intro-actions .segmented-control {
    justify-content: space-between;
  }
  .discover-intro-actions .segment-button {
    flex: 1 1 0;
    min-width: 0;
  }
  .discover-settings-toggle {
    position: relative;
    min-height: 38px;
    white-space: nowrap;
  }
  .discover-settings-toggle.is-active {
    border-color: var(--line-strong);
    background: var(--soft);
  }
  .discover-settings-panel {
    display: grid;
    grid-template-rows: 0fr;
    opacity: 0;
    transform: translateY(-7px);
    transition: grid-template-rows .34s cubic-bezier(.2,.8,.2,1), opacity .2s ease, transform .3s cubic-bezier(.2,.8,.2,1);
  }
  .discover-settings-panel.is-open {
    grid-template-rows: 1fr;
    opacity: 1;
    transform: none;
  }
  .discover-settings-inner {
    min-height: 0;
  }
  .discover-scope-setting,
  .discover-layout-setting {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-top: 18px;
    border-top: 1px solid rgba(0,0,0,.08);
  }
  .discover-layout-setting {
    margin-top: 16px;
  }
  .discover-scope-control {
    flex: 0 1 auto;
  }
  .discover-settings-label {
    color: #767676;
    font-size: 10.5px;
    font-weight: 650;
    letter-spacing: .055em;
    text-transform: uppercase;
  }
  .discover-layout-setting .discover-view-switcher {
    flex: 0 1 auto;
  }
  .discover-settings-panel .feed-country-panel {
    margin-top: 16px;
  }
  .country-feed-empty-note {
    color: var(--muted);
    font-size: 13px;
  }

  /* Desktop: Entdecken als kompakte, klar gegliederte Steuerzentrale statt
     mehrerer breit auseinandergezogener Einzelzeilen. Mobile bleibt über
     30-responsive.css bewusst beim vertikalen Stack. */
  .discover-view-label {
    display: none;
  }
  @media (min-width: 901px) {
    .discover-intro.compact-panel {
      padding: 28px 32px 24px;
    }
    .discover-intro-stack {
      grid-template-columns: minmax(0,1fr) minmax(440px,520px);
      align-items: center;
      justify-items: stretch;
      gap: 32px;
    }
    .discover-intro-copy,
    .discover-intro .muted {
      text-align: left;
    }
    .discover-intro h1 {
      margin: 0;
      font-size: clamp(30px,2.4vw,38px);
      line-height: 1.02;
      letter-spacing: -.025em;
    }
    .discover-intro .muted {
      max-width: 620px;
      margin-top: 8px;
      line-height: 1.4;
    }
    .discover-intro-actions {
      width: 100%;
      margin: 0;
      display: grid;
      grid-template-columns: minmax(0,1fr) 164px;
      align-items: stretch;
      gap: 10px;
    }
    .discover-intro-actions > .segmented-control,
    .discover-intro-actions > .discover-settings-toggle {
      width: 100%;
      min-height: 44px;
    }
    .discover-settings-toggle {
      justify-content: center;
      border-radius: 12px;
    }
    .discover-settings-panel.is-open {
      margin-top: 22px;
    }
    .discover-settings-inner {
      display: grid;
      grid-template-columns: minmax(0,1fr) max-content;
      gap: 18px 22px;
      align-items: start;
      justify-content: space-between;
      padding-top: 0;
      border-top: 1px solid transparent;
    }
    .discover-settings-panel.is-open .discover-settings-inner {
      padding-top: 22px;
      border-top-color: var(--line);
    }
    .discover-scope-setting,
    .discover-layout-setting {
      display: grid;
      grid-template-columns: auto max-content;
      align-items: center;
      align-content: start;
      justify-content: start;
      gap: 14px;
      min-width: 0;
      width: fit-content;
      margin: 0;
      padding: 0;
      border: 0;
    }
    .discover-layout-setting {
      margin-top: 0;
      justify-self: end;
    }
    .discover-settings-label {
      min-width: 58px;
    }
    .discover-scope-control,
    .discover-layout-setting .discover-view-switcher {
      width: fit-content;
      max-width: 100%;
      min-width: 0;
    }
    .discover-scope-control .segment-button,
    .discover-view-button {
      flex: 0 0 auto;
      min-width: 0;
    }
    .discover-view-button {
      min-height: 42px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      padding-inline: 14px;
      white-space: nowrap;
    }
    .discover-view-button svg {
      width: 17px;
      height: 17px;
      flex: 0 0 auto;
    }
    .discover-view-label {
      display: inline;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      font-size: 12px;
      font-weight: 650;
    }
    .discover-settings-panel .feed-country-panel {
      grid-column: 1 / -1;
      margin-top: 0;
      padding-top: 18px;
      border-top: 1px solid var(--line);
    }
    .discover-settings-panel .feed-filter-grid {
      grid-template-columns: minmax(0,1fr) minmax(0,1fr) 132px;
      gap: 14px;
    }
    .discover-settings-panel .feed-autocomplete input,
    .discover-settings-panel .feed-filter-reset {
      min-height: 44px;
      border-radius: 12px;
    }
    .discover-settings-panel .feed-filter-reset {
      width: 100%;
      justify-content: center;
    }
  }
  @keyframes apple-surface-in {from{opacity:0;transform:translateY(7px)}to{opacity:1;transform:none}}
}

/* Buttons bleiben in Hell- und Dunkelmodus bewusst flach. */
button { box-shadow: none; }

@layer components {
  .discover-filter-status-dot {
    position: absolute;
    top: 6px;
    right: 7px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--vote-up);
    box-shadow: 0 0 0 2px var(--card), 0 0 10px color-mix(in srgb,var(--vote-up) 72%,transparent);
    pointer-events: none;
    animation: challengeflow-filter-dot-pulse 2.6s ease-in-out infinite;
  }
  @keyframes challengeflow-filter-dot-pulse {
    0%,100% { opacity: .78; filter: brightness(.92); transform: scale(.98); }
    50% { opacity: 1; filter: brightness(1.16); transform: scale(1.02); }
  }
  @media (prefers-reduced-motion: reduce) {
    .discover-filter-status-dot { animation: none; }
  }
}
