/* ──────────────────────────────────────────────────────────────────────────
   /saved-filters — distinctive, self-contained restyle.
   All rules are scoped under .sf-page so nothing here leaks into other pages.
   Subject: agilitystævner.dk — saved searches, calendar feeds, mail alerts for
   Danish dog-agility competitions. Bold berry hero + coral heart favourites +
   pill toggle switches as the signature.
   ────────────────────────────────────────────────────────────────────────── */

.sf-page {
  --sf-ink:        #1c1430;
  --sf-berry:      #6d4aa0;
  --sf-berry-deep: #4a2f78;
  --sf-violet:     #a87fe0;
  /* Brand fills sit behind white text and stay dark in BOTH colour schemes. */
  --sf-brand:      #6d4aa0;
  --sf-brand-deep: #4a2f78;
  --sf-coral:      #ff5a6e;
  --sf-coral-soft: #ffe3e7;
  --sf-paper:      #f5f1fb;
  --sf-surface:    #ffffff;
  --sf-surface-2:  #faf8fe;
  --sf-line:       #e7def5;
  --sf-muted:      #6f6485;

  --sf-display: "Space Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  background: var(--sf-paper);
  color: var(--sf-ink);
  min-height: calc(100vh - 61px);
}

@media (prefers-color-scheme: dark) {
  .sf-page {
    --sf-ink:        #ece7f6;
    --sf-berry:      #b89be6;
    --sf-berry-deep: #2a1c45;
    --sf-violet:     #c9b1f0;
    --sf-coral:      #ff7d8d;
    --sf-coral-soft: #3a2230;
    --sf-paper:      #160f24;
    --sf-surface:    #20182f;
    --sf-surface-2:  #261d38;
    --sf-line:       #382a52;
    --sf-muted:      #a99fc0;
  }
}

/* ── Hero band — matches the front-page hero gradient for brand continuity ── */
.sf-hero {
  background: linear-gradient(135deg, var(--berry-lt) 0%, var(--blue-lt) 100%);
  color: var(--sf-ink);
  padding: 2.6rem 1rem 2.9rem;
}
.sf-hero-inner { max-width: 760px; margin: 0 auto; }
.sf-eyebrow {
  font-family: var(--sf-display);
  font-weight: 600;
  font-size: .72rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--sf-berry);
  display: inline-flex;
  align-items: center;
  gap: .5rem;
}
.sf-eyebrow::before {
  content: "🐾";
  font-size: .85rem;
}
.sf-title {
  font-family: var(--sf-display);
  font-weight: 700;
  font-size: clamp(2rem, 6vw, 3rem);
  line-height: 1.02;
  letter-spacing: -.02em;
  margin: .5rem 0 .55rem;
}
.sf-lead {
  max-width: 46ch;
  color: var(--sf-muted);
  line-height: 1.5;
  font-size: 1.02rem;
}

/* ── Body column ────────────────────────────────────────────────────────── */
.sf-body { max-width: 760px; margin: 0 auto; padding: 1.6rem 1rem 4rem; }

.sf-page .saved-filters-empty,
.sf-page #saved-filters-login-required { color: var(--sf-muted); line-height: 1.5; }
.sf-page #saved-filters-login-required {
  background: var(--sf-surface);
  border: 1.5px solid var(--sf-line);
  border-radius: 16px;
  padding: 1.1rem 1.25rem;
}

.sf-limit {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  font-family: var(--sf-display);
  font-weight: 600;
  font-size: .78rem;
  letter-spacing: .02em;
  color: var(--sf-berry);
  background: var(--sf-surface);
  border: 1.5px solid var(--sf-line);
  border-radius: 999px;
  padding: .3rem .8rem;
  margin-bottom: 1.1rem;
}
.sf-limit::before { content: "📌"; }

/* ── Section label ──────────────────────────────────────────────────────── */
.sf-section-label {
  font-family: var(--sf-display);
  font-weight: 600;
  font-size: .74rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--sf-muted);
  margin: 2.2rem 0 .85rem;
  display: flex;
  align-items: center;
  gap: .6rem;
}
.sf-section-label::after {
  content: "";
  flex: 1;
  height: 1.5px;
  background: var(--sf-line);
}

