html,
body {
  margin: 0;
  padding: 0;
  font-family: "Montserrat", sans-serif;
  overflow-x: hidden;
  scroll-behavior: smooth;
}

/* -----------------------------------
 * HEADER
 * ----------------------------------- */

.header {
  height: 100vh;
  width: 100vw;
  margin-bottom: 40px;
  background-image: url("./korpus-2.JPG");
  background-size: cover;
  background-position: center; /* Центрування зображення */
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  text-align: center; /* Додано для мобільних пристроїв */
}

.header-overlay {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  background: linear-gradient(
    180deg,
    /* Тёмный (начало) - более насыщенный/менее яркий оттенок исходного цвета */
      rgba(150, 140, 180, 0.7) 0%,
    /* Светлый (середина) - исходный цвет или его более яркий/прозрачный вариант */
      rgba(207, 195, 226, 0.45) 50%,
    /* Тёмный (конец) - тот же, что и в начале */ rgba(150, 140, 180, 0.7) 100%
  );
}

#countdown-container {
  display: flex;
  gap: 40px;
  z-index: 2;
  padding: 20px 0;
}

.time-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.time-unit span[id] {
  background: linear-gradient(
    135deg,
    rgba(150, 140, 170, 0.9) 0%,
    rgba(180, 170, 200, 0.8) 100%
  );

  width: 120px;
  height: 120px;
  line-height: 120px;

  font-family: "Montserrat", sans-serif;
  font-size: 3.5rem;
  font-weight: 700;
  color: #ffffff;

  border-radius: 15px;
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
  text-align: center;
  margin-bottom: 10px;

  transition: transform 0.3s ease-in-out;
}

.time-unit span[id]:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 20px rgba(0, 0, 0, 0.3);
}

.time-unit .label {
  font-family: "Montserrat", sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: #ffffff;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.head-title {
  font-size: 4rem;
  font-weight: 900;
  color: #ffffff;
  text-align: center;
  line-height: 1.2;
  text-transform: uppercase;
  text-shadow: 6px 6px 15px rgba(0, 0, 0, 0.4);
  transform: perspective(500px) rotateX(2deg) translateY(-5px);
  transition: transform 0.3s ease-in-out;
  margin: 0 0 30px 0;
  z-index: 2;
}

.post-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: #ffffff;
  text-align: center;
  margin-top: 10px;
  margin: 0 0 20px 0;
  text-shadow: 6px 6px 15px rgba(0, 0, 0, 0.6);
  transform: scale(0.98);
  transition: transform 0.3s ease-out;
  z-index: 2;
}

.post-title i {
  color: #ffffff;
  font-size: 2.2rem;
}

.reg-button {
  width: 320px;
  background-color: rgb(152, 135, 202);
  border: 2px solid rgb(130, 115, 175);
  border-radius: 8px;
  padding: 15px 30px;
  font-size: 20px;
  font-family: "Montserrat", sans-serif;
  font-weight: 700;
  color: white;
  text-decoration: none;
  cursor: pointer;
  transition: 500ms;
  z-index: 2;
  margin-top: 25px;
}

.reg-button:hover {
  background-color: transparent;
  color: #1c1824;
  transition: 500ms;
}

.reg-button a {
  text-decoration: none;
  color: #ffffff !important;
}

/* -----------------------------------
 * MAIN CONTENT (ADAPTIVE CORE)
 * ----------------------------------- */

.main {
  width: 100%; /* Змінено на 100% для адаптивності */
  display: flex;
  justify-content: center;
  align-items: center; /* Вирівнювання по центру, оскільки main тепер 100% */
  flex-direction: column;
}

article {
  /* Головна зміна: видалено фіксовану ширину та padding-inline */
  width: 90%; /* Максимальна ширина для контенту */
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 5%; /* Гнучкі відступи від країв */
}

.title {
  margin: 0;
  font-weight: 700;
  font-size: 52px;
  color: #4e387a;
  text-align: center;
}

.about-text {
  font-size: 28px;
  text-align: justify;
  margin-bottom: 40px;
  max-width: 900px; /* Обмеження ширини тексту для кращої читабельності */
  width: 100%;
}

/* -----------------------------------
 * SPEAKERS (ORG COMMITTEE)
 * ----------------------------------- */

.speakers {
  background-color: rgba(233, 219, 255, 0.85);
  padding-top: 40px;
  padding-bottom: 40px;
}

.speakers-title {
  margin-bottom: 10px;
}

.speaker-chairman-block {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.user-chairman {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  margin-bottom: 10px;
  width: auto;
  height: auto;
}

.speaker-img-chairman {
  margin-right: 60px;
  transform: none;
}

.chairman-info {
  margin-left: 40px;

  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  max-width: 400px;
}

.speaker-info-text {
  margin: 0;
  font-size: 1rem;
}

.speaker-members-title {
  width: 100%;
  text-align: center;
  margin-bottom: 10px;
}

#user-overlay {
  width: 100%;
  display: flex;
  flex-direction: row;
  justify-content: center;
  flex-wrap: wrap;
  gap: 20px;
}

