/* static/subjects_style.css */
/* Обновляем, используя стили из предоставленного style (7).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: 1rem 2rem; /* Измените с 1.5rem на 1rem как во втором файле */
  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;
}
.start-date {
  font-size: 0.9rem;
  opacity: 0.9;
}

/* Стили для селекторов */
.selector-container {
  background: var(--white);
  padding: 1.2rem;
  margin: 1rem auto;
  max-width: 95%;
  border-radius: 12px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: all 0.3s ease;
}

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

.date-input {
  padding: 0.6rem 1rem;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-family: 'Inter', sans-serif;
  transition: all 0.2s ease;
  width: 100%;
  cursor: pointer;
  background: var(--white);
  color: var(--text-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}


.period-selector {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
}

/* Даты — фикс */
.date-inputs {
  display: flex;
  gap: 0.8rem;
  flex: 0 0 auto;
}

/* Каждое поле даты */
.date-input-wrapper {
  width: 140px; /* можно 130–150 подобрать */
}

/* Кнопка семестра — растягивается */
#semester-button {
  flex: 1 1 auto;
  min-width: 0; /* КРИТИЧНО, иначе будет вылазить */
}

.date-input:after {
  content: '▼';
  font-size: 0.8rem;
  color: var(--text-light);
}

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

.selector-button {
  padding: 0.6rem 1rem;
  border: 1px solid #ccc;
  border-radius: 8px;
  background: var(--white);
  font-family: 'Inter', sans-serif;
  transition: all 0.2s ease;
  cursor: pointer;
  width: 100%;
  text-align: left;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-color);
}

.selector-button:after {
  content: '▼';
  font-size: 0.8rem;
  color: var(--text-light);
}

.selector-button:hover {
  background: var(--gray-light);
}

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

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

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

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

.modal-content {
  background: var(--white);
  border-radius: 12px;
  box-shadow: var(--shadow);
  max-width: 90%;
  max-height: 90%;
  overflow: auto;
  position: relative;
  display: flex;
}

.close-modal {
  position: absolute;
  top: 10px;
  right: 10px;
  cursor: pointer;
  font-size: 1.5rem;
  color: var(--text-light);
  transition: color 0.2s ease;
}

.close-modal:hover {
  color: var(--primary-color);
}

/* Для календаря - копируем полностью из style (7).css */
.calendar-modal-content {
  flex-direction: row;
  width: 800px;
  height: 500px;
}

.calendar-months-sidebar {
  width: 200px;
  background: var(--primary-light);
  border-right: 1px solid var(--primary-lighter);
  overflow-y: auto;
}

.month-item {
  padding: 0.8rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  background: transparent;
}

.month-item:hover {
  background: var(--primary-lighter);
}

.month-item.active {
  background: var(--primary-color);
  color: var(--white);
}

.month-name {
  font-weight: 600;
}

.month-year {
  font-size: 0.8rem;
  opacity: 0.8;
}

.calendar-main-area {
  flex: 1;
  display: flex;
  flex-direction: column;
}

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

.calendar-header h3 {
  margin: 0;
  font-weight: 600;
  font-size: 1.2rem;
}

.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;
  transition: background 0.2s ease;
}

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

.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);
}

.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 {
  height: 44px;
  width: 44px;
  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;
}

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

.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);
}

/* Адаптация календаря для мобильных из style (7).css */
@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;
  }
}

@media (max-width: 768px) {
  .calendar-modal-content {
    flex-direction: column;
    width: 95%;
    height: auto;
  }

  .calendar-months-sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--primary-lighter);
    max-height: 150px;
    overflow-y: hidden;
    overflow-x: auto;
  }

  .months-scroll-container {
    flex-direction: row;
    overflow-x: auto;
    padding: 0.6rem;
    gap: 0.4rem;
    white-space: nowrap;
  }

  .month-item {
    flex-shrink: 0;
    width: 85px;
    margin-bottom: 0;
    padding: 0.5rem 0.8rem;
  }

  .month-name {
    font-size: 0.9rem;
  }

  .month-year {
    font-size: 0.7rem;
  }

  .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;
  }
}

/* Для модалок семестров и предметов - делаем пошире и повыше */
.list-modal-content {
  flex-direction: column;
  width: 500px; /* Пошире */
  max-height: 500px; /* Повыше */
  padding: 1rem;
}

.list-header {
  padding: 1rem;
  border-bottom: 1px solid #eee;
  text-align: center;
  font-weight: 600;
  font-size: 1.2rem;
  color: var(--primary-color);
}

.list-items {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1rem;
  overflow-y: auto;
  max-height: 400px; /* Соответствует повышенной высоте */
}

.list-item {
  padding: 0.8rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  background: var(--gray-light);
  font-weight: 500;
}

.list-item:hover {
  background: var(--primary-light);
  transform: translateY(-2px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.list-item.selected {
  background: var(--primary-color);
  color: var(--white);
}

/* Мобильная адаптация для list модалок */
@media (max-width: 768px) {
  .list-modal-content {
    width: 95%;
    max-height: 80vh;
  }

  .list-items {
    max-height: 60vh;
  }
}

/* Остальные стили (schedule-meta, table-container и т.д.) */
.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);
}

