:root {
  /* Основные цвета */
  --primary-blue: #1585bb;
  --secondary-widget: #c6e1ee;

  /* Нейтральные цвета */
  --text-color: #333333;
  --background-color: #f8f9fa;
  --border-color: #e0e0e0;
}

html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  font-family: Arial, Helvetica, system-ui;
  font-size: 14px;
  line-height: 16px;
  font-weight: 400;
  font-style: normal;
  color: var(--text-color);
  line-height: 1.6;

  background-color: white;
}

.main-content {
  position: relative;
  z-index: 1;
  /* background-color: #ffffffd9; */
  min-height: 100vh;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0;
  border-bottom: 1px solid var(--border-color);
  margin: 0 auto;
}

.logo {
  height: 70px;
  width: auto;
  transition: transform 0.3s ease;
}

.logo:hover {
  transform: scale(1.05);
}

.title {
  text-align: center;
}

.list-doctors {
  box-sizing: border-box;
  margin-top: 0px;
  padding-top: 0px;
  padding-bottom: 1332px;
}

.doctor {
  max-width: 1066px;
  display: flex;
  align-items: flex-start;
  gap: 30px;
  justify-content: space-between;
  width: 100%;
}

.doctor-card {
  display: flex;
  flex: 0 0 auto;
  max-width: 400px;
  min-width: 250px;
  align-items: flex-start;
}

.avatar {
  width: 96px;
  height: 96px;
  object-fit: cover;
  display: block;

  border: 1px solid var(--border-color);
  border-radius: 50%;
  overflow: hidden;
  background: white;
}

.doctor-info {
  margin-bottom: 16px;
  display: flex;
  align-items: flex-start;
  flex: 1 1 0%;
  display: block;
  margin: -8px;
  padding: 8px;
  text-decoration: none;
  border-radius: 8px;
  transition: background-color 0.1s linear;
  word-wrap: break-word; /* Перенос длинных слов */
  overflow-wrap: break-word;
}

.padding-line {
  border-bottom: 1px solid var(--border-color);
  padding: 24px 0px;
  margin: 0px auto;
}

.doctor-name {
  font-weight: bold;
  font-size: 18px;
  line-height: 20px;
  color: black;
  margin: 0px;
  word-break: break-word; /* Перенос длинных имен */
}

.specialty {
  font-style: normal;
  font-weight: normal;
  font-size: 14px;
  line-height: 18px;
  color: black;
  margin: 0px;
  word-break: break-word; /* Перенос длинных специальностей */
}

.appointment-widget {
  background: var(--secondary-widget);
  border-radius: 12px;
  box-shadow: 0 2px 8px #0000001a;
  flex: 0 0 auto; /* Измените это - запрещаем растягивание */
  max-width: 500px; /* Фиксированная ширина */
  margin: 0;
  /* margin-right: auto; */
}

