/* ————————————————————————————————————————————————
   Global Reset & Base
———————————————————————————————————————————————— */
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font-family: sans-serif;
}

/* ————————————————————————————————————————————————
   FILTRI: Stagione / Giornata
———————————————————————————————————————————————— */
.eurc-filters {
  display: flex;
  flex-wrap: nowrap;        /* non andare a capo */
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  overflow-x: auto;         /* scroll orizzontale se serve */
  padding-bottom: 0.5rem;   /* spazio in più su mobile */
}

.eurc-filters label {
  margin: 0;
  font-weight: 600;
  white-space: nowrap;
}

.eurc-filters select {
  flex-shrink: 0;
  width: auto;                 /* larghezza automatica in base al contenuto */
  padding: 0.4rem 2rem 0.4rem 0.6rem; /* spazio extra a destra per la freccetta */
  border: 1px solid #ccc;
  border-radius: 4px;
  background-color: #fff;
  appearance: none;            /* nasconde freccetta nativa */
  position: relative;
  background-repeat: no-repeat;
  background-position: right 0.8rem center;
  background-size: 0.6rem auto;
  cursor: pointer;
  transition: background-image .2s ease;
}

/* icona freccetta down */
.eurc-filters select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 5'%3E%3Cpath d='M2 0L0 2h4z' fill='%23666'/%3E%3C/svg%3E");
}

/* icona freccetta up quando aperto/focus */
.eurc-filters select:focus {
  outline: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 5'%3E%3Cpath d='M2 5L0 3h4z' fill='%23666'/%3E%3C/svg%3E");
}

/* IE/Edge: rimuovi freccetta nativa */
.eurc-filters select::-ms-expand {
  display: none;
}

/* ————————————————————————————————————————————————
   FIXTURE GRID (solo se stai usando ancora le card)
———————————————————————————————————————————————— */
.fixtures-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.fixtures-readonly-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.fixture-card,
.fixture-readonly {
  background: #fff;
  border-radius: 6px;
  padding: 0.75rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
  text-align: center;
}

.fixture-card .team {
  font-weight: 600;
  margin: 0.5rem 0;
}

.divider {
  margin: 0 0.5rem;
  color: #888;
}

.fixture-card input {
  width: 3rem;
  text-align: center;
}

.eurc-save {
  margin-top: 0.5rem;
  background: #1976d2;
  color: #fff;
  border: none;
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
  cursor: pointer;
}

.eurc-save:hover {
  background: #145a9e;
}

.fixture-readonly {
  font-weight: 500;
  color: #333;
}

.fixture-readonly strong {
  float: right;
  font-weight: 600;
}

/* ————————————————————————————————————————————————
   TABELLONE PARTITE (table-based)
———————————————————————————————————————————————— */
.fixtures-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 2rem;
}

.fixtures-table th,
.fixtures-table td {
  padding: 0.4rem 0.6rem;
  border: 1px solid #eee;
  text-align: left;
}

/* ————————————————————————————————————————————————
   CLASSIFICA ORDINABILE
———————————————————————————————————————————————— */
.standings-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 2rem;
}

.standings-table th,
.standings-table td {
  padding: 0.6rem;
  border-bottom: 1px solid #eee;
}

.standings-table th {
  background: #f0f0f0;
  text-align: left;
}

.standings-table th.sortable {
  cursor: pointer;
}

.standings-table th.sortable span {
  margin-left: 4px;
  font-size: 0.8em;
}

/* ————————————————————————————————————————————————
   MOBILE RESPONSIVE
———————————————————————————————————————————————— */
@media (max-width: 600px) {
  /* card/grid: rimangono scrollabili */
  .fixtures-grid,
  .fixtures-readonly-grid {
    grid-template-columns: 1fr;
  }

  /* classifica in blocchi */
  .standings-table, 
  .standings-table thead, 
  .standings-table tbody,
  .standings-table th, 
  .standings-table td, 
  .standings-table tr {
    display: block;
  }
  .standings-table tr {
    margin-bottom: 0.75rem;
  }
  .standings-table td {
    padding-left: 50%;
    position: relative;
    text-align: right;
  }
  .standings-table td:before {
    content: attr(data-label);
    position: absolute;
    left: 0;
    width: 45%;
    padding-left: 0.5rem;
    font-weight: 600;
    text-align: left;
  }
}

/* ————————————————————————————————————————————————
   Select dropdown: freccetta down permanente
———————————————————————————————————————————————— */
.eurc-filters select {
  /* mantieni tutto il resto invariato… */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 5'%3E%3Cpath d='M2 0L0 2h4z' fill='%23666'/%3E%3C/svg%3E");
}

