/* ==========================================================
   TELEPROGRAMMA.CSS — ПРОГРАММА ПЕРЕДАЧ (СВЕТЛАЯ / ТЁМНАЯ ТЕМА)
========================================================== */

.nav {
  top: 0; 
  left: 0; 
  right: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 0;
}

.nav button {
  cursor: pointer;
  padding: 8px 14px;
  border: none;
  background-color: var(--accent-color, #047886);
  color: white;
  border-radius: 35px;
  font-weight: 600;
  font-size: 12px;
  transition: background-color 0.25s ease, transform 0.2s ease;
}

.nav button:hover {
  background-color: #0056b3;
  transform: translateY(-1px);
}

.day-section {
  margin-top: 80px;
}

.program table {
  border-collapse: collapse;
  width: 100%;
  max-width: 700px;
  margin-bottom: 40px;
}

.program th, .program td {
  border: 1px solid var(--border-main, #ccc);
  padding: 8px;
}

.program th {
  background: var(--bg-secondary, #f0f0f0);
  color: var(--text-main, #171b19);
}

/* Текущая активная передача в эфире */
.current {
  background-color: #eaf3fc !important;
}

section[id^="day-"] {
  max-width: 99%;
  margin: 20px 0;
  padding: 15px 10px;
  border-radius: 12px;
  font-family: inherit;
  color: var(--text-main, #333);
}

section[id^="day-"] h2 {
  font-size: 2.2rem;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--text-main, #2c3e50);
  text-align: center;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

section[id^="day-"] table {
  width: 100%;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0 4px;
}

section[id^="day-"] tr {
  border-bottom: 1px solid var(--border-divider, #e0e4e8);
  transition: background-color 0.2s ease;
  cursor: default;
}

section[id^="day-"] tr:hover {
  background-color: var(--bg-hover, #d6e9ff);
}

section[id^="day-"] td {
  padding: 12px 15px;
  vertical-align: middle;
  word-wrap: break-word;
}

/* Ячейка времени */
section[id^="day-"] td:first-child {
  width: 80px;
  font-weight: 700;
  color: var(--accent-color, #2980b9);
  text-align: center;
  font-size: 1rem;
  background-color: var(--bg-subtle, #eaf3fc);
  border-right: 2px solid var(--border-main, #d0d7de);
  border-radius: 8px 0 0 8px;
}

/* Ячейка названия передачи */
section[id^="day-"] td:last-child {
  font-size: 1rem;
  color: var(--text-main, #444);
  padding-left: 20px;
  width: 100%;
  white-space: normal;
  border-radius: 0 8px 8px 0;
}

section[id^="day-"] td:last-child a {
  color: var(--accent-color, #047886) !important;
  transition: color 0.2s ease;
}

section[id^="day-"] td:last-child a:hover {
  color: #0056b3 !important;
}

.current-day-title {
  color: var(--accent-color, #2980b9) !important;
  border-bottom: 3px solid var(--accent-color, #2980b9);
  padding-bottom: 6px;
  box-shadow: 0 2px 8px rgba(41, 128, 185, 0.2);
  transition: color 0.3s ease, box-shadow 0.3s ease;
}

.program-content-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.program-content {
  flex: 1;
  min-width: 0;
  text-overflow: ellipsis;
}

.live-wrapper {
  flex-shrink: 0;
  position: relative;
}

.live-dropdown {
  position: relative;
  display: inline-block;
}

.live-button {
  background-color: #ff4b4b;
  color: white;
  padding: 4px 12px;
  border: none;
  border-radius: 20px;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  transition: background-color 0.3s ease;
  white-space: nowrap;
  font-weight: 600;
}

.live-button:hover {
  background-color: #d63838;
}

.live-menu {
  display: none;
  position: absolute;
  top: 110%;
  right: 0;
  background: var(--bg-surface, #ffffff);
  border: 1px solid var(--border-main, #ccc);
  border-radius: 10px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.15);
  overflow: hidden;
  min-width: 160px;
  z-index: 99;
}

.live-menu a {
  display: block;
  padding: 9px 14px;
  text-decoration: none;
  color: var(--text-main, #333) !important;
  background: var(--bg-surface, #fff);
  transition: background-color 0.2s ease, color 0.2s ease;
  font-weight: 500;
  font-size: 13px;
}

.live-menu a:hover {
  background: var(--bg-hover, #f0f0f0);
  color: var(--accent-color, #047886) !important;
}

.live-dropdown.open .live-menu {
  display: block;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(255,75,75, 0.7); }
  70% { box-shadow: 0 0 0 10px rgba(255,75,75, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255,75,75, 0); }
}

.pulse {
  animation: pulse 1.5s infinite;
}

/* ==========================================================
   ПОДДЕРЖКА ТЁМНОЙ ТЕМЫ [data-theme="dark"]
========================================================== */
[data-theme="dark"] section[id^="day-"] {
  color: var(--text-main, #f1f5f9);
}

[data-theme="dark"] section[id^="day-"] h2 {
  color: var(--text-main, #f1f5f9);
}

[data-theme="dark"] section[id^="day-"] tr {
  border-bottom-color: var(--border-main, #232d36);
}

[data-theme="dark"] section[id^="day-"] tr:hover {
  background-color: var(--bg-hover, #1e2830);
}

[data-theme="dark"] section[id^="day-"] td:first-child {
  background-color: var(--bg-surface, #151a1e);
  color: var(--accent-color, #38bdf8);
  border-right-color: var(--border-main, #232d36);
}

[data-theme="dark"] section[id^="day-"] td:last-child {
  color: var(--text-secondary, #cbd5e1);
}

[data-theme="dark"] section[id^="day-"] td:last-child a {
  color: var(--accent-color, #38bdf8) !important;
}

[data-theme="dark"] section[id^="day-"] td:last-child a:hover {
  color: #7dd3fc !important;
}

/* Текущая передача в тёмном режиме */
[data-theme="dark"] .current {
  background-color: #1a2734 !important;
  box-shadow: inset 0 0 0 1px var(--accent-color, #0284c7);
  border-radius: 8px;
}

[data-theme="dark"] .current td:first-child {
  background-color: #162432;
  color: #38bdf8;
}

[data-theme="dark"] .current td:last-child {
  color: #ffffff;
}

[data-theme="dark"] .current-day-title {
  color: var(--accent-color, #38bdf8) !important;
  border-bottom-color: var(--accent-color, #38bdf8);
  box-shadow: 0 2px 10px rgba(56, 189, 248, 0.25);
}

[data-theme="dark"] .live-menu {
  background: var(--bg-surface, #151a1e);
  border-color: var(--border-main, #232d36);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
}

[data-theme="dark"] .live-menu a {
  background: var(--bg-surface, #151a1e);
  color: var(--text-main, #f1f5f9) !important;
}

[data-theme="dark"] .live-menu a:hover {
  background: var(--bg-hover, #1e2830);
  color: var(--accent-color, #38bdf8) !important;
}

/* ==========================================================
   АДАПТИВ
========================================================== */
@media (max-width: 600px) {
  section[id^="day-"] h2 { 
    font-size: 1.5rem;
  }
  
  section[id^="day-"] td:first-child {
    width: 60px;
    font-size: 0.9rem;
    padding: 10px 8px;
  }
  
  section[id^="day-"] td:last-child {
    font-size: 0.9rem;
    padding-left: 12px;
    padding-right: 12px;
  }
  
  .program-content-wrapper {
    flex-wrap: nowrap;
    gap: 8px;
  }
  
  .program-content {
    text-overflow: ellipsis;
    flex-shrink: 1;
  }
  
  .live-wrapper {
    flex-shrink: 0;
    margin-left: 0;
  }
  
  .live-button {
    padding: 3px 10px;
    font-size: 0.8rem;
  }
  
  .live-menu {
    min-width: 140px;
  }
}