/* Обновленный CSS с анимациями и градиентами */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --primary-color: #007acc;
  --primary-light: #e0f2ff;
  --primary-lighter: #b3d9ff;
  --text-color: #333;
  --text-light: #555;
  --white: #ffffff;
  --gray-light: #f0f0f0;
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

body {
  font-family: 'Inter', sans-serif;
  margin: 0;
  color: var(--text-color);
  position: relative;
  min-height: 100vh;
}

.background-gradient {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--primary-light), var(--white));
  z-index: -1;
}

header {
  background: var(--primary-color);
  color: var(--white);
  padding: 1.5rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  box-shadow: var(--shadow);
}

.header-wave {
  position: absolute;
  bottom: -10px;
  left: 0;
  width: 100%;
  height: 10px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 120' preserveAspectRatio='none'%3E%3Cpath d='M0,0V46.29c47.79,22.2,103.59,32.17,158,28,70.36-5.37,136.33-33.31,206.8-37.5C438.64,32.43,512.34,53.67,583,72.05c69.27,18,138.3,24.88,209.4,13.08,36.15-6,69.85-17.84,104.45-29.34C989.49,25,1113-14.29,1200,52.47V0Z' opacity='.25' fill='%23007acc'%3E%3C/path%3E%3Cpath d='M0,0V15.81C13,36.92,27.64,56.86,47.69,72.05,99.41,111.27,165,111,224.58,91.58c31.15-10.15,60.09-26.07,89.67-39.8,40.92-19,84.73-46,130.83-49.67,36.26-2.85,70.9,9.42,98.6,31.56,31.77,25.39,62.32,62,103.63,73,40.44,10.79,81.35-6.69,119.13-24.28s75.16-39,116.92-43.05c59.73-5.85,113.28,22.88,168.9,38.84,30.2,8.66,59,6.17,87.09-7.5,22.43-10.89,48-26.93,60.65-49.24V0Z' opacity='.5' fill='%23007acc'%3E%3C/path%3E%3Cpath d='M0,0V5.63C149.93,59,314.09,71.32,475.83,42.57c43-7.64,84.23-20.12,127.61-26.46,59-8.63,112.48,12.24,165.56,35.4C827.93,77.22,886,95.24,951.2,90c86.53-7,172.46-45.71,248.8-84.81V0Z' fill='%23007acc'%3E%3C/path%3E%3C/svg%3E");
  background-size: cover;
}

header h1 {
  margin: 0;
  font-weight: 600;
  font-size: 1.5rem;
}

.start-date {
  font-size: 0.9rem;
  opacity: 0.9;
}

.week-selector {
  background: var(--white);
  padding: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  position: relative;
  margin: 1rem auto;
  max-width: 95%;
  border-radius: 12px;
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
}

.week-selector:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.week-arrow {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 50%;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.week-arrow:hover {
  background: var(--primary-light);
}

.week-arrow:active {
  transform: scale(0.9);
}

#week-days {
  display: flex;
  gap: 0.8rem;
}

.week-day {
  padding: 0.6rem 1.2rem;
  background: var(--gray-light);
  border-radius: 8px;
  cursor: pointer;
  border: none;
  font-weight: 500;
  transition: all 0.2s ease;
}

.week-day:hover {
  transform: translateY(-2px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.week-day.active {
  background: var(--primary-color);
  color: var(--white);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 122, 204, 0.3);
}

.week-day.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.week-day.future {
  border: 1px dashed var(--primary-color);
  color: var(--primary-color);
  background: transparent;
}

.week-day.future.active {
  background: var(--primary-color);
  color: var(--white);
}

.calendar-input {
  padding: 0.6rem 1rem;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-family: 'Inter', sans-serif;
  margin-left: 1rem;
  transition: all 0.2s ease;
}

.calendar-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(0, 122, 204, 0.2);
}

.schedule-meta {
  padding: 1.5rem 2rem;
  background: var(--white);
  margin: 1rem auto;
  max-width: 95%;
  border-radius: 12px;
  box-shadow: var(--shadow);
}

#schedule-title {
  margin: 0;
  font-size: 1.3rem;
  color: var(--primary-color);
}

#selected-date {
  font-weight: 600;
}

