/*
 * Collectathon — "Find My Stickers" (/finder) page styles.
 * Reuses the brand tokens defined at the top of /styles.css
 * (--navy, --brand-yellow, --surface, --ink, --muted, --border, …) so the
 * page stays visually consistent with the rest of the site.
 */

.finder {
  width: 100%;
  max-width: 760px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  animation: rise 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.finder__head {
  text-align: center;
  margin-top: 8px;
  position: relative;
}

.finder__title-wrap {
  position: relative;
  display: inline-block;
  padding: 0 26px;
}

.finder__title {
  color: #fff;
  font-size: 44px;
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin: 0 0 12px;
}

.finder__title .hl {
  color: var(--brand-yellow);
}

.finder__spark {
  position: absolute;
  color: var(--brand-yellow);
  pointer-events: none;
  line-height: 1;
}

.finder__spark--1 {
  top: -8px;
  left: -6px;
  font-size: 22px;
}

.finder__spark--2 {
  top: 2px;
  right: 4px;
  font-size: 14px;
  opacity: 0.7;
}

.finder__spark--3 {
  bottom: 4px;
  right: -12px;
  font-size: 20px;
}

.finder__sub {
  color: rgba(255, 255, 255, 0.82);
  font-size: 16px;
  line-height: 1.6;
  margin: 0 auto;
  max-width: 560px;
}

/* ── Dark translucent panel (filter row + search) ───────────────────────── */
.finder-panel {
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(130, 160, 210, 0.28);
  border-radius: 22px;
  padding: 18px 20px;
}

/* ── White content card (map, results, CTA) ─────────────────────────────── */
.finder-card {
  background: var(--surface);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
  padding: 18px;
}

/* ── Field label ────────────────────────────────────────────────────────── */
.finder-label {
  font-size: 11px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.6);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

/* ── Dark select / input ────────────────────────────────────────────────── */
.finder-select,
.finder-input {
  height: 46px;
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  padding: 0 14px;
  font-size: 15px;
  font-weight: 500;
  color: #fff;
  background: rgba(9, 22, 45, 0.55);
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.finder-input::placeholder {
  color: rgba(255, 255, 255, 0.45);
}

.finder-select:focus,
.finder-input:focus {
  border-color: var(--brand-yellow);
  box-shadow: 0 0 0 3px rgba(249, 200, 70, 0.22);
}

.finder-select {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23c7d3e8' d='M6 8 0 2l1.4-1.4L6 5.2 10.6.6 12 2z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

.finder-select option {
  color: #16202e;
}

/* ── Filter row (RADIO · ÁLBUM · MÁS FILTROS) ───────────────────────────── */
.finder-controls {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.finder-control {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.finder-control__icon {
  flex: none;
  width: 34px;
  height: 34px;
  color: #6b8fd6;
  display: flex;
  align-items: center;
  justify-content: center;
}

.finder-control__icon svg {
  width: 26px;
  height: 26px;
}

.finder-control__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* ── Search card ────────────────────────────────────────────────────────── */
.finder-search__head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.finder-search__icon {
  color: #6b8fd6;
  display: flex;
}

.finder-search__icon svg {
  width: 22px;
  height: 22px;
}

.finder-search__row {
  display: flex;
  gap: 12px;
  align-items: stretch;
}

.finder-search__row .finder-input {
  flex: 1;
  height: 54px;
  font-size: 17px;
}

.finder-search__hint {
  text-align: center;
  color: rgba(255, 255, 255, 0.55);
  font-size: 13px;
  margin: 12px 0 0;
}

/* ── Buscar button ──────────────────────────────────────────────────────── */
.finder-btn {
  height: 54px;
  padding: 0 28px;
  border: none;
  border-radius: 14px;
  background: var(--brand-yellow);
  color: var(--on-yellow);
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.18s ease, transform 0.05s ease;
  white-space: nowrap;
}

.finder-btn svg {
  width: 20px;
  height: 20px;
}

.finder-btn:hover {
  background: var(--brand-yellow-dark);
}

.finder-btn:active {
  transform: translateY(1px);
}

.finder-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* ── Location status ────────────────────────────────────────────────────── */
.finder-status {
  color: rgba(255, 255, 255, 0.78);
  font-size: 14px;
  text-align: center;
  margin: 2px 0;
  min-height: 20px;
}

.finder-status--error {
  color: #ffd7dc;
}

.finder-status a {
  color: var(--brand-yellow);
  font-weight: 700;
}

/* ── Map ────────────────────────────────────────────────────────────────── */
.finder-map-wrap {
  padding: 6px;
}

.finder-map {
  width: 100%;
  height: 320px;
  border-radius: calc(var(--radius-card) - 8px);
  overflow: hidden;
  z-index: 0;
}

/* ── Results grid (mirrors mobile trader cards, 3 columns) ─────────────── */
.finder-results-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.finder-results-label {
  color: rgba(255,255,255,0.82);
  font-size: 14px;
  font-weight: 600;
  margin: 0;
}

.finder-results {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  max-height: 480px;
  overflow-y: auto;
  overscroll-behavior: contain;
  /* thin scrollbar on webkit */
  scrollbar-width: thin;
  scrollbar-color: rgba(249,200,70,0.4) transparent;
}

.finder-results::-webkit-scrollbar {
  width: 4px;
}
.finder-results::-webkit-scrollbar-thumb {
  background: rgba(249,200,70,0.4);
  border-radius: 4px;
}

/* Single trader card */
.finder-result {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 4px 16px rgba(12,30,58,0.10);
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  position: relative;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.18s ease;
}

.finder-result:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(12,30,58,0.16);
}

/* Avatar circle (navy bg, white initials) */
.finder-result__avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  font-weight: 800;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Distance below the avatar */
.finder-result__dist {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  color: var(--muted);
  margin-top: -4px;
}

.finder-result__dist svg {
  width: 11px;
  height: 11px;
  flex: none;
  color: var(--muted);
}

.finder-result__body {
  width: 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.finder-result__name {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}

.finder-result__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: center;
}

/* Yellow figures pill (mirrors the app's turboYellow chip) */
.finder-badge--count {
  background: #FFE000;
  color: var(--navy-deep);
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 10px;
  white-space: nowrap;
}

/* Swap / sale badges */
.finder-badge--sale {
  background: rgba(31,138,91,0.12);
  color: var(--green);
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 10px;
  white-space: nowrap;
}

.finder-badge--swap {
  background: rgba(18,42,79,0.08);
  color: var(--navy);
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 10px;
  white-space: nowrap;
}

/* Chevron arrow — bottom right of card */
.finder-result__chevron {
  position: absolute;
  bottom: 10px;
  right: 10px;
  color: var(--border);
  line-height: 1;
  font-size: 14px;
}

/* ── State blocks (loading / empty / error) ────────────────────────────── */
.finder-state {
  text-align: center;
  color: rgba(255, 255, 255, 0.82);
  padding: 22px 16px;
}

.finder-state__title {
  color: #fff;
  font-size: 18px;
  font-weight: 800;
  margin: 0 0 6px;
}

.finder-state__desc {
  font-size: 14px;
  margin: 0;
  line-height: 1.5;
}

.finder-spinner {
  width: 26px;
  height: 26px;
  margin: 0 auto 12px;
  border: 3px solid rgba(255, 255, 255, 0.25);
  border-top-color: var(--brand-yellow);
  border-radius: 50%;
  animation: finder-spin 0.8s linear infinite;
}

@keyframes finder-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ── Connect CTA ────────────────────────────────────────────────────────── */
.finder-cta {
  text-align: center;
  margin-top: 4px;
  transition: box-shadow 0.25s ease;
}

/* Attention pulse: replayed when a visitor taps a result card. */
.finder-cta--attention {
  animation: finder-cta-shake 0.6s cubic-bezier(0.36, 0.07, 0.19, 0.97);
  box-shadow: 0 0 0 3px var(--brand-yellow), 0 18px 40px rgba(249, 200, 70, 0.4);
}

@keyframes finder-cta-shake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(4px); }
  30%, 50%, 70% { transform: translateX(-8px); }
  40%, 60% { transform: translateX(8px); }
}

@media (prefers-reduced-motion: reduce) {
  .finder-cta--attention {
    animation: none;
  }
}

.finder-cta__title {
  font-size: 20px;
  font-weight: 800;
  color: var(--ink);
  margin: 0 0 6px;
}

.finder-cta__desc {
  font-size: 15px;
  color: var(--muted);
  margin: 0 auto 16px;
  max-width: 460px;
  line-height: 1.55;
}

.finder-cta__stores {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: nowrap;
}

.finder-cta__stores .store {
  flex: 1;
  max-width: 260px;
  min-width: 200px;
  padding: 14px 20px;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.finder-cta__stores .store__icon {
  width: 22px;
  height: 22px;
  flex: none;
}

.finder-cta__stores .store--ios {
  background: var(--brand-yellow);
  color: var(--on-yellow);
  border: 2px solid var(--brand-yellow);
}

.finder-cta__stores .store--ios:hover {
  background: var(--brand-yellow-dark);
  border-color: var(--brand-yellow-dark);
}

.finder-cta__stores .store--ios .store__icon {
  filter: brightness(0) saturate(100%);
}

.finder-cta__stores .store--android {
  background: var(--navy);
  color: #fff;
  border: 2px solid var(--navy);
}

.finder-cta__stores .store--android:hover {
  background: var(--navy-deep);
}

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .finder__title {
    font-size: 32px;
  }

  .finder-controls {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .finder-search__row {
    flex-direction: column;
  }

  .finder-results {
    grid-template-columns: repeat(2, 1fr);
  }

  .finder-cta__stores {
    flex-wrap: wrap;
  }

  .finder-cta__stores .store {
    max-width: none;
    flex: 1 1 100%;
  }
}