#total-pairs {
  margin-top: 0.5rem;
  font-size: 1rem;
  color: var(--text-light);
  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;
}

@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) {
  .selector-container {
    padding: 1rem;
  }

  .period-selector {
    flex-direction: column;
    gap: 1rem;
  }

  .date-inputs {
    flex-direction: column;
    gap: 1rem;
  }

  .schedule-meta {
    padding: 1rem;
  }

  .schedule-table th, 
  .schedule-table td {
    padding: 0.6rem;
    font-size: 0.9rem;
  }
}










/* Кастомный календарь */
.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;
  }
}

.semester-modal-content,
.subject-modal-content {
  background: var(--white);
  border-radius: 12px;
  box-shadow: var(--shadow);
  width: 500px;
  max-height: 500px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Окно выбора предмета — больше */
.subject-modal-content {
  width: 750px;      /* шире */
  max-height: 600px; /* выше */
}


.period-selector {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
}

/* КНОПКА СЕМЕСТРА — растягивается */
.period-selector > .selector-button {
  flex: 1 1 auto;
  min-width: 0; /* КРИТИЧНО, чтобы не ломала flex */
}

/* ДАТЫ — фиксированные */
.date-inputs {
  display: flex;
  gap: 0.8rem;
  flex: 0 0 auto;
}

/* Каждое поле даты */
.date-input-wrapper {
  width: 140px; /* можешь поставить 130–150 */
}

/* Чтобы сами даты не вылезали */
.date-input {
  width: 100%;
  box-sizing: border-box;
}




.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.header-left h1 {
  margin: 0;
  font-weight: 600;
  font-size: 1.5rem;
  line-height: 1.2;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

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

.back-button {
  margin: 0;
}

.back-link {
  display: inline-block;
  background: var(--white);
  color: var(--primary-color);
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-weight: 500;
  transition: all 0.2s ease;
  border: 2px solid transparent;
  white-space: nowrap;
}

.back-link:hover {
  background: var(--primary-light);
  color: var(--text-color);
  border-color: var(--white);
  transform: translateY(-2px);
}


@media (max-width: 768px) {
  .header-container {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }
  
  .header-left h1 {
    font-size: 1.3rem;
    text-align: center;
  }
  
  .header-right {
    justify-content: space-between;
    gap: 1rem;
  }
  
  .start-date {
    font-size: 0.8rem;
  }
  
  .back-link {
    padding: 0.4rem 0.8rem;
    font-size: 0.9rem;
  }
}

@media (max-width: 480px) {
  .header-container {
    align-items: center;
  }
  
  .header-right {
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
  }
  
  .back-link {
    padding: 0.3rem 0.6rem;
    font-size: 0.85rem;
  }
}

@media (max-width: 360px) {
  .header-left h1 {
    font-size: 1.1rem;
  }
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.header-left h1 {
  margin: 0;
  font-weight: 600;
  font-size: 1.5rem;
  line-height: 1.2;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

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

.back-button {
  margin: 0;
}

.back-link {
  display: inline-block;
  background: var(--white);
  color: var(--primary-color);
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-weight: 500;
  transition: all 0.2s ease;
  border: 2px solid transparent;
  white-space: nowrap;
}

.back-link:hover {
  background: var(--primary-light);
  color: var(--text-color);
  border-color: var(--white);
  transform: translateY(-2px);
}

.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;
}

/* Медиа-запросы для мобильных устройств */
@media (max-width: 768px) {
  .header-container {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }
  
  .header-left h1 {
    font-size: 1.3rem;
    text-align: center;
  }
  
  .header-right {
    justify-content: space-between;
    gap: 1rem;
  }
  
  .start-date {
    font-size: 0.8rem;
  }
  
  .back-link {
    padding: 0.4rem 0.8rem;
    font-size: 0.9rem;
  }
}

@media (max-width: 480px) {
  .header-container {
    align-items: center;
  }
  
  .header-right {
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
  }
  
  .back-link {
    padding: 0.3rem 0.6rem;
    font-size: 0.85rem;
  }
}

@media (max-width: 360px) {
  .header-left h1 {
    font-size: 1.1rem;
  }
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.header-left h1 {
  margin: 0;
  font-weight: 600;
  font-size: 1.5rem;
  line-height: 1.2;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

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

.back-button {
  margin: 0;
}

.back-link {
  display: inline-block;
  background: var(--white);
  color: var(--primary-color);
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-weight: 500;
  transition: all 0.2s ease;
  border: 2px solid transparent;
  white-space: nowrap;
}

.back-link:hover {
  background: var(--primary-light);
  color: var(--text-color);
  border-color: var(--white);
  transform: translateY(-2px);
}

.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;
}





/* ============================= */
/* Планируемые (будущие) пары   */
/* ============================= */

.schedule-table tr.planned-pair td {
  background: rgba(0, 0, 0, 0.03); /* мягкий серый, не выбивается */
  color: #9aa0a6;                 /* нейтральный серый текст */
  font-style: italic;
}

/* убираем синий hover у будущих пар */
.schedule-table tr.planned-pair:hover td {
  background: rgba(0, 0, 0, 0.04);
}

/* номер пары делаем чуть заметнее */
.schedule-table tr.planned-pair td:first-child {
  color: #7f8790;
  font-weight: 500;
}