/* ── Generic card ───────────────────────────────────────────────────────── */
.sf-card {
  position: relative;
  background: var(--sf-surface);
  border: 1.5px solid var(--sf-line);
  border-radius: 18px;
  padding: 1.15rem 1.25rem 1.2rem;
  box-shadow: 0 6px 22px rgba(74, 47, 120, .07);
}

/* New-filter card */
.sf-new-card { margin-bottom: 1rem; }
.sf-new-card h2 {
  font-family: var(--sf-display);
  font-weight: 700;
  font-size: 1.12rem;
  margin-bottom: .3rem;
}
.sf-new-summary { font-size: .85rem; color: var(--sf-muted); margin-bottom: .85rem; line-height: 1.45; }
.sf-new-form { display: flex; gap: .55rem; flex-wrap: wrap; }
.sf-new-form input[type=text] {
  flex: 1 1 220px;
  min-width: 0;
  padding: .6rem .85rem;
  font-size: .95rem;
  color: var(--sf-ink);
  background: var(--sf-surface-2);
  border: 1.5px solid var(--sf-line);
  border-radius: 11px;
}
.sf-new-form input[type=text]:focus {
  outline: none;
  border-color: var(--sf-berry);
  box-shadow: 0 0 0 3px rgba(109, 74, 160, .18);
}
.sf-btn-primary {
  font-family: var(--sf-display);
  font-weight: 600;
  font-size: .95rem;
  color: #fff;
  background: linear-gradient(135deg, var(--sf-brand-deep), var(--sf-brand));
  border: none;
  border-radius: 11px;
  padding: .6rem 1.2rem;
  cursor: pointer;
  transition: transform .08s ease, box-shadow .2s ease;
}
.sf-btn-primary:hover { box-shadow: 0 6px 16px rgba(74, 47, 120, .3); }
.sf-btn-primary:active { transform: translateY(1px); }

/* ── Saved-filter list ──────────────────────────────────────────────────── */
.sf-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1rem; }

.sf-item {
  position: relative;
  background: var(--sf-surface);
  border: 1.5px solid var(--sf-line);
  border-radius: 18px;
  padding: 1.1rem 1.25rem 0;
  /* No overflow:hidden here — it would clip the subscribe dropdown menu (.cal-menu)
     when it opens downward. The two elements that needed the card's rounded clipping
     (the accent rail and the full-bleed notify strip) round their own corners below. */
  box-shadow: 0 6px 22px rgba(74, 47, 120, .07);
  transition: border-color .2s ease, box-shadow .2s ease;
}
/* Left accent rail — rounds its left corners to follow the card's rounded edge
   (inner radius = 18px card radius − 1.5px border). */
.sf-item::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 5px;
  background: linear-gradient(var(--sf-berry), var(--sf-violet));
  border-radius: 16.5px 0 0 16.5px;
}
.sf-item:hover { border-color: var(--sf-violet); box-shadow: 0 10px 28px rgba(74, 47, 120, .13); }

.sf-item-name {
  font-family: var(--sf-display);
  font-weight: 700;
  font-size: 1.22rem;
  line-height: 1.15;
  word-break: break-word;
  margin-bottom: .55rem;
}

/* Criteria pills */
.sf-pills { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: .9rem; }
.sf-pill {
  font-size: .76rem;
  font-weight: 600;
  color: var(--sf-berry);
  background: var(--sf-surface-2);
  border: 1.5px solid var(--sf-line);
  border-radius: 999px;
  padding: .2rem .65rem;
  white-space: nowrap;
}
.sf-pill.sf-pill-fav { color: var(--sf-coral); border-color: var(--sf-coral); background: var(--sf-coral-soft); }

