/* ============================================================
   DminionTV — CRT TV frame for the video player page
   Centered on the page, embed sits inside the "screen".
   ============================================================ */

/* --- Kill Bootstrap/jQuery Mobile interference on the video page --- */
body.tv-page {
  background: #0a0a0f !important;
  min-height: 100vh !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin: 0 !important;
  padding: 20px !important;
  font-family: sans-serif !important;
  color: #ccc !important;
}

body.tv-page .container,
body.tv-page .container-fluid {
  max-width: none !important;
  padding: 0 !important;
  margin: 0 !important;
  width: auto !important;
}

body.tv-page [data-role="page"] {
  background: transparent !important;
  min-height: auto !important;
  padding: 0 !important;
  margin: 0 !important;
  overflow: visible !important;
}

body.tv-page .article {
  padding: 10px !important;
  margin: 0 !important;
}

/* --- The TV "furniture" wrapper --- */
.tv-set {
  position: relative;
  width: 100%;
  max-width: 960px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* --- TV body (the bezel / shell) --- */
.tv-body {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #1a1a20;
  border-radius: 38px 38px 44px 44px;
  border: 8px solid #2c2c34;
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.8),
    inset 0 0 0 2px #3a3a44,
    inset 0 0 30px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* --- Screen bezel inner line --- */
.tv-body::before {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 32px 32px 36px 36px;
  border: 2px solid #2a2a32;
  pointer-events: none;
}

/* --- Screen (the content lives here) --- */
.tv-screen {
  width: 100%;
  height: 100%;
  position: relative;
  background: #0d0d14;
  border-radius: 30px 30px 34px 34px;
  overflow: hidden;
}

/* --- Scanline overlay (subtle, retro feel) --- */
.tv-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0) 0px,
    rgba(0, 0, 0, 0) 2px,
    rgba(0, 0, 0, 0.12) 3px,
    rgba(0, 0, 0, 0) 4px
  );
  pointer-events: none;
  z-index: 2;
  opacity: 0.6;
}

/* --- Screen glare (very subtle top reflection) --- */
.tv-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.04) 0%,
    rgba(255, 255, 255, 0) 30%
  );
  pointer-events: none;
  z-index: 1;
}

/* --- YouTube iframe inside the screen (play page) --- */
.tv-screen iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 30px 30px 34px 34px;
  background: #000;
}

/* --- Content inside the screen (listing page) --- */
.tv-screen .article {
  padding: 24px 28px !important;
  margin: 0 !important;
  overflow-y: auto !important;
  max-height: 100% !important;
  color: #ccc !important;
  font-family: "SF Mono", "Fira Code", "Consolas", monospace !important;
  font-size: 13px !important;
  line-height: 1.6 !important;
}

/* --- Category headings --- */
.tv-screen h5 {
  color: #3aff6a !important;
  font-family: monospace !important;
  font-size: 14px !important;
  font-weight: bold !important;
  letter-spacing: 2px !important;
  text-transform: uppercase !important;
  margin: 24px 0 10px 0 !important;
  padding: 0 !important;
  border-bottom: 1px solid rgba(58, 255, 106, 0.25) !important;
  padding-bottom: 6px !important;
  text-shadow: 0 0 10px rgba(58, 255, 106, 0.4) !important;
  display: block !important;
}

.tv-screen h5:first-child {
  margin-top: 0 !important;
}

/* --- Link list --- */
.tv-screen ul {
  list-style: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

.tv-screen li {
  margin: 0 !important;
  padding: 4px 0 !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04) !important;
}

.tv-screen li a {
  color: #ddd !important;
  text-decoration: none !important;
  font-size: 13px !important;
  font-family: monospace !important;
  transition: color 0.15s !important;
  display: inline-block !important;
}

.tv-screen li a:hover {
  color: #3aff6a !important;
  text-shadow: 0 0 8px rgba(58, 255, 106, 0.5) !important;
}