.user {
  width: 165px;
  height: 180px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 40px;
}

.user:last-of-type {
  margin-bottom: 60px;
}

.speaker-img {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 10px;
  transition: all 0.3s ease-in-out;
}

.speaker-img:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  transform: scale(1.05);
}

.speaker-about {
  text-align: center;
  font-weight: bold;
  font-size: 14px;
  margin-top: 5px;
  margin-bottom: 5px;
}

.speaker-info {
  /* Спливаюча підказка */
  position: absolute;
  top: 170px;
  z-index: 10;
  background-color: white;
  border-radius: 6px;
  text-align: center;
  font-size: small;
  color: #555;
  opacity: 0;
  visibility: hidden;
  padding: 5px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  transition: visibility 600ms, opacity 600ms linear;
  max-width: 250px;
}

.user:hover .speaker-info {
  opacity: 1;
  visibility: visible;
}

.speaker-about-rol {
  font-size: 25px;
}

.speaker-secretary-title {
  width: 100%;
  margin-bottom: 5px;
}

/* -----------------------------------
 * DATES
 * ----------------------------------- */

.dates {
  margin-bottom: 40px;
  padding: 20px 0;
}

.dates-title {
  margin-bottom: 40px !important;
  margin-top: 20px !important;
}

.dates-content-wrapper {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 40px;
  width: 100%;
  justify-content: center;
}

.dates-img {
  width: 250px;
  height: auto;
  object-fit: contain;
}

.dates-list-wrapper {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.date-div {
  display: flex;
  flex-direction: column;
  padding: 20px 30px;
  border-left: 5px solid #8a2be2;
  background-color: #f8f4ff;
  border-radius: 4px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
}

.date-div:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
  cursor: default;
}

.date-div p:first-child {
  font-family: "Montserrat", sans-serif;
  font-size: 1.5rem;
  font-weight: 900;
  color: #4b0082;
  margin-bottom: 5px;
  margin-top: 0;
}

.date-div p:last-child {
  font-family: "Montserrat", sans-serif;
  font-size: 1.1rem;
  font-weight: 500;
  color: #555;
  margin-top: 0;
}

/* -----------------------------------
 * SECTION TOPICS
 * ----------------------------------- */

.section-topics {
  background-color: rgba(233, 219, 255, 0.85);
  padding-bottom: 40px;
  margin-bottom: 40px;
  padding-top: 40px;
}

.section-topics-title {
  margin-bottom: 40px;
  text-align: center;
}

.section-cards {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  gap: 20px;
  padding: 0 20px;
}

.sect-card {
  margin: 0;
  padding: 20px;
  width: 280px;
  min-height: 100px;
  background-color: white;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  position: relative;
  cursor: pointer;
  overflow: hidden;
  transition: all 0.5s ease-in-out;
}

.sect-title {
  margin: 0;
  font-weight: 700;
  color: #4b0082;
  font-size: 1.1rem;
  min-height: 60px;
}

.subtopics {
  max-height: 0;
  opacity: 0;
  transition: max-height 0.7s ease-in-out, opacity 0.4s ease-in-out 0.1s;
}

.subtopics hr {
  border: none;
  border-top: 1px solid #cfbce6;
  margin: 8px 0;
  width: 80%;
}

.subtopics p {
  margin: 10px 0;
  font-size: 0.95rem;
  color: #555;
  padding-left: 5px;
}