#last-updated {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-light);
}

#ended-note {
  margin-top: 0.5rem;
  color: #ff4444;
  font-weight: 500;
}

.table-container {
  overflow-x: auto;
  padding: 0 1rem;
  margin-bottom: 2rem;
}

.schedule-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 0 auto;
  max-width: 1000px;
  background: var(--white);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.schedule-table th {
  background: var(--primary-color);
  color: var(--white);
  padding: 1rem;
  text-align: center;
  font-weight: 500;
}

.schedule-table td {
  padding: 0.8rem 1rem;
  border-bottom: 1px solid #eee;
  text-align: center;
  transition: background 0.2s ease;
}

.schedule-table tr:hover td {
  background: var(--primary-light);
}

.schedule-table tr:last-child td {
  border-bottom: none;
}

.version-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  padding: 1.2rem 2rem;
  align-items: center;
  background: var(--white);
  margin: 1rem auto;
  max-width: 95%;
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.version-buttons span {
  margin-right: 0.5rem;
  font-weight: 600;
  color: var(--primary-color);
}

.version-buttons button {
  padding: 0.5rem 1rem;
  border: 1px solid #ddd;
  border-radius: 8px;
  cursor: pointer;
  background: var(--white);
  font-weight: 500;
  transition: all 0.2s ease;
}

.version-buttons button:hover {
  background: var(--primary-light);
  transform: translateY(-2px);
}

.version-buttons button.active {
  background: var(--primary-color);
  color: var(--white);
  border-color: var(--primary-color);
  transform: translateY(-2px);
  box-shadow: 0 2px 8px rgba(0, 122, 204, 0.3);
}

/* Анимации */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
  animation: fadeIn 0.4s ease-out forwards;
}

/* Для мобильных устройств */
@media (max-width: 768px) {
  header {
    padding: 1rem;
    flex-direction: column;
    text-align: center;
    gap: 0.5rem;
  }
  
  header h1 {
    font-size: 1.3rem;
  }
  
  .start-date {
    font-size: 0.8rem;
  }
  
  .week-selector {
    padding: 1rem;
    gap: 0.5rem;
    flex-wrap: wrap;
  }
  
  #week-days {
    order: 1;
    width: 100%;
    justify-content: center;
    margin-top: 0.5rem;
  }
  
  .week-day {
    padding: 0.5rem 0.8rem;
    font-size: 0.9rem;
  }
  
  .calendar-input {
    margin: 0.5rem 0 0 0;
    width: 100%;
    order: 2;
  }
  
  .schedule-meta {
    padding: 1rem;
  }
  
  #schedule-title {
    font-size: 1.1rem;
  }
  
  .schedule-table th, 
  .schedule-table td {
    padding: 0.6rem;
    font-size: 0.9rem;
  }
  
  .version-buttons {
    padding: 1rem;
  }
  
  .version-buttons button {
    padding: 0.4rem 0.8rem;
    font-size: 0.9rem;
  }
}

@media (max-width: 480px) {
  .week-day {
    padding: 0.4rem 0.6rem;
    font-size: 0.8rem;
  }
  
  .schedule-table th, 
  .schedule-table td {
    padding: 0.4rem;
    font-size: 0.8rem;
  }
  
  .version-buttons {
    justify-content: center;
  }
  
  .version-buttons span {
    width: 100%;
    text-align: center;
    margin-bottom: 0.5rem;
  }
}

/* Обновленный CSS с улучшенной мобильной адаптацией */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --primary-color: #007acc;
  --primary-light: #e0f2ff;
  --primary-lighter: #b3d9ff;
  --text-color: #333;
  --text-light: #555;
  --white: #ffffff;
  --gray-light: #f0f0f0;
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  --mobile-padding: 0.8rem;
}

/* ... (остальные стили из предыдущего варианта остаются без изменений) ... */

