/* ═══════════════════════════════════════════════════════
   ULYTAU.TV — Главные стили
   Телеканал Улытауской области, Казахстан
   ═══════════════════════════════════════════════════════ */

:root {
  /* Цвета телеканала */
  --primary: #1a1f6e;       /* Тёмно-синий (основной) */
  --primary-light: #2a35c9;
  --secondary: #e8251f;     /* Красный (акцент) */
  --secondary-light: #ff4040;
  --gold: #d4a01a;          /* Золото */
  --dark: #0d0e1a;
  --dark-2: #1a1b2e;
  --gray-100: #f8f9fa;
  --gray-200: #e9ecef;
  --gray-300: #dee2e6;
  --gray-600: #6c757d;
  --gray-800: #343a40;
  --white: #ffffff;
  --text: #1a1a2e;
  --text-muted: #6c757d;

  /* Live badge */
  --live-red: #ff0000;

  /* Шрифты */
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-heading: 'Merriweather', Georgia, serif;

  /* Размеры */
  --container-max: 1280px;
  --header-height: 120px;
  --nav-height: 50px;
  --border-radius: 8px;
  --border-radius-lg: 16px;

  /* Тени */
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.12);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.18);

  /* Переходы */
  --transition: 0.2s ease;
}

/* ─── СБРОС ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: var(--font-main); color: var(--text); background: #fff; line-height: 1.6; overflow-x: hidden; }
a { color: inherit; text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--secondary); }
img { max-width: 100%; height: auto; display: block; }
ul { list-style: none; }

/* ─── КОНТЕЙНЕР ─────────────────────────────────────── */
.container { max-width: var(--container-max); margin: 0 auto; padding: 0 20px; }

