/* ================================================================
   SwimmerShop Names List — nameslist.css  v2.0
   Copre sia la modalità TAB (PS 1.6) sia la modalità ACCORDION (PS 1.7+/9)
   Tutti i selettori prefissati .swimnames-* → nessun conflitto col tema
   ================================================================ */


/* ── 1. ACCORDION WRAPPER (solo PS 1.7+/9) ─────────────────────── */

.swimnames-accordion {
  margin: 28px 0;
  border: 1px solid #cce0f0;
  border-radius: 6px;
  overflow: hidden;
}

.swimnames-accordion-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 15px 20px;
  background: #eaf4fb;
  border: none;
  cursor: pointer;
  text-align: left;
  font-size: 15px;
  font-weight: 700;
  color: #174f7a;
  transition: background 0.2s;
  line-height: 1.3;
}

.swimnames-accordion-toggle:hover,
.swimnames-accordion-toggle:focus-visible {
  background: #d5ebf7;
  outline: none;
}

.swimnames-accordion-toggle[aria-expanded="true"] {
  background: #d5ebf7;
  border-bottom: 1px solid #b3d5ec;
}

/* Freccia animata */
.swimnames-toggle-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: #2a7ab8;
  transition: transform 0.25s ease;
}

.swimnames-toggle-icon::before {
  content: '▶';
  font-size: 10px;
}

.swimnames-accordion-toggle[aria-expanded="true"] .swimnames-toggle-icon {
  transform: rotate(90deg);
}

/* Badge contatore nella toggle */
.swimnames-badge {
  margin-left: auto;
  background: #2a7ab8;
  color: #fff;
  border-radius: 20px;
  padding: 3px 11px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}

.swimnames-badge-of {
  opacity: 0.7;
  font-weight: 400;
}

/* Body accordion */
.swimnames-accordion-body {
  padding: 0; /* il padding è sull'inner */
}


/* ── 2. INNER CONTENT (condiviso tab PS1.6 + accordion PS1.7+) ─── */

.swimnames-inner {
  padding: 20px 22px 24px;
  background: #fff;
}

/* Testo introduttivo */
.swimnames-intro {
  font-size: 14px;
  line-height: 1.6;
  color: #333;
  background: #f4faff;
  border-left: 3px solid #2a7ab8;
  border-radius: 0 4px 4px 0;
  padding: 10px 14px;
  margin: 0 0 20px;
}


/* ── 3. RICERCA LIVE ─────────────────────────────────────────────── */

.swimnames-search-wrap {
  margin-bottom: 18px;
}

.swimnames-search-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: #222;
  margin-bottom: 6px;
}

.swimnames-search-row {
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: 380px;
}

.swimnames-search {
  flex: 1;
  padding: 9px 13px;
  border: 1px solid #a8c8e8;
  border-radius: 4px;
  font-size: 14px;
  color: #111;
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
  /* Reset stile nativo del browser per type=search */
  -webkit-appearance: none;
  appearance: none;
}

.swimnames-search:focus {
  border-color: #2a7ab8;
  box-shadow: 0 0 0 3px rgba(42, 122, 184, 0.18);
  outline: none;
}

/* Bottone × cancella */
.swimnames-search-clear {
  background: none;
  border: 1px solid #ccc;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  color: #666;
  padding: 7px 10px;
  line-height: 1;
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
}

.swimnames-search-clear:hover {
  background: #fde8e8;
  color: #c0392b;
  border-color: #c0392b;
}

/* Hint sotto il campo */
.swimnames-search-hint {
  display: block;
  font-size: 11px;
  color: #888;
  margin-top: 4px;
}

/* Contatore risultati (aria-live) */
.swimnames-search-count {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #2a7ab8;
  margin-top: 5px;
  min-height: 16px;
}


/* ── 4. LEGENDA ──────────────────────────────────────────────────── */

.swimnames-legend {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 12px;
  color: #555;
  margin-bottom: 18px;
}

.swimnames-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.swimnames-dot--avail   { background: #27ae60; }
.swimnames-dot--unavail { background: #c0392b; }


/* ── 5. GRIGLIA LETTERE ──────────────────────────────────────────── */

.swimnames-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
  gap: 18px 14px;
}

/* Gruppo lettera nascosto durante la ricerca */
.swimnames-group--hidden {
  display: none !important;
}

.swimnames-letter {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: #174f7a;
  background: #e8f3fb;
  border-radius: 3px;
  padding: 2px 8px;
  margin: 0 0 7px;
  display: inline-block;
}

.swimnames-list {
  list-style: none;
  margin: 0;
  padding: 0;
}


/* ── 6. SINGOLO NOME ─────────────────────────────────────────────── */

.swimnames-name {
  display: flex;
  align-items: baseline;
  gap: 3px;
  padding: 2px 0;
  font-size: 13px;
  line-height: 1.65;
  color: #1a7a40;        /* verde = disponibile */
}

.swimnames-name--unavail {
  color: #a93226;        /* rosso = esaurito */
}

/* Nome nascosto dalla ricerca */
.swimnames-name--hidden {
  display: none !important;
}

.swimnames-name-text {
  /* nessuno stile aggiuntivo — il colore è ereditato dal <li> */
}

.swimnames-unavail-tag {
  font-size: 10px;
  color: #a93226;
  opacity: 0.75;
  white-space: nowrap;
}


/* ── 7. MESSAGGIO NESSUN RISULTATO ───────────────────────────────── */

.swimnames-no-result {
  font-size: 14px;
  color: #555;
  padding: 18px 0 4px;
  text-align: center;
  grid-column: 1 / -1;
}

.swimnames-no-result a {
  color: #2a7ab8;
  text-decoration: underline;
}


/* ── 8. FOOTER NOTE ──────────────────────────────────────────────── */

.swimnames-footer {
  margin-top: 22px;
  padding-top: 14px;
  border-top: 1px solid #ddeef8;
}

.swimnames-footer p {
  font-size: 12px;
  color: #666;
  line-height: 1.6;
  margin: 0;
}

.swimnames-footer a {
  color: #2a7ab8;
  text-decoration: underline;
}


/* ── 9. RESPONSIVE ───────────────────────────────────────────────── */

@media (max-width: 640px) {
  .swimnames-grid {
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 14px 10px;
  }

  .swimnames-accordion-toggle {
    font-size: 14px;
    padding: 13px 15px;
  }

  .swimnames-badge {
    font-size: 11px;
    padding: 2px 9px;
  }

  .swimnames-inner {
    padding: 16px 15px 18px;
  }

  .swimnames-search-row {
    max-width: 100%;
  }
}

@media (max-width: 400px) {
  .swimnames-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