/* Action buttons — quiet ghost buttons */
.sf-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; padding-bottom: 1.05rem; }
.sf-page .saved-filter-btn {
  font-size: .82rem;
  font-weight: 600;
  color: var(--sf-berry);
  background: transparent;
  border: 1.5px solid var(--sf-line);
  border-radius: 9px;
  padding: .34rem .7rem;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.sf-page .saved-filter-btn:hover { background: var(--sf-surface-2); border-color: var(--sf-violet); }
.sf-page .saved-filter-btn.danger { color: var(--sf-coral); }
.sf-page .saved-filter-btn.danger:hover { background: var(--sf-coral-soft); border-color: var(--sf-coral); }

/* Subscribe-to-calendar dropdown (reuses .cal-dropdown/.btn-cal/.cal-menu from styles.css) */
.sf-page .btn-cal {
  font-size: .82rem;
  font-weight: 600;
  color: #fff;
  background: var(--sf-brand);
  border: 1.5px solid var(--sf-brand);
  border-radius: 9px;
  padding: .34rem .7rem;
  cursor: pointer;
}
.sf-page .btn-cal:hover { background: var(--sf-brand-deep); border-color: var(--sf-brand-deep); }
.sf-page .cal-dropdown { position: relative; }

/* ── Notify strip (per filter, weekly) ──────────────────────────────────── */
.sf-notify-strip {
  display: flex;
  align-items: center;
  gap: .85rem;
  margin: 0 -1.25rem;
  padding: .8rem 1.25rem;
  background: var(--sf-surface-2);
  border-top: 1.5px solid var(--sf-line);
  /* Round the bottom corners to match the card — the parent no longer clips
     (inner radius = 18px card radius − 1.5px border). */
  border-radius: 0 0 16.5px 16.5px;
}
.sf-notify-strip .sf-notify-icon { font-size: 1.1rem; line-height: 1; }
.sf-notify-text { flex: 1; min-width: 0; }
.sf-notify-title { font-weight: 600; font-size: .9rem; }
.sf-notify-sub { font-size: .78rem; color: var(--sf-muted); margin-top: .1rem; line-height: 1.35; }

/* ── Favourites notification panel ──────────────────────────────────────── */
.sf-fav-card {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  border-color: var(--sf-coral);
  background:
    linear-gradient(135deg, var(--sf-coral-soft) 0%, var(--sf-surface) 60%);
}
.sf-fav-icon {
  flex: none;
  width: 44px; height: 44px;
  display: grid; place-items: center;
  font-size: 1.4rem;
  background: var(--sf-surface);
  border: 1.5px solid var(--sf-coral);
  border-radius: 13px;
  box-shadow: 0 4px 12px rgba(255, 90, 110, .2);
}
.sf-fav-body { flex: 1; min-width: 0; }
.sf-fav-title {
  font-family: var(--sf-display);
  font-weight: 700;
  font-size: 1.08rem;
  margin-bottom: .2rem;
}
.sf-fav-help { font-size: .85rem; color: var(--sf-muted); line-height: 1.5; }

/* ── Pill toggle switch (the signature interaction element) ──────────────── */
.sf-switch { position: relative; flex: none; display: inline-block; cursor: pointer; }
.sf-switch input {
  position: absolute;
  opacity: 0;
  width: 100%; height: 100%;
  margin: 0; cursor: pointer;
}
.sf-switch-track {
  display: block;
  width: 46px; height: 27px;
  background: var(--sf-line);
  border-radius: 999px;
  transition: background .2s ease;
}
.sf-switch-thumb {
  position: absolute;
  top: 3px; left: 3px;
  width: 21px; height: 21px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 2px 5px rgba(28, 20, 48, .3);
  transition: transform .2s cubic-bezier(.34, 1.56, .64, 1);
}
.sf-switch input:checked ~ .sf-switch-track { background: var(--sf-berry); }
.sf-switch input:checked ~ .sf-switch-thumb { transform: translateX(19px); }
.sf-switch.sf-switch-coral input:checked ~ .sf-switch-track { background: var(--sf-coral); }
.sf-switch input:focus-visible ~ .sf-switch-track {
  box-shadow: 0 0 0 3px rgba(109, 74, 160, .35);
}
.sf-switch.sf-switch-coral input:focus-visible ~ .sf-switch-track {
  box-shadow: 0 0 0 3px rgba(255, 90, 110, .35);
}

/* ── Motion / responsive ────────────────────────────────────────────────── */
@media (max-width: 460px) {
  .sf-fav-card { flex-direction: column; }
  .sf-notify-strip { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
  .sf-switch-thumb, .sf-btn-primary, .sf-item { transition: none; }
}