/* Улучшенная мобильная адаптация */
@media (max-width: 768px) {
  :root {
    --mobile-padding: 0.6rem;
  }
  
  body {
    font-size: 14px;
  }
  
  header {
    padding: 0.8rem var(--mobile-padding);
    flex-direction: column;
    text-align: center;
    gap: 0.4rem;
  }
  
  header h1 {
    font-size: 1.2rem;
    line-height: 1.3;
  }
  
  .start-date {
    font-size: 0.75rem;
  }
  
  .week-selector {
    padding: 0.8rem var(--mobile-padding);
    gap: 0.5rem;
    flex-wrap: wrap;
    margin: 0.8rem auto;
    border-radius: 8px;
  }
  
  .week-arrow {
    padding: 0.3rem;
  }
  
  .week-arrow svg {
    width: 20px;
    height: 20px;
  }
  
  #week-days {
    order: 1;
    width: 100%;
    justify-content: space-between;
    margin-top: 0.5rem;
    gap: 0.3rem;
  }
  
  .week-day {
    padding: 0.4rem 0.5rem;
    font-size: 0.75rem;
    flex: 1;
    min-width: 0;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  
  .calendar-input {
    margin: 0.5rem 0 0 0;
    width: 100%;
    order: 2;
    padding: 0.5rem;
    font-size: 0.8rem;
  }
  
  .schedule-meta {
    padding: 0.8rem var(--mobile-padding);
    margin: 0.8rem auto;
    border-radius: 8px;
  }
  
  #schedule-title {
    font-size: 1rem;
    line-height: 1.4;
  }
  
  #last-updated, #ended-note {
    font-size: 0.75rem;
  }
  
  .table-container {
    padding: 0 var(--mobile-padding);
    margin-bottom: 1.5rem;
  }
  
  .schedule-table {
    font-size: 0.8rem;
    border-radius: 8px;
  }
  
  .schedule-table th, 
  .schedule-table td {
    padding: 0.5rem 0.3rem;
    line-height: 1.3;
  }
  
  .schedule-table th {
    font-size: 0.75rem;
    padding: 0.6rem 0.3rem;
  }
  
  .version-buttons {
    padding: 0.8rem var(--mobile-padding);
    margin: 0.8rem auto;
    border-radius: 8px;
    gap: 0.4rem;
  }
  
  .version-buttons span {
    width: 100%;
    text-align: center;
    margin-bottom: 0.4rem;
    font-size: 0.8rem;
  }
  
  .version-buttons button {
    padding: 0.3rem 0.6rem;
    font-size: 0.75rem;
    flex: 1;
    min-width: calc(50% - 0.4rem);
  }
}

@media (max-width: 480px) {
  :root {
    --mobile-padding: 0.5rem;
  }
  
  .week-day {
    font-size: 0.7rem;
    padding: 0.3rem 0.2rem;
  }
  
  .schedule-table {
    font-size: 0.75rem;
  }
  
  .schedule-table th {
    font-size: 0.7rem;
    padding: 0.5rem 0.2rem;
  }
  
  .schedule-table td {
    padding: 0.4rem 0.2rem;
  }
  
  .version-buttons button {
    min-width: 100%;
  }
}

/* Особые стили для очень узких экранов (например, iPhone 5/SE) */
@media (max-width: 320px) {
  header h1 {
    font-size: 1rem;
  }
  
  .week-day {
    font-size: 0.65rem;
  }
  
  .schedule-table {
    font-size: 0.7rem;
  }
  
  .schedule-table th {
    font-size: 0.65rem;
  }
}

/* Добавьте эти стили в раздел week-arrow */
.week-arrow[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
}

.week-arrow[disabled] svg path {
    stroke: #999 !important;
}





/* Красивый футер */
footer {
  margin-top: 2rem;
  position: relative;
}

.footer-container {
  background: var(--primary-color);
  color: white;
  padding-top: 20px;
  position: relative;
}

.footer-content {
  max-width: 1600px;
  margin: 0 auto;
  padding: 1.5rem 2rem;
  width: 100%;
}

.footer-content h3 {
  text-align: center;
  margin-bottom: 1.5rem;
  font-weight: 500;
  color: rgba(255,255,255,0.9);
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.footer-link {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(5px);
  padding: 1rem 1.5rem;
  border-radius: 12px;
  text-decoration: none;
  color: white;
  transition: all 0.3s ease;
  width: 280px;
  border: 1px solid rgba(255,255,255,0.2);
}

.footer-link:hover {
  background: rgba(255,255,255,0.2);
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.link-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.2);
  border-radius: 50%;
  flex-shrink: 0;
}