/* ─── БЕГУЩАЯ СТРОКА ────────────────────────────────── */
.breaking-ticker {
  background: var(--secondary);
  color: var(--white);
  height: 36px;
  display: flex;
  align-items: center;
  overflow: hidden;
}
.ticker-label {
  background: var(--dark);
  padding: 0 16px;
  height: 100%;
  display: flex;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  white-space: nowrap;
  gap: 6px;
  flex-shrink: 0;
}
.ticker-wrapper { flex: 1; overflow: hidden; }
.ticker-content {
  display: flex;
  animation: ticker-scroll 40s linear infinite;
  white-space: nowrap;
}
.ticker-item {
  padding: 0 40px;
  font-size: 13px;
  font-weight: 500;
}
.ticker-item a { color: #fff; }
@keyframes ticker-scroll {
  0% { transform: translateX(100vw); }
  100% { transform: translateX(-100%); }
}

/* ─── ШАПКА ─────────────────────────────────────────── */
.site-header { background: var(--white); box-shadow: var(--shadow); position: sticky; top: 0; z-index: 1000; }
.header-top { background: var(--dark-2); color: rgba(255,255,255,0.8); font-size: 12px; }
.header-top-inner { display: flex; align-items: center; gap: 20px; height: 38px; }
.header-datetime { display: flex; align-items: center; gap: 8px; }
.time-display { font-weight: 600; color: var(--gold); }
.timezone { opacity: 0.6; font-size: 11px; }

.language-switcher { display: flex; gap: 4px; }
.lang-btn {
  background: none; border: 1px solid rgba(255,255,255,0.3);
  color: rgba(255,255,255,0.7); padding: 2px 8px; border-radius: 4px;
  cursor: pointer; font-size: 11px; font-weight: 600; letter-spacing: 0.5px;
  transition: all var(--transition);
}
.lang-btn.active, .lang-btn:hover { background: var(--primary); border-color: var(--primary); color: #fff; }

.header-social { display: flex; gap: 12px; margin-left: auto; }
.header-social a { color: rgba(255,255,255,0.6); font-size: 14px; transition: color var(--transition); }
.header-social a:hover { color: #fff; }

.btn-login {
  background: var(--secondary); color: #fff !important;
  padding: 4px 14px; border-radius: 4px; font-size: 12px;
  display: flex; align-items: center; gap: 6px;
}

/* Главная строка шапки */
.header-main { padding: 12px 0; }
.header-main-inner { display: flex; align-items: center; gap: 20px; }

/* Логотип */
.site-logo { display: flex; align-items: center; }
.logo-text { font-size: 28px; font-weight: 900; color: var(--primary); letter-spacing: -1px; }
.logo-u { color: var(--secondary); }
.logo-tv { color: var(--gold); font-size: 22px; }
.logo-img { height: 52px; width: auto; }

/* LIVE badge */
.live-badge {
  display: flex; align-items: center; gap: 8px;
  background: var(--gray-200); color: var(--gray-600);
  padding: 6px 14px; border-radius: 20px;
  font-size: 12px; font-weight: 700; letter-spacing: 1px;
  transition: all var(--transition);
}
.live-badge.is-live {
  background: var(--live-red); color: var(--white);
  animation: pulse-border 2s infinite;
}
.live-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: currentColor; flex-shrink: 0;
}
.live-badge.is-live .live-dot { animation: pulse 1.5s infinite; }
@keyframes pulse { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:0.5;transform:scale(1.3)} }
@keyframes pulse-border { 0%,100%{box-shadow:0 0 0 0 rgba(255,0,0,0.4)} 70%{box-shadow:0 0 0 8px rgba(255,0,0,0)} }
.viewer-count { font-size: 11px; opacity: 0.9; display: flex; align-items: center; gap: 4px; }

/* Поиск */
.header-search { flex: 1; max-width: 400px; margin-left: auto; }
.header-search form { display: flex; border: 2px solid var(--gray-300); border-radius: 25px; overflow: hidden; transition: border-color var(--transition); }
.header-search form:focus-within { border-color: var(--primary); }
.header-search input { flex: 1; border: none; outline: none; padding: 8px 16px; font-size: 14px; font-family: inherit; }
.header-search button { background: var(--primary); color: #fff; border: none; padding: 8px 16px; cursor: pointer; transition: background var(--transition); }
.header-search button:hover { background: var(--primary-light); }

/* ─── НАВИГАЦИЯ ──────────────────────────────────────── */
.main-nav { background: var(--primary); }
.nav-list { display: flex; align-items: center; gap: 0; }
.nav-list > li { position: relative; }
.nav-list > li > a {
  display: flex; align-items: center; gap: 8px;
  padding: 0 18px; height: var(--nav-height);
  color: rgba(255,255,255,0.9); font-size: 13.5px; font-weight: 500;
  transition: all var(--transition);
}
.nav-list > li > a:hover,
.nav-list > li > a.active { color: var(--white); background: rgba(255,255,255,0.1); }
.nav-list > li > a.active { border-bottom: 3px solid var(--gold); }

/* Dropdown */
.has-dropdown .dropdown-menu {
  position: absolute; top: 100%; left: 0; min-width: 240px;
  background: #fff; box-shadow: var(--shadow-lg); border-radius: var(--border-radius);
  padding: 8px 0; opacity: 0; visibility: hidden; transform: translateY(-8px);
  transition: all var(--transition); z-index: 100;
}
.has-dropdown:hover .dropdown-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown-menu a { display: block; padding: 10px 20px; font-size: 14px; color: var(--text); }
.dropdown-menu a:hover { background: var(--gray-100); color: var(--primary); }

/* Mobile toggle */
.mobile-menu-toggle { display: none; background: none; border: none; cursor: pointer; padding: 6px; }
.mobile-menu-toggle span { display: block; width: 24px; height: 2px; background: var(--primary); margin: 5px 0; transition: all var(--transition); border-radius: 2px; }

/* ─── ГЛАВНАЯ СТРАНИЦА ───────────────────────────────── */
.hero-section { position: relative; background: var(--dark); overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1fr 380px; min-height: 520px; }

/* Видеоплеер */
.video-player-wrap { position: relative; background: #000; }
.video-player-wrap video,
.video-player-wrap iframe { width: 100%; height: 100%; display: block; }
.player-overlay { position: absolute; inset: 0; background: linear-gradient(to right, transparent 60%, rgba(0,0,0,0.5)); pointer-events: none; }

/* Сайдбар эфира */
.live-sidebar { background: var(--dark-2); display: flex; flex-direction: column; }
.live-sidebar-header { padding: 16px; border-bottom: 1px solid rgba(255,255,255,0.08); }
.live-sidebar-header h3 { color: var(--white); font-size: 14px; display: flex; align-items: center; gap: 8px; }

/* Карточки */
.card { background: #fff; border-radius: var(--border-radius); overflow: hidden; box-shadow: var(--shadow); transition: all var(--transition); }
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.card-thumb { position: relative; overflow: hidden; aspect-ratio: 16/9; }
.card-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s ease; }
.card:hover .card-thumb img { transform: scale(1.05); }
.card-duration { position: absolute; bottom: 8px; right: 8px; background: rgba(0,0,0,0.8); color: #fff; font-size: 11px; font-weight: 600; padding: 2px 6px; border-radius: 4px; }
.card-badge { position: absolute; top: 8px; left: 8px; }
.badge { display: inline-block; padding: 3px 8px; border-radius: 4px; font-size: 10px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase; }
.badge-live { background: var(--live-red); color: #fff; }
.badge-new { background: var(--primary); color: #fff; }
.badge-exclusive { background: var(--gold); color: var(--dark); }
.badge-breaking { background: var(--secondary); color: #fff; }
.card-body { padding: 16px; }
.card-category { font-size: 11px; font-weight: 600; color: var(--secondary); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px; }
.card-title { font-size: 15px; font-weight: 600; line-height: 1.4; margin-bottom: 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-meta { display: flex; align-items: center; gap: 12px; font-size: 12px; color: var(--text-muted); }
.card-meta i { font-size: 11px; }

/* Сетки */
.news-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.video-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }

/* ─── СЕКЦИИ ─────────────────────────────────────────── */
.section { padding: 48px 0; }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 28px; }
.section-title { font-family: var(--font-heading); font-size: 22px; font-weight: 700; color: var(--primary); position: relative; padding-left: 16px; }
.section-title::before { content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%); width: 4px; height: 22px; background: var(--secondary); border-radius: 2px; }
.section-link { font-size: 13px; font-weight: 600; color: var(--primary); display: flex; align-items: center; gap: 6px; }
.section-link:hover { color: var(--secondary); }

/* ─── ВИДЕОПЛЕЕР ─────────────────────────────────────── */
.player-container { background: #000; border-radius: var(--border-radius-lg); overflow: hidden; position: relative; }
.player-container video { width: 100%; display: block; }
.player-controls { position: absolute; bottom: 0; left: 0; right: 0; background: linear-gradient(transparent, rgba(0,0,0,0.8)); padding: 40px 16px 16px; display: flex; align-items: center; gap: 12px; opacity: 0; transition: opacity var(--transition); }
.player-container:hover .player-controls { opacity: 1; }
.player-btn { background: none; border: none; color: #fff; font-size: 18px; cursor: pointer; padding: 4px; }
.player-progress { flex: 1; height: 4px; background: rgba(255,255,255,0.3); border-radius: 2px; cursor: pointer; position: relative; }
.player-progress-fill { height: 100%; background: var(--secondary); border-radius: 2px; }
.player-volume, .player-quality, .player-fullscreen { margin-left: auto; }

/* ─── EPG / ПРОГРАММА ────────────────────────────────── */
.epg-table { background: #fff; border-radius: var(--border-radius); overflow: hidden; }
.epg-row { display: grid; grid-template-columns: 80px 1fr auto; gap: 16px; padding: 14px 20px; border-bottom: 1px solid var(--gray-200); align-items: center; transition: background var(--transition); }
.epg-row:hover { background: var(--gray-100); }
.epg-row.current { background: rgba(26,31,110,0.05); border-left: 3px solid var(--primary); }
.epg-row.past { opacity: 0.5; }
.epg-time { font-weight: 700; font-size: 15px; color: var(--primary); }
.epg-title { font-weight: 500; }
.epg-duration { font-size: 12px; color: var(--text-muted); }
.epg-progress { height: 3px; background: var(--gray-200); border-radius: 2px; margin-top: 6px; }
.epg-progress-fill { height: 100%; background: var(--primary); border-radius: 2px; transition: width 60s linear; }

/* ─── ЧАТ ────────────────────────────────────────────── */
.live-chat { display: flex; flex-direction: column; height: 100%; }
.chat-messages { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; scroll-behavior: smooth; }
.chat-msg { background: rgba(255,255,255,0.05); border-radius: 8px; padding: 8px 12px; }
.chat-msg-user { font-size: 11px; font-weight: 600; color: var(--gold); margin-bottom: 3px; }
.chat-msg-text { font-size: 13px; color: rgba(255,255,255,0.9); }
.chat-input-area { padding: 12px; border-top: 1px solid rgba(255,255,255,0.08); }
.chat-input-form { display: flex; gap: 8px; }
.chat-input { flex: 1; background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2); color: #fff; border-radius: 20px; padding: 8px 14px; font-size: 13px; outline: none; }
.chat-input::placeholder { color: rgba(255,255,255,0.4); }
.chat-send-btn { background: var(--primary-light); color: #fff; border: none; border-radius: 50%; width: 36px; height: 36px; cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

/* ─── ПОДВАЛ ─────────────────────────────────────────── */
.site-footer { background: var(--dark); color: rgba(255,255,255,0.8); margin-top: 60px; }
.footer-main { padding: 48px 0; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1.5fr; gap: 40px; }
.footer-col h4 { color: #fff; font-size: 14px; font-weight: 700; margin-bottom: 16px; text-transform: uppercase; letter-spacing: 0.5px; }
.footer-col ul li { margin-bottom: 10px; }
.footer-col ul a { color: rgba(255,255,255,0.6); font-size: 14px; transition: color var(--transition); }
.footer-col ul a:hover { color: var(--gold); }
.footer-logo { font-size: 26px; font-weight: 900; margin-bottom: 12px; }
.footer-about p { font-size: 13px; color: rgba(255,255,255,0.5); line-height: 1.7; margin-bottom: 16px; }
.footer-social { display: flex; gap: 12px; }
.footer-social a { color: rgba(255,255,255,0.5); font-size: 18px; transition: color var(--transition); }
.footer-social a:hover { color: var(--gold); }
.footer-col address { font-style: normal; }
.footer-col address p { font-size: 13px; color: rgba(255,255,255,0.6); margin-bottom: 8px; display: flex; align-items: flex-start; gap: 8px; }
.footer-col address a { color: rgba(255,255,255,0.6); }
.footer-col address a:hover { color: var(--gold); }
.app-badges { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.app-badge { display: flex; align-items: center; gap: 8px; background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2); color: rgba(255,255,255,0.9); padding: 8px 14px; border-radius: 8px; font-size: 13px; font-weight: 600; transition: all var(--transition); }
.app-badge:hover { background: rgba(255,255,255,0.2); color: #fff; }
.footer-bottom { background: rgba(0,0,0,0.3); padding: 16px 0; font-size: 12px; }
.footer-bottom-inner { display: flex; align-items: center; justify-content: space-between; }
.footer-bottom p { color: rgba(255,255,255,0.4); }
.footer-legal { display: flex; gap: 20px; }
.footer-legal a { color: rgba(255,255,255,0.4); transition: color var(--transition); }
.footer-legal a:hover { color: rgba(255,255,255,0.7); }

/* ─── КНОПКИ ─────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 24px; border-radius: var(--border-radius); font-size: 14px; font-weight: 600; cursor: pointer; border: none; transition: all var(--transition); text-align: center; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-light); color: #fff; }
.btn-secondary { background: var(--secondary); color: #fff; }
.btn-secondary:hover { background: var(--secondary-light); color: #fff; }
.btn-outline { border: 2px solid var(--primary); color: var(--primary); background: transparent; }
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-lg { padding: 14px 32px; font-size: 16px; }
.btn-sm { padding: 6px 14px; font-size: 12px; }

/* ─── УВЕДОМЛЕНИЯ ────────────────────────────────────── */
.alert { padding: 14px 18px; border-radius: var(--border-radius); margin-bottom: 12px; display: flex; align-items: center; justify-content: space-between; }
.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-error { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.alert-info { background: #cce5ff; color: #004085; border: 1px solid #b8daff; }
.alert-close { background: none; border: none; font-size: 18px; cursor: pointer; opacity: 0.6; }

/* ─── ПАГИНАЦИЯ ──────────────────────────────────────── */
.pagination { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 40px 0; }
.page-btn { width: 38px; height: 38px; display: flex; align-items: center; justify-content: center; border-radius: var(--border-radius); border: 1px solid var(--gray-300); font-size: 14px; transition: all var(--transition); }
.page-btn:hover, .page-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ─── АДАПТИВНОСТЬ ───────────────────────────────────── */
@media (max-width: 1024px) {
  .hero-grid { grid-template-columns: 1fr; }
  .live-sidebar { display: none; }
  .news-grid { grid-template-columns: repeat(2, 1fr); }
  .video-grid { grid-template-columns: repeat(3, 1fr); }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .header-top-inner { flex-wrap: wrap; gap: 10px; }
  .header-datetime, .header-weather { display: none; }
  .main-nav { display: none; }
  .main-nav.is-open { display: block; }
  .nav-list { flex-direction: column; }
  .nav-list > li > a { height: auto; padding: 14px 20px; border-bottom: 1px solid rgba(255,255,255,0.1); }
  .mobile-menu-toggle { display: block; }
  .news-grid { grid-template-columns: 1fr; }
  .video-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
  .footer-bottom-inner { flex-direction: column; gap: 10px; text-align: center; }
}

@media (max-width: 480px) {
  .video-grid { grid-template-columns: 1fr; }
  .header-main-inner { flex-wrap: wrap; }
  .header-search { order: 3; width: 100%; max-width: 100%; }
}

/* ─── АНИМАЦИИ ───────────────────────────────────────── */
@keyframes fadeIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
.fade-in { animation: fadeIn 0.4s ease forwards; }
.fade-in-delay { animation: fadeIn 0.4s ease 0.15s forwards; opacity: 0; }

/* ─── УТИЛИТЫ ────────────────────────────────────────── */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mt-4 { margin-top: 32px; }
.mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }
.d-flex { display: flex; } .align-center { align-items: center; } .justify-between { justify-content: space-between; }
.gap-1 { gap: 8px; } .gap-2 { gap: 16px; } .gap-3 { gap: 24px; }
