/* ===========================
   ЗАГАЛЬНІ СТИЛІ
   =========================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: #333;
}

main {
  flex: 1;
  padding: 30px 15px;
}

/* ===========================
   ХЕДЕР
   =========================== */
.header {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  padding: 20px 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 15px;
}

.header-title {
  font-size: 28px;
  font-weight: 700;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0;
  white-space: nowrap;
}

.search-group {
  display: flex;
  gap: 10px;
  flex: 1;
  min-width: 300px;
  max-width: 500px;
}

.search-input {
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 14px;
  transition: all 0.3s ease;
}

.search-input:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
  outline: none;
}

.btn-load {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  border-radius: 12px;
  padding: 12px 28px;
  font-weight: 600;
  transition: all 0.3s ease;
  white-space: nowrap;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-load:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-load:active {
  transform: translateY(0);
}

/* ===========================
   ОСНОВНА ЧАСТИНА
   =========================== */
.main-content {
  max-width: 1400px;
  margin: 0 auto;
}

/* Статус завантаження */
.spinner-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  background: white;
  border-radius: 20px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.spinner-container .spinner-border {
  width: 60px;
  height: 60px;
}

.spinner-container p {
  font-size: 18px;
  color: #667eea;
  font-weight: 600;
}

/* Повідомлення про помилку */
.alert {
  border-radius: 12px;
  border: none;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  margin-bottom: 20px;
}

/* ===========================
   ВКЛАДКИ (TABS)
   =========================== */
.tabs-container {
  background: white;
  border-radius: 20px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  margin-bottom: 20px;
}

.tabs-header {
  display: flex;
  gap: 8px;
  padding: 12px;
  background: #f8f9fa;
  border-bottom: 2px solid #e0e0e0;
  overflow-x: auto;
  scroll-behavior: smooth;
}

.tabs-header::-webkit-scrollbar {
  height: 6px;
}

.tabs-header::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.tabs-header::-webkit-scrollbar-thumb {
  background: #667eea;
  border-radius: 3px;
}

.tab-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 10px 16px;
  background: white;
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
  flex-shrink: 0;
  min-width: 70px;
}

.tab-btn:hover {
  border-color: #667eea;
  background: #f0f4ff;
}

.tab-btn.active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-color: transparent;
  color: white;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.tab-day {
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tab-date {
  font-size: 11px;
  opacity: 0.7;
  font-weight: 500;
}

.tab-btn.active .tab-date {
  opacity: 0.9;
}

/* Контент вкладок */
.schedule-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
  min-height: 400px;
}
.event-card {
  background: white;
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  border-left: 5px solid #667eea;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.event-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.event-time {
  font-size: 13px;
  color: #999;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.event-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.event-subject {
  font-size: 15px;
  font-weight: 700;
  color: #333;
  line-height: 1.4;
  flex: 1;
}

/* Статуси */
.status-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
  flex-shrink: 0;
}

.status-badge.cancelled,
.status-badge.moved {
  background: #ffe5e5;
  color: #d32f2f;
}

.status-badge.postponed {
  background: #fff3e0;
  color: #f57c00;
}

.status-badge.online {
  background: #e3f2fd;
  color: #1976d2;
}

.status-badge.normal {
  background: #e8f5e9;
  color: #388e3c;
}

/* Роміщення */
.event-room {
  font-size: 13px;
  color: #666;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Викладач */
.event-teacher {
  font-size: 13px;
  color: #555;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}

/* Онлайн блок */
.event-online {
  display: flex;
  align-items: center;
  margin-top: 6px;
}

/* Кнопка "Підключитися онлайн" */
.online-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  text-decoration: none;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  transition: all 0.3s ease;
  text-align: center;
  border: none;
  cursor: pointer;
}

.online-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
  color: white;
  text-decoration: none;
}

.online-link::before {
  content: "🔗 ";
}

/* Порожній день */
.event-card.empty-day {
  background: #f5f5f5;
  border-left: none;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 80px;
  color: #999;
  font-style: italic;
  text-align: center;
  padding: 20px 12px;
}

/* ===========================
   ПОРОЖНІЙ СТАН
   =========================== */