.link-icon svg {
  width: 24px;
  height: 24px;
}

.link-text {
  text-align: left;
}

.link-text span {
  display: block;
  font-weight: 500;
  margin-bottom: 0.2rem;
}

.link-text small {
  opacity: 0.8;
  font-size: 0.85rem;
}

/* Специальные цвета для ссылок */
.app-link .link-icon {
  background: rgba(0,122,204,0.3);
}
/* Адаптация */
@media (max-width: 768px) {
  .footer-content {
    padding: 1.5rem 1rem;
  }
  
  .footer-links {
    gap: 1rem;
  }
  
  .footer-link {
    width: 100%;
    max-width: 350px;
    padding: 1rem;
  }
}

@media (max-width: 480px) {
  .footer-link {
    flex-direction: column;
    text-align: center;
  }
  
  .link-text {
    text-align: center;
  }
}

/* Добавьте эти стили в начало файла, после body */
html, body {
  height: 100%;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh; /* Убедитесь, что body занимает всю высоту viewport */
}

main {
  flex: 1; /* Это заставит main занимать всё доступное пространство */
  padding-bottom: 2rem; /* Добавляем отступ снизу */
}

/* Обновите стили футера */
footer {
  margin-top: auto; /* Это переместит футер вниз */
  width: 100%;
}

.tg-link .link-icon {
  background: transparent !important; /* Убираем голубой фон */
  width: auto; /* Убираем фиксированную ширину */
  height: auto; /* Убираем фиксированную высоту */
  border-radius: 0; /* Убираем скругленные углы */
  display: flex;
  align-items: center;
  justify-content: center;
}

.tg-link .tg-icon {
  width: 48px;
  height: 48px;
  transition: transform 0.3s ease;
}

.tg-link:hover .tg-icon {
  transform: scale(1.1); /* Анимация при наведении */
}

/* Для мобильных устройств - горизонтальное расположение */
@media (max-width: 768px) {
  .footer-link {
    flex-direction: row; /* Располагаем элементы в строку */
    align-items: center;
    padding: 0.8rem 1rem; /* Уменьшаем отступы */
    height: auto;
    min-height: 60px; /* Фиксированная высота для всех кнопок */
  }
  
  .link-icon {
    margin-right: 1rem; /* Отступ между иконкой и текстом */
    margin-bottom: 0; /* Убираем отступ снизу */
    width: 36px; /* Фиксированная ширина иконки */
    height: 36px; /* Фиксированная высота иконки */
  }
  
  .link-text {
    text-align: left;
    flex-grow: 1; /* Текст занимает всё оставшееся пространство */
  }
  
  .link-text span {
    font-size: 0.9rem; /* Чуть уменьшаем размер текста */
  }
  
  .link-text small {
    font-size: 0.75rem; /* Чуть уменьшаем размер подписи */
  }
  
  /* Для очень маленьких экранов */
  @media (max-width: 480px) {
    .footer-link {
      padding: 0.6rem 0.8rem;
    }
    
    .link-icon {
      width: 32px;
      height: 32px;
      margin-right: 0.8rem;
    }
    
    .link-text span {
      font-size: 0.85rem;
    }
    
    .link-text small {
      font-size: 0.7rem;
    }
  }
}

/* Добавим в конец файла */
.pair-row {
    cursor: pointer;
    transition: all 0.2s ease;
}

.pair-row:hover {
    background-color: var(--primary-light) !important;
}

.pair-row.active-pair {
    background-color: var(--primary-lighter) !important;
    font-weight: 500;
}

.pair-time-row {
    transition: all 0.3s ease;
}

.pair-time-cell {
    padding: 1rem !important;
    background-color: var(--primary-light);
    white-space: pre-line;
    line-height: 1.5;
    font-size: 0.9em;
    color: var(--text-color);
    border-bottom: 1px solid var(--primary-lighter) !important;
}

/* Анимация появления */
@keyframes slideDown {
    from { 
        opacity: 0;
        transform: translateY(-10px);
    }
    to { 
        opacity: 1;
        transform: translateY(0);
    }
}