.tv-screen li span {
  display: none !important;
}

/* --- Antenna nubs (top-left / top-right) --- */
.tv-antenna {
  position: absolute;
  top: -18px;
  width: 4px;
  height: 26px;
  background: #3a3a44;
  border-radius: 2px;
  z-index: 0;
}
.tv-antenna.left {
  left: 18%;
  transform: rotate(-18deg);
}
.tv-antenna.right {
  right: 18%;
  transform: rotate(18deg);
}

/* --- Power indicator LED --- */
.tv-power-led {
  position: absolute;
  bottom: 14px;
  right: 24px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #3aff6a;
  box-shadow: 0 0 6px #3aff6a, 0 0 12px rgba(58, 255, 106, 0.4);
  z-index: 3;
  animation: led-pulse 3s ease-in-out infinite;
}

@keyframes led-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.55; }
}

/* --- TV base / stand --- */
.tv-stand {
  width: 56%;
  height: 14px;
  background: #24242c;
  border-radius: 0 0 6px 6px;
  margin-top: -2px;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.5);
  z-index: 0;
}

.tv-base {
  width: 40%;
  height: 18px;
  background: #1c1c24;
  border-radius: 4px;
  margin-top: -4px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
  z-index: 0;
}

/* --- Brand plate on the bezel --- */
.tv-brand {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  color: #6a6a74;
  font-size: 11px;
  letter-spacing: 3px;
  text-transform: uppercase;
  z-index: 3;
  user-select: none;
  font-family: monospace;
  text-shadow: 0 1px 0 #000;
}

/* ============================================================
   TV Guide listing — channel guide style
   Channel band (colored stripe + label) + numbered entry rows.
   ============================================================ */

.guide-channel {
  display: flex;
  align-items: center;
  margin: 18px 0 6px 0;
  padding: 4px 0;
  border-left: 4px solid;
  padding-left: 10px;
}

.guide-channel-label {
  font-size: 11px;
  font-weight: bold;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 6px;
  white-space: nowrap;
}

.guide-entry {
  display: flex;
  align-items: baseline;
  padding: 3px 0 3px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 13px;
  line-height: 1.5;
}

.guide-num {
  color: #444;
  font-size: 11px;
  width: 28px;
  flex-shrink: 0;
  text-align: right;
  padding-right: 10px;
  font-family: monospace;
}

.guide-title {
  flex: 1;
  min-width: 0;
}

.guide-link {
  color: #c8c8c8;
  text-decoration: none;
  font-family: "SF Mono", "Fira Code", "Consolas", monospace;
  transition: color 0.15s, text-shadow 0.15s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.guide-link:hover {
  color: #3aff6a;
  text-shadow: 0 0 6px rgba(58, 255, 106, 0.5);
}

.guide-time {
  color: #444;
  font-size: 11px;
  flex-shrink: 0;
  margin-left: 10px;
  font-family: monospace;
  letter-spacing: 0.5px;
}

/* ============================================================
   TV Guide listing — channel guide aesthetic
   Dark bg, scanlines, channel bands, numbered entry grid.
   NO CRT frame.
   ============================================================ */

body.tv-page {
  /* already dark from earlier rules — just ensure no CRT flex centering */
  display: block !important;
  justify-content: flex-start !important;
  align-items: flex-start !important;
  padding: 24px 12px !important;
}

/* --- Scanline background on the page --- */
body.tv-page::before {
  content: "";
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0) 0px,
    rgba(0, 0, 0, 0) 2px,
    rgba(0, 0, 0, 0.08) 3px,
    rgba(0, 0, 0, 0) 4px
  );
  pointer-events: none;
  z-index: 9999;
  opacity: 0.5;
}

/* --- Top bar: "DminionTV GUIDE" title --- */
.tg-topbar {
  max-width: 1200px;
  margin: 0 auto 20px auto;
  padding: 0 8px;
  display: flex;
  align-items: baseline;
  gap: 14px;
}

