/* harmo-styles.css
   Style TYLKO dla sekcji harmonogramu (unikalne ID/klasy)
   Kolorystyka:
     - Biały (#fff)
     - Pomarańcz (#f07d05)
     - Granat (#212b54)
*/

/* -------------------------------------------------------
   GŁÓWNY KONTAINER HARMONOGRAMU
------------------------------------------------------- */
#harmoSection.harmo-section {
  max-width: 1200px;
  margin: 40px auto;
  padding: 0 20px;
  background-color: #fff;
}

/* NAGŁÓWEK W SEKCJI (np. "Harmonogram treningów") */
#harmoSection.harmo-section > h2 {
  font-size: 1.5rem;
  color: #212b54;
  margin-bottom: 15px;
  text-transform: uppercase;
  /* Domyślnie (na telefonach) nie center – ustawimy w media query dla desktop */
}

/* -------------------------------------------------------
   BOX WYSZUKIWANIA (POLE + PRZYCISKI)
------------------------------------------------------- */
#harmoSearchBox {
  margin-bottom: 15px;
  display: flex; 
  flex-wrap: wrap; 
  align-items: center; 
  gap: 10px; 
  /* Domyślnie (na telefonach) nie center – ustawimy w media query dla desktop */
}

/* POLE TEKSTOWE */
#harmoSearchInput {
  padding: 8px;
  width: 220px;
  border: 1px solid #ccc;
  border-radius: 4px;
}
#harmoSearchInput:focus {
  outline: 1px solid #f07d05;
}

/* PRZYCISK "PRZESZUKAJ WSZYSTKIE..." */
#harmoSearchButton {
  padding: 9px 16px;
  background-color: #f07d05;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}
#harmoSearchButton:hover {
  background-color: #e06c03;
}

/* PRZYCISK "POKAŻ/UKRYJ LOKALIZACJE" */
#harmoToggleLocationsButton {
  padding: 9px 16px;
  background-color: #212b54;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.3s ease;
  /* Usunięto margin-left: auto; żeby nie wypychał się w prawo
     – zrobimy centrowanie w media query. */
}
#harmoToggleLocationsButton:hover {
  background-color: #1b2244;
}

/* -------------------------------------------------------
   LISTA LOKALIZACJI
------------------------------------------------------- */
#harmoLocationsContainer.harmo-locations-container { 
}

/* POJEDYNCZA LOKALIZACJA */
.harmo-location-block {
  border: 1px solid #ddd;
  border-radius: 5px;
  margin-bottom: 15px;
  overflow: hidden;
  background-color: #fff;
}

/* KLIKALNY NAGŁÓWEK LOKALIZACJI */
.harmo-location-heading {
  font-size: 1.1rem;
  background-color: #212b54;
  color: #fff;
  padding: 10px 15px;
  cursor: pointer;
  user-select: none;
  position: relative;
  font-weight: 500;
}
.harmo-location-heading:hover {
  background-color: #1b2244;
}
.harmo-location-heading::after {
  content: "▼";
  font-size: 0.9rem;
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
}

/* ROZWIJANA TREŚĆ (ANIMACJA) */
.harmo-location-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease;
  background-color: #fff;
  color: #333;
  padding: 0 15px;
}
.harmo-location-content.expanded {
  max-height: none; /* brak limitu, by nie ucinało tabel */
  padding: 15px;
}

/* KOORDYNATORZY */
.harmo-coords-list {
  margin-left: 20px;
  margin-bottom: 15px;
}
.harmo-coords-list li {
  margin: 5px 0;
}

/* -------------------------------------------------------
   TABELA Z TRENINGAMI (DESKTOP)
------------------------------------------------------- */
.harmo-table-container {
  width: 100%;
  overflow-x: visible;
  position: relative;
}
.harmo-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}
.harmo-table th,
.harmo-table td {
  border: 1px solid #ccc;
  padding: 8px 10px;
  text-align: left;
  /* tekst się zawija (brak white-space: nowrap) */
}
.harmo-table th {
  background-color: #f07d05; /* pomarańcz */
  color: #fff;
  text-transform: uppercase;
  font-weight: 600;
}
.harmo-table tbody tr:nth-child(even) {
  background-color: #f8f8f8;
}

/* TEKSTY TYPU "BRAK TRENINGÓW" */
.harmo-info {
  margin-top: 10px;
  font-style: italic;
  color: #555;
}

/* -------------------------------------------------------
   LOADER (spinner + tekst)
------------------------------------------------------- */
.harmo-loading {
  display: flex;
  align-items: center;
  color: #212b54;
  margin: 10px 0;
  font-size: 1rem;
}
.harmo-loading-spinner {
  width: 24px;
  height: 24px;
  border: 4px solid #ccc; 
  border-top: 4px solid #f07d05; 
  border-radius: 50%;
  margin-right: 8px;
  animation: harmo-spin 1s linear infinite;
}
@keyframes harmo-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* -------------------------------------------------------
   RESPONSYWNOŚĆ - TELEFON max-width: 768px
   -> scroll w poziomie, mniejsze fonty
------------------------------------------------------- */
@media (max-width: 768px) {

  #harmoSection.harmo-section > h2 {
    font-size: 1.3rem;
  }

  .harmo-location-heading {
    font-size: 1rem;
  }

  .harmo-table-container {
    overflow-x: auto; 
    -webkit-overflow-scrolling: touch;
  }
  .harmo-table {
    width: 100%;
  }
  .harmo-table th,
  .harmo-table td {
    font-size: 0.9rem;
    padding: 6px 8px;
  }

  /* Układ input + przyciski w kolumnie */
  #harmoSearchBox {
    flex-direction: column;
    align-items: flex-start;
  }
  #harmoSearchInput {
    width: 100%;
  }
  #harmoToggleLocationsButton {
    width: 100%;
  }
  #harmoSearchButton {
    width: 100%;
  }
}

/* -------------------------------------------------------
   RESPONSYWNOŚĆ - DESKTOP min-width: 769px
   -> Wyśrodkuj Tytuł, Input i Buttony
------------------------------------------------------- */
@media (min-width: 769px) {
  /* Wyśrodkuj tytuł */
  #harmoSection.harmo-section > h2 {
    text-align: center;
  }
  /* Wyśrodkuj #harmoSearchBox (pole i przyciski) */
  #harmoSearchBox {
    justify-content: center;
  }
  /* Przyciski także w centrum 
     (usuwamy automatyczne przesuwanie w prawo z #harmoToggleLocationsButton) */
  #harmoToggleLocationsButton {
    margin-left: 0;
  }
}