.pair-time-row[style*="table-row"] {
    animation: slideDown 0.3s ease-out forwards;
}

/* Кастомный календарь */
.calendar-button {
  background: var(--white);
  border: 1px solid var(--primary-color);
  color: var(--primary-color);
  padding: 0.6rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  margin-left: 1rem;
}

.calendar-button:hover {
  background: var(--primary-light);
  transform: translateY(-2px);
}

.calendar-button:active {
  transform: translateY(0);
}

/* Модальное окно календаря */
.calendar-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.calendar-modal-content {
  background: var(--white);
  border-radius: 16px;
  width: 90%;
  max-width: 580px; /* Увеличил ширину */
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  display: flex;
}

/* Боковая панель месяцев */
.calendar-months-sidebar {
  width: 170px; /* Ширина боковой панели */
  background: var(--primary-light);
  border-right: 1px solid var(--primary-lighter);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}

.months-scroll-container {
  padding: 0.8rem;
  overflow-y: auto;
  flex: 1;
  scrollbar-width: thin;
  scrollbar-color: var(--primary-color) var(--primary-light);
}

/* Стили для скроллбара */
.months-scroll-container::-webkit-scrollbar {
  width: 6px;
}

.months-scroll-container::-webkit-scrollbar-track {
  background: var(--primary-light);
  border-radius: 3px;
}

.months-scroll-container::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 3px;
}

.month-item {
  padding: 0.6rem 0.8rem;
  margin-bottom: 0.4rem;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s ease;
  text-align: left;
  border: 1px solid rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.8);
}

.month-item:hover {
  background: var(--white);
  transform: translateX(2px);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
  border-color: var(--primary-lighter);
}

.month-item.active {
  background: var(--primary-color);
  color: var(--white);
  border-color: var(--primary-color);
  transform: translateX(2px);
  box-shadow: 0 2px 6px rgba(0, 122, 204, 0.3);
}

.month-item.has-schedule {
  /* Убрали синюю полоску */
}

.month-item.no-schedule {
  opacity: 0.5;
  cursor: not-allowed;
  background: rgba(255, 255, 255, 0.4);
}

.month-item.no-schedule:hover {
  background: rgba(255, 255, 255, 0.4);
  transform: none;
  box-shadow: none;
  border-color: rgba(255, 255, 255, 0.5);
}

.month-year {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  opacity: 0.8;
  margin-bottom: 0.05rem;
}

.month-name {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
}

/* Основная область календаря - ТОЧНО КАК В ИСХОДНОЙ ВЕРСИИ */
.calendar-main-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0; /* Чтобы не вылазило за пределы */
}

.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.2rem;
  background: var(--primary-color);
  color: var(--white);
  flex-shrink: 0;
}

.calendar-header h3 {
  margin: 0;
  font-weight: 600;
  font-size: 1.2rem;
  text-align: center;
  flex-grow: 1;
  padding: 0 0.5rem;
}

.calendar-nav {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.calendar-nav:hover {
  background: rgba(255, 255, 255, 0.3);
}

.calendar-nav:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.calendar-days-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  padding: 0.8rem 0.5rem;
  background: var(--primary-light);
  border-bottom: 1px solid var(--primary-lighter);
  flex-shrink: 0;
}

.calendar-days-header div {
  text-align: center;
  font-weight: 500;
  color: var(--text-light);
  font-size: 0.9rem;
}

/* ВОТ ЭТО САМОЕ ВАЖНОЕ - ТОЧНО КАК В ИСХОДНОМ КАЛЕНДАРЕ */
.calendar-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  padding: 0.8rem;
  gap: 4px;
  flex: 1;
}

.calendar-day {
  /* УБРАЛ aspect-ratio: 1 ! */
  height: 40px; /* Фиксированная высота как в исходном */
  width: 100%; /* Занимает всю ширину ячейки */
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  font-size: 0.9rem;
}

.calendar-day:hover:not(.disabled):not(.empty) {
  background: var(--primary-light);
}

.calendar-day.today {
  border: 1px solid var(--primary-color);
  font-weight: 600;
}

.calendar-day.selected {
  background: var(--primary-color);
  color: var(--white);
}

