/* ==============  base.css  (общие стили всего mini‑app) ============== */
:root {
  --header-bg: #e53935;
  --accent: #d32f2f;
  --inactive: rgba(255, 255, 255, 0.6);
  --header-h: 64px;
  --nav-h: 64px;
  --radius: 16px;
}

/* базовое обнуление */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* -------------------- каркас -------------------- */
body {
  font-family: "Inter", sans-serif;
  background: #fff;
  overflow: hidden;
  min-height: 100vh;
  background-color: #f7f7f7;
  color: #333;
}

/* ────────── фикс‑шапка ────────── */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 110;
  height: var(--header-h);
  display: flex;
  align-items: center;
  padding: 0 12px;
  background: var(--header-bg);
  color: #fff;
  border-radius: 0 0 var(--radius) var(--radius);
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
}

.logo {
  height: 24px;
  margin: 0 8px 0 4px;
  object-fit: contain;
}

.user-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  overflow: hidden;
  margin-right: 12px;
}

.name {
  font-size: 16px;
  font-weight: 400;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.uid {
  font-size: 10px;
  color: #ffdede;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
}

/* ────────── прокручиваемый контент ────────── */
.content {
  position: fixed;
  top: var(--header-h);
  left: 0;
  right: 0;
  bottom: calc(var(--nav-h) + 24px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 24px 16px;
  background: #f9f9f9;
  animation: fadeUp 0.25s ease;
}
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ────────── фикс‑навигация (нижняя) ────────── */
.nav-bar {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  padding: 0 8px;
  background: var(--header-bg);
  border-radius: var(--radius);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
  overflow: hidden;
}

.nav-btn {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  background: none;
  border: none;
  padding: 8px 0;
  opacity: var(--inactive);
  transition: opacity 0.2s;
}

.nav-btn.active {
  opacity: 1;
}

.nav-icon {
  width: 24px;
  height: 24px;
}

/* белый «ползунок»‑индикатор */
.nav-indicator {
  position: absolute;
  top: 4px;
  bottom: 4px;
  background: #fff;
  border-radius: var(--radius);
  transition: left 0.25s ease, width 0.25s ease;
  z-index: -1;
}

/* ────────── белая подложка под nav ────────── */
body::after {
  content: "";
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: calc(var(--nav-h) + 24px);
  background: #fff;
  z-index: 90;
}

/* ====== профиль ====== */
.profile-page {
  padding-bottom: 40px;
}
.profile-card {
  display: flex;
  gap: 14px;
  align-items: center;
  background: #fff;
  padding: 14px 16px;
  border-radius: var(--radius);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  margin-bottom: 16px;
}
.profile-card img {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  object-fit: cover;
}
.profile-card p {
  margin: 4px 0;
  font-size: 14px;
  line-height: 1.3;
}
.profile-card strong {
  color: var(--accent);
}
#pr-form {
  display: grid;
  gap: 16px;
}
#pr-form select {
  height: 40px;
  padding: 0 10px;
  border: 2px solid #ddd;
  border-radius: 12px;
  font-family: inherit;
  font-size: 14px;
  transition: border 0.2s;
}
#pr-form select:focus {
  outline: none;
  border-color: var(--header-bg);
}
.pr-save {
  height: 44px;
  background: var(--header-bg);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.25s;
}
.pr-save:hover {
  background: var(--accent);
}

/* анимации расписания */
.day,
.schedule-item {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.3s, transform 0.3s;
}
.day.show,
.schedule-item.show {
  opacity: 1;
  transform: none;
}

.loader {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(255,255,255,0.95);
  border-radius: 12px;
  padding: 24px 36px;
  font-size: 1.2em;
  color: #333;
  box-shadow: 0 2px 16px rgba(0,0,0,0.08);
  z-index: 1000;
  animation: fadeIn 0.3s;
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ====== расписание ====== */
.schedule-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  padding: 12px 16px;
  border-radius: var(--radius);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  margin-bottom: 16px;
  width: 100%;
  box-sizing: border-box;
}

.schedule-nav button {
  background: none;
  border: none;
  font-size: 18px;
  color: var(--header-bg);
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: background 0.2s;
}

.schedule-nav button:hover {
  background: rgba(229, 57, 53, 0.1);
}

.schedule-date {
  font-weight: 600;
  color: #333;
  font-size: 14px;
}

.schedule-group-title {
  font-size: 18px;
  font-weight: 600;
  color: #333;
  margin-bottom: 16px;
  text-align: center;
}

.schedule-list {
  list-style: none;
  padding: 0;
  margin: 0;
  width: 100%;
}

/* Убираем дублирующие стили, так как теперь используем .day-container */

.schedule-item {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid #f0f0f0;
  background: #fff;
  width: 100%;
  box-sizing: border-box;
}

.schedule-item:last-child {
  border-bottom: none;
}

.schedule-item .time {
  flex-shrink: 0;
  width: 55px;
  font-weight: 600;
  color: var(--header-bg);
  font-size: 14px;
  line-height: 1.4;
  text-align: center;
  font-family: Arial, sans-serif;
  letter-spacing: 0.2px;
}

.schedule-item .info {
  flex: 1;
  margin-left: 8px;
}

.schedule-item .subject {
  font-weight: 600;
  color: #333;
  margin-bottom: 4px;
  font-size: 16px;
  line-height: 1.3;
}

.schedule-item .details {
  color: #666;
  font-size: 13px;
  line-height: 1.4;
}

.empty-message {
  text-align: center;
  color: #666;
  padding: 40px 20px;
  font-size: 16px;
}

/* Контейнер для дней */
.day-container {
  width: 100%;
  margin-bottom: 16px;
  box-sizing: border-box;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

/* Анимации появления */
.day,
.schedule-item {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.day.show,
.schedule-item.show {
  opacity: 1;
  transform: translateY(0);
}

/* Стили для заголовков дней */
.day {
  background: #bbbbbb;
  color: #fff;
  padding: 12px 16px;
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  border-radius: var(--radius) var(--radius) 0 0;
  width: 100%;
  box-sizing: border-box;
}

.highlight-today {
  background: linear-gradient(135deg, var(--header-bg) 0%, var(--accent) 100%);
  color: #fff;
  padding: 12px 16px;
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  border-radius: var(--radius) var(--radius) 0 0;
  width: 100%;
  box-sizing: border-box;
}

/* Навигация по неделям */
.schedule-nav-arrows {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  padding: 12px 16px;
  border-radius: var(--radius);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  margin-bottom: 16px;
  width: 100%;
  box-sizing: border-box;
}

.arrow-btn {
  background: none;
  border: none;
  font-size: 20px;
  color: var(--header-bg);
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 8px;
  transition: all 0.2s ease;
  font-weight: bold;
}

.arrow-btn:hover {
  background: rgba(229, 57, 53, 0.1);
  transform: scale(1.1);
}

.schedule-nav-arrows .schedule-date {
  font-weight: 600;
  color: #333;
  font-size: 14px;
  text-align: center;
  flex: 1;
  margin: 0 16px;
}

/* Время в левой части */
.left-time {
  font-family: Arial, sans-serif;
  color: var(--header-bg);
  font-weight: bold;
  font-size: 14px;
  line-height: 1.4;
  text-align: center;
  width: 55px;
  flex-shrink: 0;
  letter-spacing: 0.2px;
}