.tg-brand {
  color: #3aff6a;
  font-size: 13px;
  font-weight: bold;
  letter-spacing: 3px;
  text-transform: uppercase;
  text-shadow: 0 0 10px rgba(58, 255, 106, 0.5);
  font-family: "SF Mono", "Fira Code", "Consolas", monospace;
}

.tg-topbar-sub {
  color: #555;
  font-size: 12px;
  letter-spacing: 1px;
  font-family: "SF Mono", "Fira Code", "Consolas", monospace;
}

/* --- Channel band --- */
.tg-channel {
  max-width: 1200px;
  margin: 22px 0 4px 0;
  padding: 6px 8px;
  border-left: 4px solid;
  display: flex;
  align-items: baseline;
  gap: 16px;
}

.tg-chan-num {
  font-size: 18px;
  font-weight: bold;
  font-family: "SF Mono", "Fira Code", "Consolas", monospace;
  line-height: 1;
}

.tg-chan-label {
  font-size: 11px;
  font-weight: bold;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-family: "SF Mono", "Fira Code", "Consolas", monospace;
}

/* --- Entry grid --- */
.tg-entries {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 8px 40px 8px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.tg-entry {
  background: rgba(0, 0, 0, 0.25);
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: background 0.12s;
}
.tg-entry:hover {
  background: rgba(255, 255, 255, 0.06);
}

.tg-idx {
  font-size: 10px;
  color: #444;
  font-family: "SF Mono", "Fira Code", "Consolas", monospace;
  letter-spacing: 1px;
}

.tg-title {
  flex: 1;
  min-width: 0;
}

.tg-link {
  color: #c8c8c8;
  text-decoration: none;
  font-family: "SF Mono", "Fira Code", "Consolas", monospace;
  font-size: 12px;
  line-height: 1.4;
  transition: color 0.12s, text-shadow 0.12s;
  display: block;
  word-break: break-word;
}
.tg-link:hover {
  color: #3aff6a;
  text-shadow: 0 0 6px rgba(58, 255, 106, 0.4);
}

.tg-age {
  font-size: 10px;
  color: #444;
  font-family: "SF Mono", "Fira Code", "Consolas", monospace;
  letter-spacing: 0.5px;
  align-self: flex-end;
}

/* --- Responsive columns --- */
@media (max-width: 1000px) {
  .tg-entries { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 700px) {
  .tg-entries { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .tg-entries { grid-template-columns: 1fr; }
}

/* --- Hide the CRT frame elements — guide page is flat --- */
body.tv-page .tv-set,
body.tv-page .tv-antenna,
body.tv-page .tv-body,
body.tv-page .tv-screen,
body.tv-page .tv-brand,
body.tv-page .tv-stand,
body.tv-page .tv-base,
body.tv-page .tv-power-led,
body.tv-page .tv-status {
  display: none !important;
}

/* --- Status text under the TV --- */
.tv-status {
  margin-top: 18px;
  color: #5a5a64;
  font-size: 13px;
  letter-spacing: 1px;
  text-align: center;
  font-family: monospace;
  user-select: none;
}

/* --- Responsive: shrink TV on small screens --- */
@media (max-width: 700px) {
  .tv-body {
    border-width: 5px;
    border-radius: 24px 24px 28px 28px;
  }
  .tv-body::before {
    border-radius: 20px 20px 22px 22px;
    inset: 4px;
  }
  .tv-screen {
    border-radius: 18px 18px 20px 20px;
  }
  .tv-screen iframe {
    border-radius: 18px 18px 20px 20px;
  }
  .tv-antenna {
    height: 18px;
    top: -14px;
    width: 3px;
  }
  .tv-brand {
    font-size: 9px;
    top: 8px;
  }
  .tv-power-led {
    bottom: 10px;
    right: 16px;
    width: 6px;
    height: 6px;
  }
}