.calendar-day.available {
  color: var(--text-color);
  cursor: pointer;
}

.calendar-day.available:hover {
  background: var(--primary-color);
  color: var(--white);
  transform: scale(1.05);
}

.calendar-day.unavailable {
  color: #ccc;
  cursor: not-allowed;
}

.calendar-day.other-month {
  color: #999;
}

.calendar-day.empty {
  cursor: default;
}

.calendar-footer {
  padding: 1rem;
  text-align: center;
  border-top: 1px solid #eee;
  flex-shrink: 0;
}

.calendar-today-btn {
  background: var(--primary-color);
  color: var(--white);
  border: none;
  padding: 0.6rem 1.5rem;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s ease;
}

.calendar-today-btn:hover {
  background: var(--primary-light);
  color: var(--primary-color);
  transform: translateY(-2px);
}

/* Мобильная адаптация календаря */
@media (max-width: 768px) {
  .calendar-button {
    margin-left: 0;
    margin-top: 0.5rem;
    order: 3;
    width: 100%;
  }
  
  .calendar-modal {
    padding: 0.5rem;
  }
  
  .calendar-modal-content {
    flex-direction: column;
    width: 95%;
    max-width: 400px; /* На мобильных возвращаем исходный размер */
    min-height: auto;
  }
  
  .calendar-months-sidebar {
    width: 100%;
    max-height: 100px;
    border-right: none;
    border-bottom: 1px solid var(--primary-lighter);
  }
  
  .months-scroll-container {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0.6rem;
    gap: 0.4rem;
    flex-wrap: nowrap;
  }
  
  .month-item {
    flex-shrink: 0;
    width: 85px;
    text-align: center;
    margin-bottom: 0;
    padding: 0.5rem 0.6rem;
  }
  
  .month-item:hover,
  .month-item.active {
    transform: translateY(-2px);
  }
  
  .month-name {
    font-size: 0.85rem;
  }
  
  .month-year {
    font-size: 0.7rem;
  }
  
  .calendar-main-area {
    min-height: auto;
  }
  
  .calendar-header {
    padding: 1rem;
  }
  
  .calendar-header h3 {
    font-size: 1.1rem;
  }
  
  .calendar-nav {
    width: 30px;
    height: 30px;
    font-size: 1.1rem;
  }
  
  .calendar-days-header,
  .calendar-days {
    padding: 0.6rem;
  }
  
  .calendar-day {
    height: 36px; /* Чуть меньше на мобильных */
    font-size: 0.9rem;
  }
  
  .calendar-footer {
    padding: 0.8rem;
  }
  
  .calendar-today-btn {
    padding: 0.5rem 1.2rem;
    font-size: 0.9rem;
  }
}

@media (max-width: 480px) {
  .calendar-modal-content {
    max-width: 350px;
  }
  
  .calendar-day {
    height: 32px; /* Еще меньше на маленьких экранах */
    font-size: 0.8rem;
  }
  
  .month-item {
    width: 75px;
    padding: 0.4rem 0.5rem;
  }
  
  .month-name {
    font-size: 0.8rem;
  }
  
  .month-year {
    font-size: 0.65rem;
  }
  
  .calendar-header {
    padding: 0.8rem;
  }
  
  .calendar-header h3 {
    font-size: 1rem;
  }
  
  .calendar-days-header div {
    font-size: 0.8rem;
  }
}

/* ВОТ ЭТО САМОЕ ВАЖНОЕ - ТОЧНО КАК В ИСХОДНОМ КАЛЕНДАРЕ */
.calendar-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  padding: 0.8rem;
  gap: 4px;
  flex: 1;
}

.calendar-day {
  height: 40px; /* Фиксированная высота как в исходном */
  width: 40px; /* Делаем ширину равной высоте для квадрата */
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  font-size: 0.9rem;
  margin: 0 auto; /* Центрируем квадрат в ячейке */
}

.calendar-day:hover:not(.disabled):not(.empty) {
  background: var(--primary-light);
}

.calendar-day.today {
  border: 1px solid var(--primary-color);
  font-weight: 600;
}

.calendar-day.selected {
  background: var(--primary-color);
  color: var(--white);
  /* УБЕРАЕМ transform: scale(1.05) чтобы не искажался квадрат */
}

