/* Модальное окно расписания */
.schedule-modal {
    display: none !important;
    position: fixed !important;
    z-index: 99999 !important;
    left: 0 !important;
    top: 0 !important;
    width: 100% !important;
    height: 100% !important;
    min-width: 100vw !important;
    min-height: 100vh !important;
    background-color: rgba(0, 0, 0, 0.9) !important;
    backdrop-filter: blur(10px) !important;
    animation: fadeIn 0.3s ease;
    pointer-events: auto !important;
    visibility: hidden !important;
    opacity: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: auto !important;
}

.schedule-modal[data-open="true"],
.schedule-modal[style*="display: block"] {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.schedule-content {
    position: relative;
    margin: 2% auto;
    width: 90%;
    max-width: 1000px;
    background: linear-gradient(135deg, #6e48aa, #9d50bb);
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    animation: slideInUp 0.4s ease;
}

@keyframes slideInUp {
  from {
    transform: translateY(50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.schedule-header {
  padding: 20px;
  background: rgba(0, 0, 0, 0.3);
  text-align: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.schedule-header h2 {
  margin: 0;
  color: white;
  font-size: 2em;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.schedule-close {
  position: absolute;
  top: 15px;
  right: 20px;
  background: none;
  border: none;
  color: white;
  font-size: 30px;
  cursor: pointer;
  transition: color 0.3s ease;
}

.schedule-close:hover {
  color: #ffdd59;
}

/* Вкладки дней недели */
.schedule-tabs {
  display: flex;
  background: rgba(0, 0, 0, 0.4);
  padding: 0 20px;
  flex-wrap: wrap;
  justify-content: center;
}

.tab-btn {
  flex: 1;
  min-width: 120px;
  padding: 15px 10px;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.tab-btn::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 3px;
  background: #ffdd59;
  transition: all 0.3s ease;
  transform: translateX(-50%);
}

.tab-btn:hover {
  color: white;
  background: rgba(255, 255, 255, 0.1);
}

.tab-btn.active {
  color: #ffdd59;
}

.tab-btn.active::before {
  width: 80%;
}

/* Контент вкладок */
.schedule-body {
  padding: 30px;
  min-height: 500px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tab-content {
  display: none;
  width: 100%;
  text-align: center;
  animation: fadeInScale 0.4s ease;
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.tab-content.active {
  display: block;
}

.schedule-image {
  max-width: 100%;
  max-height: 600px;
  border-radius: 15px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  border: 3px solid rgba(255, 255, 255, 0.1);
  transition: transform 0.3s ease;
}

.schedule-image:hover {
  transform: scale(1.02);
}

.schedule-loading {
  color: white;
  font-size: 18px;
  text-align: center;
  padding: 40px;
}

.schedule-error {
  color: #ff6b6b;
  text-align: center;
  padding: 40px;
  font-size: 16px;
}

.schedule-error .retry-btn {
  margin-top: 15px;
  padding: 10px 20px;
  background: #ff6b6b;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.3s ease;
}

.schedule-error .retry-btn:hover {
  background: #ff5252;
}

/* Навигационные стрелки */
.schedule-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
}

.nav-btn {
  padding: 12px 20px;
  border: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.2);
  color: white;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: bold;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
}

.nav-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.nav-btn:disabled:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: none;
}

.day-indicator {
  color: white;
  font-weight: bold;
  font-size: 16px;
  background: rgba(0, 0, 0, 0.3);
  padding: 10px 20px;
  border-radius: 20px;
}

/* Адаптивность */
@media (max-width: 768px) {
  .schedule-content {
    margin: 5% auto;
    width: 95%;
  }
  
  .schedule-tabs {
    padding: 0 10px;
  }
  
  .tab-btn {
    min-width: 100px;
    padding: 12px 5px;
    font-size: 14px;
  }
  
  .schedule-body {
    padding: 20px;
    min-height: 400px;
  }
  
  .schedule-image {
    max-height: 400px;
  }
  
  .nav-btn {
    padding: 10px 15px;
    font-size: 14px;
  }
  
  .schedule-header h2 {
    font-size: 1.5em;
  }
}

@media (max-width: 480px) {
  .schedule-tabs {
    flex-direction: column;
  }
  
  .tab-btn {
    min-width: auto;
    padding: 12px;
  }
  
  .schedule-image {
    max-height: 300px;
  }
  
  .schedule-nav {
    flex-direction: column;
    gap: 10px;
  }
  
  .nav-btn {
    width: 100%;
    justify-content: center;
  }
}

/* Анимации переключения вкладок */
.tab-content.leaving {
  animation: fadeOutScale 0.3s ease forwards;
}

@keyframes fadeOutScale {
  from {
    opacity: 1;
    transform: scale(1);
  }
  to {
    opacity: 0;
    transform: scale(0.9);
  }
}

/* Индикатор загрузки */
.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-left: 4px solid #ffdd59;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ✅ Подсветка текущего урока — ярко, плавно, с анимацией */
.schedule-table tr.current-lesson {
    background: linear-gradient(90deg, #8a5fd5, #6e48aa);
    color: white !important;
    font-weight: bold;
    border-left: 4px solid #fff;
    animation: pulse 1.5s infinite alternate;
}

@keyframes pulse {
    from { opacity: 0.9; }
    to { opacity: 1; }
}

/* ✅ Плавная анимация при наведении */
.schedule-table tr:hover {
    background: #e6e6ff;
    transform: scale(1.005);
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(110, 72, 170, 0.15);
}