.dropdown-button {
  width: 100%;
  padding: 16px;
  background: none;
  border: none;
  border-bottom: 1px solid var(--border-color);
  text-align: left;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.clinic-info {
  flex: 1;
  background-color: var(--background-color);
  border-radius: 8px;
  padding: 10px;
}

.clinic-name {
  font-size: 16px;
  font-weight: 600;
  color: #333;
  margin-bottom: 4px;
}

.clinic-address {
  font-size: 14px;
  color: #666;
}

.dropdown-arrow {
  width: 10px;
  height: 10px;
  transition: transform 0.3s;
}

.address-info {
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
}

.metro-stations {
  display: flex;
  gap: 12px;
}

.metro-station {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  color: #666;
}

.metro-station::before {
  content: "●";
  color: var(--primary-blue);
  font-size: 8px;
}

.map-link {
  color: var(--primary-blue);
  text-decoration: none;
  font-size: 14px;
}

.map-link:hover {
  text-decoration: underline;
}

.day-grid {
  padding: 16px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  border-bottom: 1px solid var(--border-color);
}

.day-button {
  padding: 12px 16px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: white;
  cursor: pointer;
  min-width: 100px;
  text-align: center;
  transition: all 0.3s;
}

.day-button:hover {
  border-color: var(--primary-blue);
  background: #f8f9ff;
}

.day-button.selected {
  background: var(--primary-blue);
  color: white;
  border-color: var(--primary-blue);
}

.day-button.disabled {
  background: #f5f5f5;
  color: #999;
  cursor: not-allowed;
  border-color: var(--border-color);
}

.day-button.disabled:hover {
  border-color: var(--border-color);
  background: #f5f5f5;
}

.calendar-button {
  padding: 12px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: white;
  cursor: pointer;
  min-width: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.calendar-icon {
  width: 16px;
  height: 16px;
  color: #666;
}

.time-grid {
  padding: 16px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.time-button {
  padding: 12px 16px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: white;
  color: var(--primary-blue);
  text-decoration: none;
  font-size: 14px;
  transition: all 0.3s;
  display: inline-block;
  /* Моно шрифт чтобы кнопки распологались симметрично */
  font-family: "SF Mono", "Roboto Mono", "Consolas", "Monaco", "Courier New",
    monospace;
  font-weight: 500; /* Полужирный для лучшей читаемости */
  letter-spacing: -0.02em; /* Небольшое сжатие букв */
}

.time-button:hover {
  background: var(--primary-blue);
  color: white;
  border-color: var(--primary-blue);
}

.day-button time {
  display: block;
}

.day-name {
  font-size: 12px;
  color: inherit;
  opacity: 0.8;
}

.date-full {
  font-size: 14px;
  font-weight: 600;
}

.loading {
  text-align: center;
  padding: 20px;
  color: #666;
  font-style: italic;
}

.calendar-modal * {
  box-sizing: border-box;
}

.calendar-container {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.calendar-container button {
  font-family: inherit;
}

.calendar-container h3 {
  color: #333;
  font-size: 1.2em;
}

/* Для мобильных устройств */
@media (max-width: 1024px) {
  .doctor {
    flex-direction: column;
    align-items: center;
    gap: 20px;
    justify-content: flex-start;
  }

  .doctor-card {
    max-width: 100%;
    min-width: auto;
    flex-direction: column;
    text-align: center;
    margin-bottom: 0;
  }
  .avatar {
    margin: 0 auto 16px;
  }

  .appointment-widget {
    max-width: 100%;
    width: 100%;
    margin-left: 0;
    flex: 1 1 auto;
  }
}

/* Для мобильных устройств (до 768px) */
@media (max-width: 768px) {
  .container {
    padding: 10px;
  }

  header {
    flex-direction: column;
    gap: 15px;
    text-align: center;
  }

  .logo {
    height: 50px;
  }

  .doctor {
    max-width: 100%;
  }

  .doctor-info {
    margin: 0;
    padding: 0;
  }

  .doctor-name {
    font-size: 16px;
  }

  .specialty {
    font-size: 13px;
  }

  .day-grid {
    flex-wrap: wrap;
    justify-content: center;
  }

  .day-button {
    min-width: 80px;
    padding: 10px 12px;
    flex: 1;
    max-width: 100px;
  }

  .time-grid {
    justify-content: center;
  }

  .time-button {
    flex: 1 0 calc(33.333% - 8px);
    max-width: calc(33.333% - 8px);
    text-align: center;
    padding: 10px 8px;
  }

  .address-info {
    flex-direction: column;
    gap: 10px;
    align-items: flex-start;
  }

  .clinic-address {
    font-size: 12px;
  }
}

/* Для очень маленьких экранов (до 480px) */
@media (max-width: 480px) {
  .avatar {
    width: 80px;
    height: 80px;
  }

  .day-button {
    min-width: 70px;
    padding: 8px 10px;
  }

  .time-button {
    flex: 1 0 calc(50% - 8px);
    max-width: calc(50% - 8px);
    font-size: 13px;
    padding: 8px 6px;
  }

  .dropdown-button {
    padding: 12px;
  }

  .address-info,
  .day-grid,
  .time-grid {
    padding: 12px;
  }

  .clinic-name {
    font-size: 14px;
  }

  .clinic-address {
    font-size: 11px;
  }
}

/* Дополнительные улучшения для лучшей адаптивности */
.doctor {
  gap: 20px;
  flex-wrap: wrap;
}

.appointment-widget {
  flex: 1;
  min-width: 300px;
}

/* Для больших экранов (текущее поведение) */
@media (min-width: 1025px) {
  .doctor {
    gap: 15px;
  }

  .doctor-card {
    min-width: auto;
  }

  .avatar {
    margin-right: 20px;
  }

  .appointment-widget {
    min-width: auto;
  }
}
