/* ==========================================================================
 * Cast Receiver — TV Theater Layout
 *
 * Square image sized by viewport height. Text fills remaining width.
 * Transport bar at bottom. Matches app's desktop theater mode.
 * ========================================================================== */

*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: #0e0c0a;
  color: rgba(255, 255, 255, 0.9);
  font-family: "Source Serif 4", Georgia, serif;
  overflow: hidden;
  width: 100vw;
  height: 100vh;
}

/* -- Idle screen ---------------------------------------------------------- */

#idle-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
  animation: pulse 3s ease-in-out infinite;
}

#idle-screen h1 {
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
  font-weight: 700;
  font-size: 3rem;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

#idle-screen p {
  font-size: 1.2rem;
  opacity: 0.5;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.8;
  }
  50% {
    opacity: 1;
  }
}

/* -- Theater layout ------------------------------------------------------- */

#theater {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  width: 100vw;
  padding: 32px 32px 80px 32px; /* extra bottom for transport */
}

/* -- Image — square, height-driven ---------------------------------------- */

#image-container {
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
  aspect-ratio: 1 / 1;
  height: min(calc(100vh - 112px), calc(70vw - 64px));
  border-radius: 8px;
  background: #1a1816;
}

#slide-image,
#slide-image-next {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 300ms ease;
}

#slide-image-next {
  opacity: 0;
}

/* -- Text panel ----------------------------------------------------------- */

#text-panel {
  flex: 1;
  min-width: 0;
  max-height: calc(100vh - 112px);
  padding: 48px 56px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow-y: auto;
}

#slide-description {
  font-family: "Source Serif 4", Georgia, serif;
  font-weight: 400;
  font-size: 1.8rem;
  line-height: 1.6;
  opacity: 0.85;
}

#text-panel::-webkit-scrollbar {
  width: 4px;
}
#text-panel::-webkit-scrollbar-track {
  background: transparent;
}
#text-panel::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
}

/* -- Transport bar -------------------------------------------------------- */

#transport {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 32px;
  background: rgba(14, 12, 10, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

#transport button {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.8);
  font-size: 1.2rem;
  cursor: pointer;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 150ms;
}

#transport button:hover {
  background: rgba(255, 255, 255, 0.1);
}

#btn-next {
  transform: scaleX(1);
}

#progress-track {
  flex: 1;
  height: 4px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 2px;
  overflow: hidden;
}

#progress-fill {
  height: 100%;
  width: 0%;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 2px;
  transition: width 200ms linear;
}

/* -- Utility -------------------------------------------------------------- */

.hidden {
  display: none !important;
}

/* -- 21:9 ultrawide ------------------------------------------------------- */

@media (min-aspect-ratio: 2/1) {
  #image-container {
    height: min(calc(100vh - 112px), calc(55vw - 64px));
  }
  #text-panel {
    padding: 64px 72px;
  }
  #slide-description {
    font-size: 2rem;
  }
}

/* -- 4:3 displays --------------------------------------------------------- */

@media (max-aspect-ratio: 4/3) {
  #image-container {
    height: min(calc(100vh - 112px), calc(55vw - 64px));
  }
  #slide-description {
    font-size: 1.5rem;
  }
}