.empty-state {
  background: white;
  border-radius: 20px;
  padding: 60px 30px;
  text-align: center;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.empty-icon {
  font-size: 80px;
  margin-bottom: 20px;
  animation: bounce 2s infinite;
}

.empty-state h3 {
  font-size: 24px;
  font-weight: 700;
  color: #333;
  margin-bottom: 10px;
}

.empty-state p {
  font-size: 16px;
  color: #999;
  margin: 0;
}

@keyframes bounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

/* ===========================
   ФУТЕР
   =========================== */
.footer {
  background: rgba(0, 0, 0, 0.1);
  color: white;
  text-align: center;
  padding: 20px;
  font-size: 14px;
  margin-top: auto;
}

/* ===========================
   АДАПТИВНІСТЬ (TABLET)
   =========================== */
@media (max-width: 1024px) {
  .header-content {
    flex-direction: column;
    align-items: stretch;
  }

  .header-title {
    font-size: 24px;
    text-align: center;
  }

  .search-group {
    flex-direction: column;
    min-width: 100%;
    max-width: 100%;
  }

  .search-input,
  .btn-load {
    width: 100%;
  }

  .tab-btn {
    min-width: 65px;
    padding: 8px 12px;
  }

  .tab-day {
    font-size: 12px;
  }

  .tab-date {
    font-size: 10px;
  }

  .schedule-content {
    min-height: 350px;
  }
}

/* ===========================
   АДАПТИВНІСТЬ (МОБІЛЬНІ)
   =========================== */
@media (max-width: 768px) {
  main {
    padding: 15px 10px;
  }

  .header {
    padding: 15px 0;
  }

  .header-title {
    font-size: 20px;
  }

  .tabs-header {
    gap: 6px;
    padding: 8px;
  }

  .tab-btn {
    min-width: 60px;
    padding: 8px 10px;
    gap: 2px;
  }

  .tab-day {
    font-size: 11px;
  }

  .tab-date {
    font-size: 9px;
  }

  .schedule-content {
    padding: 15px;
    min-height: 300px;
  }

  .event-card {
    padding: 12px;
    border-left-width: 4px;
    gap: 8px;
  }

  .event-subject {
    font-size: 14px;
  }

  .event-time {
    font-size: 12px;
  }

  /* Рядок для часу та типу предмету */
  .event-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  /* Бейдж типу предмету (наприклад: Wykład, Cw.) */
  .class-type-badge {
    font-size: 11px;
    font-weight: 700;
    color: #764ba2;
    background: #f0e6fc;
    padding: 3px 8px;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }

  .empty-state {
    padding: 40px 20px;
  }

  .empty-icon {
    font-size: 60px;
  }

  .empty-state h3 {
    font-size: 20px;
  }

  .empty-state p {
    font-size: 14px;
  }
}

/* ===========================
   АДАПТИВНІСТЬ (МАЛІ МОБІЛЬНІ)
   =========================== */
@media (max-width: 480px) {
  body {
    min-height: 100vh;
  }

  .header {
    padding: 12px 0;
  }

  .header-title {
    font-size: 18px;
  }

  .search-group {
    gap: 8px;
  }

  .tabs-header {
    gap: 4px;
    padding: 6px;
  }

  .tab-btn {
    min-width: 55px;
    padding: 6px 8px;
    font-size: 13px;
  }

  .tab-day {
    font-size: 10px;
  }

  .tab-date {
    font-size: 8px;
  }

  .schedule-content {
    padding: 12px;
    min-height: 250px;
  }

  .event-card {
    padding: 10px;
    gap: 6px;
  }

  .event-header {
    flex-direction: column;
    gap: 6px;
  }

  .status-badge {
    padding: 3px 8px;
    font-size: 10px;
  }

  .event-subject {
    font-size: 13px;
  }

  .event-time {
    font-size: 11px;
  }

  .event-room {
    font-size: 12px;
  }

  .event-teacher {
    font-size: 12px;
  }

  .online-link {
    padding: 6px 12px;
    font-size: 11px;
    width: 100%;
  }

  .empty-state {
    padding: 30px 15px;
  }

  .empty-icon {
    font-size: 50px;
    margin-bottom: 15px;
  }

  .empty-state h3 {
    font-size: 18px;
  }

  .empty-state p {
    font-size: 13px;
  }

  .footer {
    font-size: 12px;
    padding: 15px;
  }
}

/* ===========================
   АНІМАЦІЇ
   =========================== */
.fade-enter {
  animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.d-none {
  display: none !important;
}

/* Робимо так, щоб назва та бейдж вишиковувались в один рядок */
.event-subject {
  font-size: 15px;
  font-weight: 700;
  color: #333;
  line-height: 1.4;
  flex: 1;
  display: flex;
  align-items: center;
  flex-wrap: wrap; /* Якщо місця мало, бейдж перейде на новий рядок */
  gap: 8px;
}

/* Загальні стилі для нового бейджа */
.info-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

/* Зелений бейдж (за замовчуванням) */
.badge-green {
  background: #e8f5e9;
  color: #388e3c;
}

/* Червоний бейдж (скасовано / перенесено) */
.badge-red {
  background: #ffe5e5;
  color: #d32f2f;
}

/* Фіолетовий бейдж (онлайн / дистанційно) */
.badge-purple {
  background: #f0e6fc;
  color: #764ba2;
}

/* Видаліть старі стилі, якщо вони залишились, щоб не було конфліктів */
.event-top-row,
.class-type-badge {
  display: none;
}
