
:root {
  color-scheme: dark;
  font-family: system-ui, sans-serif;
  background: #111827;
  color: #f9fafb;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

header {
  background: #1f2937;
  padding: 20px 16px;
  text-align: center;
}

h1 {
  margin: 0 0 6px;
  font-size: 1.6rem;
}

main {
  max-width: 1000px;
  margin: auto;
  padding: 20px 12px;
}

.controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.controls h2 {
  margin: 0;
  text-align: center;
  font-size: 1.2rem;
}

button {
  background: #374151;
  color: white;
  border: 1px solid #4b5563;
  border-radius: 8px;
  padding: 10px 14px;
  cursor: pointer;
}

button:hover {
  background: #4b5563;
}

.calendar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.day-header {
  text-align: center;
  color: #d1d5db;
  font-weight: 700;
  padding: 10px 2px;
}

.day {
  background: #1f2937;
  border: 1px solid #374151;
  border-radius: 8px;
  padding: 10px;
  min-height: 110px;
  overflow-wrap: anywhere;
}

.day-number {
  font-size: 1.1rem;
  font-weight: 700;
}

.day.has-events {
  background: #172554;
  border-color: #2563eb;
}

.day.blocked {
  background: #000000;
  border-color: #6b7280;
  color: #ffffff;
}

.day.holiday {
  border-color: #eab308;
}

.event-label {
  display: block;
  margin-top: 8px;
  padding: 5px;
  background: #2563eb;
  border-radius: 4px;
  font-size: 0.75rem;
}

footer {
  padding: 24px;
  text-align: center;
  color: #9ca3af;
  font-size: 0.8rem;
}

@media (max-width: 600px) {
  .day {
    min-height: 90px;
    padding: 6px;
  }

  .day-number {
    font-size: 0.95rem;
  }

  .event-label {
    font-size: 0.65rem;
    padding: 4px;
  }
}

/* Calendari sense límit d'activitats visibles */
.day {
  height: auto;
  max-height: none;
  overflow: visible;
}

.event-label {
  overflow-wrap: anywhere;
  white-space: normal;
}

/* Diferenciar les activitats generals */
.day .event-label {
  line-height: 1.4;
}

/* Etiquetes dels dies bloquejats */
.rest-label {
  background: #000000;
  color: #ffffff;
  border: 1px solid #6b7280;
  font-weight: 700;
}

/* Informació desplegable del projecte */
.about-project {
  margin-top: 24px;
  padding: 16px 20px;
  background: #1f2937;
  border: 1px solid #374151;
  border-radius: 10px;
  color: #f9fafb;
}

.about-project summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 16px;
}

.about-project summary:hover {
  color: #93c5fd;
}

.about-project[open] summary {
  margin-bottom: 16px;
}

.about-project h2 {
  font-size: 18px;
  margin-bottom: 12px;
}

.about-project p {
  color: #d1d5db;
  line-height: 1.6;
  margin-bottom: 12px;
}

/* Capses de competicions al detall del dia */
.competition-details {
  margin: 12px 0;
  border: 1px solid #3b82f6;
  border-radius: 10px;
  background: #1e293b;
  overflow: hidden;
}

.competition-details summary {
  padding: 14px 16px;
  cursor: pointer;
  font-weight: 600;
  background: #172554;
  color: #ffffff;
}

.competition-details summary:hover {
  background: #1e40af;
}

.competition-details p {
  margin: 0;
  padding: 10px 16px;
  border-top: 1px solid #334155;
  color: #e2e8f0;
  line-height: 1.5;
}

/* Seu dels tryouts */
.tryout-venue {
  margin: 0;
  padding: 14px 16px;
  font-size: 16px;
  font-weight: 600;
  color: #ffffff;
  background: #1e293b;
}

/* Diferenciar els tryouts de les competicions */
.tryout-details {
  border-color: #64748b;
}

.tryout-details summary {
  background: #334155;
}

.tryout-details summary:hover {
  background: #475569;
}