.sect-card:hover {
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.sect-card:hover .subtopics {
  max-height: 400px;
  opacity: 1;
}

/* -----------------------------------
 * REGISTRATION BUTTONS
 * ----------------------------------- */

.reg-buttons {
  width: 90%; /* Змінено на відсотки */
  max-width: 1000px; /* Контроль ширини */
  display: flex;
  gap: 30px;
  flex-direction: row;
  justify-content: center; /* Змінено на space-around для кращого розподілу */
  align-items: center;
  margin-bottom: 40px;
  gap: 15px; /* Додано простір між кнопками */
}

.reg-buttonn {
  width: 323px !important;
  background-color: rgb(152, 135, 202);
  border: 2px solid rgb(130, 115, 175);
  border-radius: 8px;
  padding: 15px;
  font-size: 24px; /* Трохи зменшено для компактності */
  font-family: "Montserrat", sans-serif;
  font-weight: 700;
  color: white;
  text-decoration: none;
  cursor: pointer;
  transition: 500ms;
}

.reg-buttonn:hover {
  transform: scale(1.05);
}

.gbtn {
  text-decoration: none;
  color: #ffffff !important;
  flex-grow: 1; /* Дозволяє кнопкам розтягуватися в межах контейнера */
}

/* -----------------------------------
 * FOOTER
 * ----------------------------------- */

.footer {
  width: 100%; /* Змінено на 100% */
  padding: 20px 0;
  background-color: #745ca5;
  color: white;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap; /* Додано для адаптивності */
}

.footer-contact-block {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
}

.footer img {
  height: 80px; /* Фіксований розмір для логотипу */
  width: auto;
  margin-right: 40px;
}

.footer-text {
  margin: 0;
  font-size: 20px;
  font-weight: 500;
}

.footer-address {
  margin-left: 80px;
}

.footer-address-text {
  margin-bottom: 20px;
}

/* -----------------------------------
 * MEDIA QUERIES (ADAPTIVE DESIGN)
 * ----------------------------------- */

/* 1. ПЛАНШЕТИ (max-width: 1024px) */
@media (max-width: 1080px) {
  /* Загальні елементи */
  .head-title {
    font-size: 3rem;
  }
  .post-title {
    font-size: 2rem;
  }
  .title {
    font-size: 42px;
  }
  .about-text {
    font-size: 22px;
  }

  /* Спікери (Оргкомітет) */
  .user-chairman {
    flex-direction: column;
    text-align: center;
  }
  .speaker-img-chairman {
    margin-right: 0;
    margin-bottom: 10px;
  }
  .chairman-info {
    align-items: center;
    text-align: center;
  }

  /* Дати */
  .dates-content-wrapper {
    flex-direction: column;
    gap: 20px;
  }
  .dates-img {
    width: 200px;
  }

  /* Кнопки реєстрації */
  .reg-buttons {
    flex-direction: column;
    justify-content: center;
  }
  .gbtn {
    flex-basis: 45%; /* По дві кнопки в ряд */
    margin-bottom: 15px;
  }
  .reg-buttonn {
    width: 100%;
  }

  /* Футер */
  .footer {
    padding-left: 20px;
    padding-right: 20px;
  }
  .footer-address {
    margin-left: 40px;
  }

  .footer img {
    margin-bottom: 20px;
  }

  .footer-contact-block {
    display: flex;
    flex-direction: row;
  }
}

/* 2. СМАРТФОНИ (max-width: 768px) */
@media (max-width: 768px) {
  /* Загальні елементи */
  .head-title {
    font-size: 1.6rem;
    margin-bottom: 15px;
  }
  .post-title {
    font-size: 0.8rem;
    margin-bottom: 15px;
  }
  .post-title i{
    font-size: 0.8rem;
    margin-bottom: 15px;
  }
  .title {
    font-size: 32px;
  }
  .about-text {
    font-size: 18px;
    text-align: left;

    width: 90%;
  }

  .header-overlay {
    height: 100vh;
  }

#reg-buttons {
  scroll-margin-top: 80px; /* высота шапки */
}

  /* Зворотний відлік */
  #countdown-container {
    gap: 15px;
  }
  .time-unit span[id] {
    width: 80px;
    height: 80px;
    line-height: 80px;
    font-size: 2rem;
  }
  .time-unit .label {
    font-size: 1rem;
  }
  .reg-button {
    width: 90%;
    max-width: 280px;
    margin-top: 160px;
  }

  /* Спікери (Оргкомітет) */
  .speaker-about-rol {
    font-size: 20px;
    margin-bottom: 20px;
  }

  .speaker-members-title {
    margin-bottom: 0;
  }
  .speakers {
    padding-bottom: 0;
  }
  .user {
    width: 100%; /* Повний розмір контейнера */
    margin-bottom: 20px;
    height: auto;
  }
  .speaker-img {
    width: 120px;
    height: 120px;
  }
  .user:hover .speaker-info {
    /* Вимкнення спливаючої підказки на мобільних, щоб вона не закривала контент */
    visibility: hidden;
    opacity: 0;
  }
  .speaker-info-text,
  .speaker-info {
    position: static; /* Робить інформацію частиною потоку */
    opacity: 1;
    visibility: visible;
    margin-top: 5px;
    padding: 0;
    font-size: 0.9rem;
    text-align: center;
    max-width: none;
    background-color: transparent;
    box-shadow: none;
  }
  .user-chairman img {
    flex-direction: column;
    margin-left: 10px;
  }
  .chairman-info {
    align-items: center;
    margin-left: 20px;
  }
  /* Дати */
  .dates-title {
    margin-bottom: 0 !important;
  }

  /* Секції */
  .section-cards {
    flex-direction: column;
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 0;
  }
  .sect-card {
    max-width: 400px;
    width: 90%;
  }

  /* Кнопки реєстрації */
  .reg-buttons {
    flex-direction: column; /* Кнопки в стовпчик */
    width: 100%;
  }
  .gbtn {
    flex-basis: 100%;
    margin-bottom: 10px;
  }

  /* Футер */
  .footer {
    flex-direction: column;
    text-align: center;
    padding: 15px 0;
  }
  .footer img {
    margin-right: 0;
    margin-bottom: 15px;
  }
  .footer-address {
    margin-left: 0;
    margin-top: 15px;
  }
  .footer-text {
    font-size: 16px;
    line-height: 1.4;
  }
  .footer-address-text {
    margin-bottom: 5px;
  }
}