.calendar-day.available {
  color: var(--text-color);
  cursor: pointer;
}

.calendar-day.available:hover {
  background: var(--primary-color);
  color: var(--white);
  /* transform: scale(1.05); - убрал чтобы сохранить квадрат */
}

.calendar-day.unavailable {
  color: #ccc;
  cursor: not-allowed;
}

.calendar-day.other-month {
  color: #999;
}

.calendar-day.empty {
  cursor: default;
  width: 40px; /* Чтобы пустые ячейки тоже были квадратными */
  height: 40px;
}

/* Адаптация для мобильных */
@media (max-width: 768px) {
  .calendar-days-header,
  .calendar-days {
    padding: 0.6rem;
  }
  
  .calendar-day {
    height: 36px; /* Чуть меньше на мобильных */
    width: 36px; /* Делаем квадрат */
  }
  
  .calendar-day.empty {
    height: 36px;
    width: 36px;
  }
}

@media (max-width: 480px) {
  .calendar-day {
    height: 32px; /* Еще меньше на маленьких экранах */
    width: 32px; /* Квадрат */
    font-size: 0.8rem;
  }
  
  .calendar-day.empty {
    height: 32px;
    width: 32px;
  }
}

/* ВОТ ЭТО САМОЕ ВАЖНОЕ - ТОЧНО КАК В ИСХОДНОМ КАЛЕНДАРЕ */
.calendar-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  padding: 0.8rem;
  gap: 4px;
  flex: 1;
}

.calendar-day {
  height: 44px; /* Увеличил на 4px */
  width: 44px; /* Увеличил на 4px - квадрат побольше */
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  font-size: 0.9rem;
  margin: 0 auto; /* Центрируем квадрат в ячейке */
}

.calendar-day:hover:not(.disabled):not(.empty) {
  background: var(--primary-light);
}

.calendar-day.today {
  border: 2px solid var(--primary-color); /* Чуть толще рамка */
  font-weight: 600;
}

.calendar-day.selected {
  background: var(--primary-color);
  color: var(--white);
  box-shadow: 0 2px 8px rgba(0, 122, 204, 0.4); /* Добавил тень для выделения */
}

.calendar-day.available {
  color: var(--text-color);
  cursor: pointer;
}

.calendar-day.available:hover {
  background: var(--primary-color);
  color: var(--white);
  transform: translateY(-1px); /* Легкий подъем вместо масштабирования */
  box-shadow: 0 2px 6px rgba(0, 122, 204, 0.3);
}

.calendar-day.unavailable {
  color: #ccc;
  cursor: not-allowed;
}

.calendar-day.other-month {
  color: #999;
}

.calendar-day.empty {
  cursor: default;
  width: 44px; /* Чтобы пустые ячейки тоже были квадратными */
  height: 44px;
  visibility: hidden; /* Скрываем полностью */
}

/* Адаптация для мобильных */
@media (max-width: 768px) {
  .calendar-days-header,
  .calendar-days {
    padding: 0.6rem;
  }
  
  .calendar-day {
    height: 40px; /* Чуть больше на мобильных */
    width: 40px; /* Квадрат */
  }
  
  .calendar-day.empty {
    height: 40px;
    width: 40px;
  }
}

@media (max-width: 480px) {
  .calendar-day {
    height: 36px; /* Сохраняем квадрат */
    width: 36px;
    font-size: 0.8rem;
  }
  
  .calendar-day.empty {
    height: 36px;
    width: 36px;
  }
}

/* Для очень маленьких экранов */
@media (max-width: 360px) {
  .calendar-day {
    height: 32px;
    width: 32px;
    font-size: 0.75rem;
    border-radius: 6px;
  }
  
  .calendar-day.empty {
    height: 32px;
    width: 32px;
  }
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  width: 100%;
}

.footer-link {
  flex: 1 0 300px; /* Базовый размер 220px, может расти, но не сжиматься */
  max-width: 340px;
  min-width: 220px;
  box-sizing: border-box;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  width: 100%;
}

footer {
  width: 100%;
  overflow: hidden; /* Или overflow-x: hidden */
}

.footer-container {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