.eurc-filters select:focus {
  /* rimuovi l’inversione in su, ripeti la stessa freccetta down */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 5'%3E%3Cpath d='M2 0L0 2h4z' fill='%23666'/%3E%3C/svg%3E");
}

/* Edge/IE: nascondi comunque la freccetta nativa */
.eurc-filters select::-ms-expand {
  display: none;
}

/* ————————————————————————————————————————————————
   Input gol casa / gol ospite più compatti
———————————————————————————————————————————————— */
.fixtures-table input.eurc-home,
.fixtures-table input.eurc-away {
  width: 2.8rem;           /* valore più piccolo per non schiacciare la colonna Data */
  padding: 0.25rem;      /* meno padding per mantenere coerente l’altezza */
  text-align: center;
}

/* assets/style.css */

/* Filters inline */
.eurc-filters {
  display: flex; flex-wrap: nowrap; align-items: center;
  gap: 1rem; margin-bottom: 1.5rem; overflow-x: auto;
}
.eurc-filters label {
  margin: 0; font-weight: 600; white-space: nowrap;
}
.eurc-filters select {
  flex-shrink: 0; width: auto;
  padding: 0.4rem 2rem 0.4rem 0.6rem;
  border: 1px solid #ccc; border-radius: 4px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 5'%3E%3Cpath d='M2 0L0 2h4z' fill='%23666'/%3E%3C/svg%3E") no-repeat right 0.8rem center/0.6rem auto;
  appearance: none; cursor: pointer; transition: background-image .2s;
}
.eurc-filters select:focus {
  outline: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 5'%3E%3Cpath d='M2 0L0 2h4z' fill='%23666'/%3E%3C/svg%3E");
}
.eurc-filters select::-ms-expand { display: none; }

/* Fixture cards */
.eurc-round-block .fixtures-table { display: none; }
.eurc-round-block .fixtures-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem; margin-bottom: 2rem;
}
.fixture-card {
  background: linear-gradient(135deg, #fafafa, #fff);
  border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.06);
  padding: 1rem; display: flex; flex-direction: column; justify-content: space-between;
  transition: transform .2s, box-shadow .2s;
}
.fixture-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}
.fixture-card .date {
  font-size: 0.9rem; color: #666; text-align: center; margin-bottom: 0.5rem;
}
.fixture-card .teams {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.75rem;
}
.fixture-card .team {
  font-weight: 600; color: #333;
}
.fixture-card .vs {
  font-size: 1.1rem; color: #999;
}
.fixture-card .score-inputs {
  display: flex; justify-content: space-around; align-items: center; margin-bottom: 0.75rem;
}
.fixture-card .score-inputs input {
  width: 2rem; padding: 0.25rem; text-align: center;
  border: 1px solid #ddd; border-radius: 4px;
}
.fixture-card .eurc-save {
  align-self: center; background: #1976d2; color: #fff;
  border: none; padding: 0.4rem 0.8rem; border-radius: 4px;
  font-weight: 600; cursor: pointer; transition: background .2s;
}
.fixture-card .eurc-save:hover {
  background: #145a9e;
}

/* Read-only grid */
.fixtures-readonly-grid {
  display: grid; grid-template-columns: repeat(auto-fit,minmax(200px,1fr));
  gap: 0.5rem; margin-bottom: 2rem;
}
.fixture-readonly {
  background: #fff; border-radius: 6px; padding: 0.75rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1); position: relative;
}
.fixture-readonly strong {
  position: absolute; right: 0.75rem; top: 50%;
  transform: translateY(-50%); font-weight: 600;
}

/* Standings table */
.standings-table {
  width: 100%; border-collapse: collapse; margin-bottom: 2rem;
}
.standings-table th, .standings-table td {
  padding: 0.6rem; border-bottom: 1px solid #eee; text-align: left;
}
.standings-table th { background: #f0f0f0; }
.standings-table th.sortable { cursor: pointer; }
.standings-table th.sortable span { margin-left: 4px; font-size: 0.8em; }

/* Mobile responsive */
@media(max-width:600px){
  .standings-table, .standings-table thead, .standings-table tbody,
  .standings-table th, .standings-table td, .standings-table tr {
    display: block;
  }
  .standings-table tr { margin-bottom: 0.75rem; }
  .standings-table td {
    padding-left: 50%; position: relative; text-align: right;
  }
  .standings-table td:before {
    content: attr(data-label); position: absolute;
    left: 0; width: 45%; padding-left: 0.5rem;
    font-weight: 600; text-align: left;
  }
}
