/* CSS Samsung Smart TV 2014 (WebKit 537/538 / Tizen 6.1) */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-box-sizing: border-box;
  -webkit-user-select: none;
  user-select: none;
}

body, html {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: #000000;
  font-family: Arial, sans-serif;
  color: #f8fafc;
  cursor: default;
}

body.cursor-hidden {
  cursor: none;
}

.slide-container {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: #000000;
}

/* ================= Top Bar ================= */
.top-header {
  position: absolute;
  top: 20px;
  left: 25px;
  right: 25px;
  height: 60px;
  z-index: 50;
  pointer-events: none;
  -webkit-transition: opacity 0.35s ease;
  transition: opacity 0.35s ease;
}

.brand-badge {
  float: left;
  background: #111827;
  padding: 10px 20px;
  border-radius: 30px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-weight: bold;
  font-size: 16px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #ffffff;
}

.live-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  background: #22c55e;
  border-radius: 5px;
  margin-right: 8px;
  vertical-align: middle;
}

.clock-widget {
  float: right;
  background: #111827;
  padding: 8px 22px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  text-align: right;
}

#digital-clock {
  font-size: 26px;
  font-weight: bold;
  color: #38bdf8;
  line-height: 1.1;
  display: block;
}

.date-text {
  font-size: 13px;
  color: #94a3b8;
}

/* ================= Progress Bar ================= */
.progress-bar-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 5px;
  background: rgba(255, 255, 255, 0.2);
  z-index: 60;
}

.progress-bar {
  width: 0%;
  height: 100%;
  background-color: #06b6d4;
  -webkit-transition: width 0.1s linear;
  transition: width 0.1s linear;
}

/* ================= Main Media Viewport ================= */
.media-viewport {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #000000;
  overflow: hidden;
}

/* Video Layer: Always rendered on hardware plane (z-index: 1) */
#slide-video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  display: block;
  background: #000000;
}

/* Image Layer: Covers video when active (z-index: 2) */
#slide-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  object-fit: contain;
  background: #000000;
}

/* ================= Samsung Smart TV Autoplay Overlay ================= */
.tv-start-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(3, 7, 18, 0.94);
  z-index: 100;
  text-align: center;
}

.tv-start-overlay.hidden {
  display: none !important;
}

.tv-modal {
  position: absolute;
  top: 50%;
  left: 50%;
  -webkit-transform: translate(-50%, -50%);
  transform: translate(-50%, -50%);
  background: #1e293b;
  border: 2px solid #06b6d4;
  padding: 40px;
  border-radius: 20px;
  width: 600px;
  max-width: 90%;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
}

.tv-icon {
  font-size: 50px;
  margin-bottom: 15px;
}

.tv-modal h2 {
  font-size: 28px;
  margin-bottom: 12px;
  color: #ffffff;
}

.tv-modal p {
  color: #cbd5e1;
  font-size: 17px;
  line-height: 1.5;
  margin-bottom: 25px;
}

.btn-tv-start {
  background-color: #0284c7;
  color: #ffffff;
  border: none;
  font-size: 19px;
  font-weight: bold;
  padding: 16px 36px;
  border-radius: 40px;
  cursor: pointer;
  outline: none;
}

.btn-tv-start:hover,
.btn-tv-start:focus {
  background-color: #06b6d4;
}

/* ================= TV Diagnostic HUD ================= */
.debug-hud {
  position: absolute;
  top: 85px;
  right: 25px;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid #38bdf8;
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 13px;
  font-family: monospace;
  color: #f1f5f9;
  z-index: 80;
  pointer-events: none;
  line-height: 1.5;
  max-width: 440px;
}

.debug-hud.hidden {
  display: none !important;
}

.hud-title {
  color: #38bdf8;
  font-weight: bold;
  font-size: 13px;
  margin-bottom: 5px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  padding-bottom: 3px;
}

.hud-err {
  color: #4ade80;
}

.hud-err.active-err {
  color: #f87171;
  font-weight: bold;
}

/* ================= On-Screen Toast ================= */
.tv-toast {
  position: absolute;
  top: 80px;
  left: 50%;
  -webkit-transform: translateX(-50%);
  transform: translateX(-50%);
  background: rgba(220, 38, 38, 0.95);
  color: #ffffff;
  padding: 10px 25px;
  border-radius: 10px;
  font-size: 16px;
  font-weight: bold;
  z-index: 95;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

/* ================= Floating Controls Overlay ================= */
.controls-overlay {
  position: absolute;
  bottom: 55px;
  left: 50%;
  -webkit-transform: translateX(-50%);
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.9);
  padding: 8px 20px;
  border-radius: 30px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  z-index: 50;
  white-space: nowrap;
}

.controls-overlay.hidden,
.top-header.hidden {
  opacity: 0 !important;
  pointer-events: none;
}

.controls-left, .controls-center, .controls-right {
  display: inline-block;
  vertical-align: middle;
}

.controls-left {
  margin-right: 15px;
}

.controls-right {
  margin-left: 15px;
}

.ctrl-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #f8fafc;
  min-width: 38px;
  height: 38px;
  border-radius: 19px;
  display: inline-block;
  vertical-align: middle;
  cursor: pointer;
  text-align: center;
  line-height: 36px;
  margin: 0 3px;
  padding: 0 10px;
  font-size: 13px;
  font-weight: bold;
}

.ctrl-btn:hover,
.ctrl-btn:focus {
  background: rgba(255, 255, 255, 0.25);
}

.slide-counter {
  font-size: 14px;
  color: #94a3b8;
  font-weight: bold;
  margin-left: 6px;
  display: inline-block;
  vertical-align: middle;
}

.slide-dots {
  display: inline-block;
  vertical-align: middle;
}

.slide-dot {
  width: 8px;
  height: 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.3);
  display: inline-block;
  margin: 0 3px;
  cursor: pointer;
}

.slide-dot.active {
  width: 22px;
  background-color: #06b6d4;
}

/* ================= Ticker Footer ================= */
.bottom-ticker {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 40px;
  background: #0f172a;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 40;
  overflow: hidden;
}

.ticker-label {
  position: absolute;
  top: 0;
  left: 0;
  width: 80px;
  height: 40px;
  line-height: 40px;
  background: #0284c7;
  color: #ffffff;
  font-weight: bold;
  font-size: 14px;
  text-align: center;
  letter-spacing: 1px;
  z-index: 2;
}

.ticker-content {
  margin-left: 80px;
  overflow: hidden;
  white-space: nowrap;
}

.ticker-track {
  display: inline-block;
  padding-left: 100%;
  -webkit-animation: ticker-scroll 32s linear infinite;
  animation: ticker-scroll 32s linear infinite;
  font-size: 15px;
  line-height: 40px;
  color: #e2e8f0;
}

@-webkit-keyframes ticker-scroll {
  0% { -webkit-transform: translate3d(0, 0, 0); }
  100% { -webkit-transform: translate3d(-100%, 0, 0); }
}

@keyframes ticker-scroll {
  0% { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(-100%, 0, 0); }
}
