.popup-row {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 24px;
  max-width: 95%;
  padding: 24px;
}

#popup-image {
  width: 200px;
  height: 200px;
  object-fit: cover;
  border-radius: 0px;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

#speaker-popup-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-family: "Poppins", sans-serif;
}

#popup-name {
  font-size: 24px;
  font-weight: bold;
  color: #890102;
  margin: 0;
  font-family: "Poppins", sans-serif;
}

#popup-affiliation {
  font-size: 16px;
  color: black;
  margin: 0;
  font-family: "Poppins", sans-serif;
}

#popup-biography {
  font-size: 14px;
  line-height: 1.6;
  margin-top: 12px;
  text-align: justify;
  color: black;
  font-family: "Poppins", sans-serif;
}

.speaker-popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

#speaker-popup {
  border: 4px solid #890102;
  border-radius: 0px;
  background-color: #ffffff;
  max-width: 1000px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  scrollbar-width: thin;
  scrollbar-color: #890102 #f0f0f0;
}

#speaker-popup::-webkit-scrollbar {
  width: 8px;
}

#speaker-popup::-webkit-scrollbar-track {
  background: #f0f0f0;
}

#speaker-popup::-webkit-scrollbar-thumb {
  background: #890102;
  border-radius: 4px;
}

.popup-inner {
  background: #f7f7f7;
  border-radius: 10px;
  padding: 24px;
}

#close-popup {
  position: absolute;
  top: 12px;
  right: 16px;
  background: transparent;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #333;
  z-index: 10000;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.2s ease;
}

#close-popup:hover {
  background-color: rgba(137, 1, 2, 0.1);
}

/* .speakers-grid: dynamic column responsive grid for speakers, with styled tiles */
.speakers-grid {
  display: grid;
  gap: 32px;
  padding: 24px;
  width: 100%;
  margin: 0 auto;
  justify-content: center;
}

.speaker-item {
  text-align: center;
  padding: 12px;
  border-radius: 0px;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.speaker-item:hover {
  transform: translateY(-4px);
}

/* Style dla różnych liczb kolumn */
.speakers-grid[style*="repeat(4, 1fr)"] {
  gap: 40px; /* Większe przerwy dla 4 kolumn */
}

.speakers-grid[style*="repeat(5, 1fr)"] {
  gap: 32px; /* Standardowe przerwy dla 5 kolumn */
}

.speakers-grid[style*="repeat(3, 1fr)"] {
  gap: 48px; /* Jeszcze większe przerwy dla 3 kolumn */
}

.speakers-grid[style*="repeat(2, 1fr)"] {
  gap: 56px; /* Duże przerwy dla 2 kolumn */
}

.speakers-grid[style*="repeat(1, 1fr)"] {
  gap: 24px; /* Małe przerwy dla 1 kolumny */
}

.speaker-item img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 0px;
  border: 3px solid #890102;
  margin-bottom: 8px;
}

.speaker-item h3 {
  font-size: 16px;
  margin: 4px 0;
  font-weight: bold;
  color: black;
  position: relative;
  display: inline-block;
  font-family: "Poppins", sans-serif;
}

.speaker-item h3::after {
  content: "";
  display: block;
  width: 40px;
  height: 3px;
  background-color: #890102;
  margin: 12px auto 0;
}

.speaker-item p {
  font-size: 15px;
  color: black;
  margin: 0;
  font-weight: normal;
  font-family: "Poppins", sans-serif;
}

@media (max-width: 1200px) {
  .speakers-grid {
    gap: 24px; /* Zmniejszamy przerwy na mniejszych ekranach */
    grid-template-columns: repeat(
      3,
      1fr
    ) !important; /* Maksymalnie 3 kolumny na średnich ekranach */
  }
}

@media (max-width: 768px) {
  .speakers-grid {
    gap: 20px; /* Jeszcze mniejsze przerwy na mobile */
    grid-template-columns: repeat(
      2,
      1fr
    ) !important; /* 2 kolumny na tabletach */
  }

  .popup-row {
    flex-direction: column;
    align-items: center;
  }

  #popup-image {
    width: 100%;
    max-width: 300px;
    height: auto;
  }

  #speaker-popup {
    width: 95%;
    max-height: 90vh;
  }

  #speaker-popup-content {
    padding: 16px;
  }
}

@media (max-width: 480px) {
  .speakers-grid {
    gap: 16px; /* Najmniejsze przerwy na bardzo małych ekranach */
    grid-template-columns: 1fr !important; /* Wymusza 1 kolumnę na telefonach */
  }

  #popup-name {
    font-size: 20px;
  }

  #popup-affiliation {
    font-size: 14px;
  }

  #popup-biography {
    font-size: 13px;
  }
}