/* Enllaços de Google Maps */
.maps-link {
  display: inline-block;
  margin: 8px 16px 12px;
  color: #93c5fd;
  font-size: 14px;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.maps-link:hover {
  color: #ffffff;
}

.maps-link:focus-visible {
  outline: 2px solid #93c5fd;
  outline-offset: 3px;
}

/* Icona de Maps al costat del nom de la seu */
.maps-icon {
  display: inline-block;
  margin-left: 10px;
  font-size: 16px;
  text-decoration: none;
  vertical-align: middle;
}

.maps-icon:hover {
  transform: scale(1.2);
}

.maps-icon:focus-visible {
  outline: 2px solid #93c5fd;
  outline-offset: 3px;
  border-radius: 3px;
}
/* Panell de filtres */
.filters-panel {
  margin: 16px 0 24px;
  padding: 14px;
  background: #1f2937;
  border: 1px solid #374151;
  border-radius: 10px;
}

.filters-panel > summary {
  cursor: pointer;
  font-weight: 600;
  color: #f9fafb;
}

.filters-content {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr auto;
  gap: 12px;
  align-items: end;
  margin-top: 14px;
}

.filter-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.filter-field label {
  font-size: 14px;
  color: #d1d5db;
}

.filter-field select,
.filter-field input {
  width: 100%;
  min-width: 0;
  padding: 10px;
  color: #f9fafb;
  background: #111827;
  border: 1px solid #4b5563;
  border-radius: 6px;
  font: inherit;
}

#clear-filters {
  padding: 10px 14px;
  color: #f9fafb;
  background: #374151;
  border: 1px solid #4b5563;
  border-radius: 6px;
  cursor: pointer;
}

/* Escriptori: filtres sempre visibles */
@media (min-width: 769px) {
  .filters-panel > summary {
    display: none;
  }

  .filters-content {
    margin-top: 0;
  }
}

/* Mòbil: panell desplegable */
@media (max-width: 768px) {
  .filters-content {
    grid-template-columns: 1fr;
  }

  .filters-panel {
    padding: 12px;
  }

  #clear-filters {
    width: 100%;
  }
}
/* A l'escriptori, els filtres sempre han de ser visibles. */
@media (min-width: 769px) {
  .filters-panel:not([open]) > .filters-content {
    display: grid;
  }
}
/* Navegació entre Calendari i Agenda d'equip */

.view-navigation {
  display: flex;
  gap: 8px;
  margin: 20px 0;
}

.view-navigation button {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid #374151;
  border-radius: 8px;
  background: #1f2937;
  color: #d1d5db;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.view-navigation button.active {
  background: #1d4ed8;
  border-color: #3b82f6;
  color: #ffffff;
}

.view-navigation button:hover {
  border-color: #60a5fa;
}

@media (max-width: 768px) {
  .view-navigation {
    gap: 6px;
    margin: 12px 0;
  }

  .view-navigation button {
    padding: 12px 8px;
    font-size: 14px;
  }
}

/* Filtre múltiple de competicions de l'Agenda */

.agenda-competitions {
  margin-top: 16px;
}

#agenda-competitions-panel {
  background: #1f2937;
  border: 1px solid #374151;
  border-radius: 8px;
  padding: 12px;
}

#agenda-competitions-panel summary {
  cursor: pointer;
  font-weight: 600;
  color: #ffffff;
}

#agenda-competitions-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
  margin-top: 12px;
  max-height: 260px;
  overflow-y: auto;
}

.agenda-competition-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 6px;
  cursor: pointer;
}

.agenda-competition-option:hover {
  background: #374151;
}

.agenda-competition-option input {
  width: 17px;
  height: 17px;
  margin: 0;
  flex-shrink: 0;
  accent-color: #2563eb;
}

.agenda-competition-option span {
  color: #ffffff;
  font-size: 14px;
}


/* Agenda d'equip: agrupacions per data i seu */

#agenda-results {
  margin-top: 24px;
}

.agenda-group {
  background: #1f2937;
  border: 1px solid #374151;
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 12px;
}

.agenda-group h4 {
  margin: 0 0 8px;
  font-size: 16px;
  color: #ffffff;
}

.agenda-group p {
  margin: 6px 0;
  font-size: 14px;
  line-height: 1.5;
}

.agenda-maps-link {
  display: inline-block;
  margin-bottom: 8px;
  color: #93c5fd;
  font-size: 13px;
  text-decoration: none;
}

.agenda-maps-link:hover {
  text-decoration: underline;
}

@media (max-width: 768px) {
  .agenda-group {
    padding: 12px;
  }

  .agenda-group h4 {
    font-size: 15px;
  }

  .agenda-group p {
    font-size: 13px;
  }
}

.agenda-group h4 .agenda-maps-link {
  display: inline;
  margin: 0 0 0 4px;
  font-size: 15px;
  text-decoration: none;
}
