/* === ПЕРЕМЕННЫЕ === */
:root {
  --bg-start: #ff9f00;
  --bg-end: #ff4800;
  --text-color: #ffffff;
  --title-color: #ffffff;
  --block-bg: rgba(0, 0, 0, 0.4);
  --link-hover-color: #ffd080;
  --blue: #ff6f00;
  --light: #ffffff;
  --dark: #111111;
}

/* === ОСНОВНОЙ ФОН === */
html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  max-width: 100%;
  font-family: 'Inter', sans-serif;
  box-sizing: border-box;
  scroll-behavior: smooth;
  overflow-x: hidden;
  background: none;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -2;
  background: linear-gradient(135deg, var(--bg-start), var(--bg-end));
  background-size: 400% 400%;
  animation: bgShift 25s ease infinite;
  opacity: 1;
  transition: filter 0.6s ease;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background: transparent;
  pointer-events: none;
  transition: background 0.6s ease;
}

@keyframes bgShift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* === ТЕМЫ === */
body.day {
  background: linear-gradient(135deg, #ff9a3c, #ff6a00);
  color: var(--text-color);
}
body.day::before { filter: brightness(1.05) saturate(1.4); }
body.day::after { background: transparent; }

body.night {
  background: linear-gradient(135deg, #ff4e00, #b34700);
  color: var(--text-color);
}
body.night::before {
  background: rgba(0, 0, 0, 0.5);
  filter: brightness(0.4) saturate(0.9);
}
body.night::after { background: rgba(0, 0, 0, 0.5); }
body.night > * {
  position: relative;
  z-index: 1;
}

body.dark-theme,
.dark-theme body {
  background: radial-gradient(circle at center, #2a1100 0%, #100600 100%);
  color: var(--text-color);
}

/* === НАВИГАЦИЯ === */
.navbar {
  width: 100%;
  padding: 20px 40px;
  position: relative;
  top: 0;
  left: 0;
  z-index: 999;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  transition: background 0.3s ease, backdrop-filter 0.3s ease;
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.logo-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-img {
  max-height: 50px;
  height: auto;
  display: block;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.nav-links a {
  color: #fff;
  text-decoration: none;
  font-weight: 500;
  font-size: 15px;
  transition: color 0.3s ease;
}

.nav-links a:hover {
  color: var(--link-hover-color);
}

.nav-links a.active {
  font-weight: 700;
  border-bottom: 2px solid #fff;
}

/* === ПЕРЕКЛЮЧАТЕЛЬ ТЕМЫ === */
.theme-toggle-btn {
  background: none;
  border: 1px solid var(--text-color);
  padding: 4px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.theme-toggle-btn .icon {
  width: 24px;
  height: 24px;
  color: #fff;
  opacity: 0.4;
  transition: opacity 0.3s ease;
}

.sun-icon { display: block; }
.moon-icon { display: none; }
html.dark-theme .sun-icon  { display: none; }
html.dark-theme .moon-icon { display: block; }

/* === КНОПКА ЗАКАЗА === */
.btn-order {
  background: #ff5e00;
  color: #fff;
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.3s ease;
}
.btn-order:hover {
  background: #ff7700;
  color: #fff;
}

/* === МЕДИА === */
@media (max-width: 1024px) {
  .navbar {
    padding: 30px 24px;
  }

  .navbar .container,
  .nav-left {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
  }

  .nav-links {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
  }

  .logo-img {
    max-height: 48px;
  }

  .btn-order {
    margin-top: 8px;
    font-size: 14px;
    padding: 6px 14px;
  }

  .theme-toggle-btn {
    margin-top: 6px;
  }
}

@media (max-width: 768px) {
  body.stack-open .navbar {
    opacity: 0;
    filter: blur(8px);
    pointer-events: none;
    transition: opacity 0.5s ease;
  }
}

/* === ОСНОВНОЙ КОНТЕЙНЕР === */
.live-container {
  padding: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.live-title {
  font-size: 2rem;
  margin-bottom: 1.5rem;
  text-align: center;
}

.live-blocks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

/* === LIVE-КАРТОЧКА === */
.live-card {
  cursor: pointer;
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  background: linear-gradient(to right, rgba(180, 60, 0, 0.9), rgba(120, 40, 0, 0.9));
  transition: transform 0.3s ease;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 240px;
}
.live-card:hover {
  transform: scale(1.03);
}
.live-card img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
}
.live-label {
  position: absolute;
  bottom: 0;
  left: 0;
  top: 1%;
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  font-weight: bold;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.live-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: red;
  color: white;
  padding: 0.3rem 0.6rem;
  font-size: 0.75rem;
  font-weight: bold;
  border-radius: 4px;
  display: none;
}
.live-badge.live {
  display: inline-block;
}

/* === МОДАЛЬНОЕ ОКНО === */
.live-modal {
  position: fixed;
  top: 5%;
  bottom: 5%;
  left: 50%;
  transform: translateX(-50%) scale(0.95);
  width: 90%;
  max-width: 800px;
  background: rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--dark);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  opacity: 0;
  pointer-events: none;
  z-index: 1001;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.live-modal.open {
  opacity: 1;
  transform: translateX(-50%) scale(1);
  pointer-events: auto;
}
.live-modal-inner {
  padding: 1.5rem;
  flex: 1;
  overflow-y: auto;
}
.live-modal-inner::-webkit-scrollbar {
  width: 8px;
}
.live-modal-inner::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 4px;
}
body.dark-theme .live-modal-inner::-webkit-scrollbar-thumb {
  background: #555;
}
.live-modal::before {
  content: '';
  width: 40px;
  height: 4px;
  background: #ccc;
  border-radius: 2px;
  display: block;
  margin: 10px auto;
}
body.dark-theme .live-modal::before {
  background: #666;
}

.close-modal {
  position: absolute;
  top: 0.5rem;
  right: 0.8rem;
  background: none;
  border: none;
  font-size: 2rem;
  cursor: pointer;
  color: #888;
}

/* === ТАБЫ === */
.hall-tabs, .day-tabs, .lang-tabs {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.hall-tab, .day-tab, .lang-btn {
  background: #eee;
  border: none;
  padding: 0.6rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  transition: background 0.3s ease, color 0.3s ease, transform 0.2s ease;
}
.hall-tab:hover,
.day-tab:hover,
.lang-btn:hover {
  transform: scale(1.05);
}
.hall-tab.active,
.day-tab.active,
.lang-btn.active {
  background: var(--blue);
  color: #fff;
}
.hall-tab:focus,
.day-tab:focus,
.lang-btn:focus,
.live-card[role="button"]:focus {
  outline: 2px solid var(--blue);
  outline-offset: 4px;
}

/* === ВНУТРЕННИЕ КАРТОЧКИ === */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
}

.video-search-input {
  width: 100%;
  font-size: 1rem;
  padding: 1.5rem .8rem;
  border-radius: 6px;
  border: 1px solid #ccc;
  box-sizing: border-box;
  display: block;
}

.video-grid-header {
  margin-bottom: 2rem !important;
}

.video-grid {
  margin-top: 0 !important;
}
.inner-card {
  cursor: pointer;
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  transition: transform 0.2s ease;
  text-align: center;
}
.inner-card:hover {
  transform: scale(1.03);
}
.inner-card img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
}
.inner-card span {
  padding: 0.5rem;
  font-size: 0.9rem;
  color: #333;
}
.inner-card.active {
  border: 2px solid #007bff;
}

/* === МЕТАДАННЫЕ === */
.modal-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  color: #555;
  margin-bottom: 1rem;
}

/* === ПЛЕЕР === */
.player-wrapper {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  margin-bottom: 1rem;
}
.player-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 12px;
}

#modalTitle {
  margin: 1rem 0 0.5rem;
  font-size: 1.3rem;
  text-align: center;
}

/* === ССЫЛКИ В МОДАЛКЕ === */
.modal-links a {
  display: inline-block;
  margin: 0.4rem;
  padding: 0.6rem 1.2rem;
  background: #ff6f00;
  color: #444;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  transition: background 0.3s ease;
}
.modal-links a:hover {
  background: #cc5200;
}
.modal-links a.active {
  background: #b34700;
  color: #444;
}

/* === FEATURED LIVE === */
.featured-live {
  max-width: 1000px;
  margin: 2rem auto;
  padding: 1rem;
  text-align: center;
}
.featured-live-title {
  font-size: 2rem;
  font-weight: bold;
  color: var(--light);
  margin-bottom: 1rem;
  text-transform: uppercase;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}
.featured-live-player {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
}
.featured-live-player iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* === OVERLAY === */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}
.overlay.show {
  opacity: 1;
  visibility: visible;
}

/* === ТЁМНАЯ ТЕМА ДОП === */
body.dark-theme .live-card {
  background: #1a1a1a;
  box-shadow: 0 8px 16px rgba(255, 255, 255, 0.05);
}
body.dark-theme .live-label {
  background: rgba(255, 255, 255, 0.15);
}
body.dark-theme .live-modal {
  background: linear-gradient(135deg, #1e1e1e, #2a2a2a);
  color: #eee;
}
body.dark-theme .modal-links a {
  background: #0d6efd;
}
body.dark-theme .modal-links a:hover {
  background: #084298;
}
body.dark-theme .inner-card {
  background: #1e1e1e;
}
body.dark-theme .inner-card span {
  color: #eee;
}
.dark-theme .btn-order {
  background: #333;
  color: #fff;
}
.dark-theme .btn-order:hover {
  background: #555;
}
