/* Сброс стилей и базовые настройки */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: Arial, sans-serif;
}

body {
  background: #333;
  color: #e0e0e0;
  padding-bottom: 60px; /* чтобы контент не скрывался футером */
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: background-color 0.3s, color 0.3s;
  padding-top: 60px; /* отступ для фиксированного header */
}

/* Плавный переход для основных блоков */
header,
#mainPage,
#scheduleView,
.card,
footer {
  transition: background-color 0.3s, color 0.3s, border-color 0.3s;
}

/* Фиксированная шапка */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: #2a2a2a;
  padding: 0 20px;
  width: 100%;
  z-index: 1000;
}

/* Название группы в левом верхнем углу */
.group-name a {
  text-decoration: none;
  color: #fff;
  font-weight: bold;
  font-size: 1.2rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  display: block;
}

/* Блок для кнопок в header */
.header-buttons {
  display: flex;
  gap: 10px;
}

@media (max-width: 480px) {
  header {
    padding: 0 10px;
  }
  
  .group-name a {
    font-size: 1rem;
  }
  
  .header-buttons {
    flex-shrink: 0;
  }
  
  #toggleScheduleBtn {
    padding: 8px 10px;
    font-size: 0.9rem;
  }
}

/* Кнопки */
button {
  cursor: pointer;
  border: none;
  border-radius: 4px;
  background-color: #212121;
  color: #fff;
  padding: 10px 20px;
  transition: background-color 0.3s;
}

button:hover {
  background-color: #3c3c3c;
}

/* Блок "главной страницы" для выбора группы и недели */
#mainPage {
  max-width: 400px;
  width: 100%;
  margin: 20px auto;
  padding: 20px;
  border: 1px solid #646464;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(255, 255, 255, 0.1);
  text-align: center;
  background: #333333;
}

#mainPage h2 {
  margin-bottom: 10px;
}

#mainPage select,
#mainPage button {
  margin-bottom: 20px;
  width: 100%;
  padding: 8px;
  font-size: 1rem;
  background-color: #212121;
  color: #fff;
  border: 1px solid #646464;
}

/* Контейнер для расписания */
#scheduleView {
  max-width: 800px;
  width: 100%;
  margin: 20px auto;
  padding: 0 20px 60px;
  background: #333;
}

/* Заголовок даты или "Следующая пара:" / "Текущая пара:" */
#dateContainer {
  text-align: center;
  font-size: 1.2rem;
  margin: 20px 0;
  font-weight: bold;
}

/* Новый стиль для заголовков "Текущая пара:" и "Следующая пара:" */
.schedule-heading {
  text-align: center;
  font-size: 1.4rem;
  margin: 20px 0;
  font-weight: bold;
}

/* Контейнер с карточками */
.container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Карточки занятий */
.card {
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border: none;
  color: #e0e0e0; /* Основной цвет текста */
  background-size: cover;
  background-repeat: no-repeat;
  background-color: #444;
}

/* Прошедшие пары */
.card.past-pair {
  opacity: 0.65;
  position: relative;
}

.card.past-pair::after {
  content: "";
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 0.8rem;
  color: #aaa;
  font-style: italic;
}

/* Текущая активная пара */
.card.current-active-pair {
  border: 2px solid #6d8ecc;
  position: relative;
}

.card.current-active-pair::after {
  content: "сейчас";
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 0.8rem;
  color: #6d8ecc;
  font-weight: bold;
  background: rgba(109, 142, 204, 0.2);
  padding: 2px 6px;
  border-radius: 3px;
}

/* Вывод порядкового номера пары */
.card .order {
  font-weight: bold;
  margin-right: 10px;
  color: #bbb;
}

/* Особый стиль для карточек "Внеучебное мероприятие" */
.card.non-academic {
  color: #e0e0e0;
}
.card.non-academic .teacher,
.card.non-academic .details > div:last-child {
  font-weight: bold;
  color: #e0e0e0;
}

/* Заголовок внутри карточки */
.card-header .time,
.time {
  font-size: 1.2rem;
  font-weight: bold;
  margin-bottom: 5px;
}

/* Название дисциплины */
.discipline {
  font-size: 1.1rem;
  margin-bottom: 5px;
}

/* Блок с деталями: преподаватель, аудитория и т.д. */
.details {
  display: flex;
  justify-content: space-between;
  font-size: 0.95rem;
  font-weight: bold;
  color: #e0e0e0;
}

.badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 4px;
  background: #4C4B4B;
  font-weight: normal;
  color: #ccc;
  font-size: 0.9em;
}

/* Состояние для "Следующая пара" */
body.next-pair {
  background-color: #3c3c3c;
}

/* Футер */
footer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: #2a2a2a;
  padding: 10px;
  text-align: center;
  font-size: 0.9em;
  color: #ccc;
  z-index: 5000;
}
