/* =========================================================
   LaPape de México — Digital Signage Player
   Estilos base — Fase 1
   Paleta de marca (extraída de lpdm.com.mx):
   - Azul marino:  #0B2545
   - Azul marino 2 (más profundo, fondos): #081B33
   - Amarillo/dorado: #F5B301
   - Rojo: #E11D2E
   - Crema/blanco cálido: #FBF8F1
   ========================================================= */

:root {
  --azul-marino: #0b2545;
  --azul-marino-deep: #081b33;
  --azul-marino-light: #123a6b;
  --amarillo: #f5b301;
  --amarillo-deep: #d99900;
  --rojo: #e11d2e;
  --crema: #fbf8f1;
  --blanco: #ffffff;

  --font-display: 'Archivo Black', 'Arial Black', 'Helvetica Neue', sans-serif;
  --font-body: 'Inter', 'Segoe UI', Arial, sans-serif;

  --screen-w: 1366px;
  --screen-h: 768px;
}

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden; /* nunca scroll en modo TV */
  background: var(--azul-marino-deep);
  font-family: var(--font-body);
  cursor: none; /* sin cursor visible en modo kiosco */
  -webkit-user-select: none;
  user-select: none;
}

#player {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: var(--azul-marino-deep);
}

/* ---------------------------------------------------------
   Slide base
   --------------------------------------------------------- */
.slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.9s ease-in-out;
  display: flex;
  flex-direction: column;
  background: var(--azul-marino);
  overflow: hidden;
}

.slide.active {
  opacity: 1;
  visibility: visible;
  z-index: 5;
}

.slide.outgoing {
  opacity: 0;
  z-index: 4;
}

/* Fondo de media (imagen o video) a pantalla completa */
.slide-media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.slide-media img,
.slide-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  animation: kenburns 16s ease-in-out infinite alternate;
}

.slide[data-fit="contain"] .slide-media img,
.slide[data-fit="contain"] .slide-media video {
  object-fit: contain;
  animation: none;
  background: var(--azul-marino-deep);
}

@keyframes kenburns {
  0%   { transform: scale(1.0) translate(0, 0); }
  100% { transform: scale(1.08) translate(-1%, -1%); }
}

/* Degradado para que el texto siempre sea legible sobre la foto */
.slide-scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    100deg,
    rgba(8, 27, 51, 0.94) 0%,
    rgba(8, 27, 51, 0.88) 28%,
    rgba(8, 27, 51, 0.35) 52%,
    rgba(8, 27, 51, 0.05) 68%,
    rgba(8, 27, 51, 0) 100%
  );
}

/* ---------------------------------------------------------
   Contenido / jerarquía visual:
   LOGO -> CATEGORIA -> TITULO -> MENSAJE -> CTA
   --------------------------------------------------------- */
.slide-content {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 56px 0 56px 64px;
  max-width: 62%;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
}

.brand-row img {
  height: 52px;
  width: auto;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,0.35));
}

.brand-row span {
  font-family: var(--font-display);
  color: var(--crema);
  font-size: 15px;
  letter-spacing: 0.08em;
  opacity: 0.85;
}

.slide-category {
  display: inline-flex;
  align-self: flex-start;
  align-items: center;
  gap: 8px;
  background: var(--rojo);
  color: var(--blanco);
  font-family: var(--font-display);
  font-size: 20px;
  letter-spacing: 0.06em;
  padding: 8px 22px;
  border-radius: 6px;
  transform: rotate(-1.5deg);
  box-shadow: 0 6px 18px rgba(225, 29, 46, 0.45);
  margin-bottom: 22px;
}

.slide-title {
  font-family: var(--font-display);
  color: var(--blanco);
  font-size: 92px;
  line-height: 0.98;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  text-shadow: 0 6px 24px rgba(0,0,0,0.45);
  margin-bottom: 18px;
}

.slide-title .accent {
  color: var(--amarillo);
}

.slide-message {
  font-family: var(--font-body);
  font-weight: 600;
  color: var(--crema);
  font-size: 30px;
  line-height: 1.25;
  max-width: 90%;
  margin-bottom: 30px;
  text-shadow: 0 2px 10px rgba(0,0,0,0.35);
}

.slide-cta {
  display: inline-flex;
  align-self: flex-start;
  align-items: center;
  gap: 12px;
  background: var(--amarillo);
  color: var(--azul-marino-deep);
  font-family: var(--font-display);
  font-size: 28px;
  padding: 16px 34px;
  border-radius: 10px;
  box-shadow: 0 10px 28px rgba(245, 179, 1, 0.5);
}

.slide-cta .price {
  color: var(--rojo);
}

/* Franja inferior con datos de contacto — discreta, siempre presente */
.footer-strip {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 34px;
  background: rgba(8, 27, 51, 0.75);
  backdrop-filter: blur(2px);
  font-size: 15px;
  color: var(--crema);
  letter-spacing: 0.02em;
}

.footer-strip .dot {
  color: var(--amarillo);
  margin: 0 10px;
}

.footer-strip .clock {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--amarillo);
}

/* ---------------------------------------------------------
   Barra de progreso del slide actual (arriba)
   --------------------------------------------------------- */
.progress-track {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  z-index: 10;
  background: rgba(255,255,255,0.12);
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--amarillo), var(--rojo));
}

.progress-bar.animate {
  transition-property: width;
  transition-timing-function: linear;
}

/* ---------------------------------------------------------
   Estado de carga / sin conexión / sin contenido
   --------------------------------------------------------- */
.status-screen {
  position: absolute;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  background: var(--azul-marino-deep);
  color: var(--crema);
  text-align: center;
  transition: opacity 0.5s ease;
}

.status-screen.hidden {
  opacity: 0;
  pointer-events: none;
}

.status-screen img {
  height: 110px;
  margin-bottom: 12px;
}

.status-screen h1 {
  font-family: var(--font-display);
  font-size: 34px;
  color: var(--amarillo);
  text-transform: uppercase;
}

.status-screen p {
  font-size: 18px;
  opacity: 0.8;
  max-width: 520px;
}

.spinner {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 5px solid rgba(245, 179, 1, 0.25);
  border-top-color: var(--amarillo);
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ---------------------------------------------------------
   Placeholder de foto temporal (cuando aún no hay foto real)
   --------------------------------------------------------- */
.temp-photo-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 6;
  background: rgba(0,0,0,0.55);
  color: var(--amarillo);
  font-size: 12px;
  font-family: var(--font-body);
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid rgba(245,179,1,0.5);
}

/* ---------------------------------------------------------
   Responsive: escala todo el lienzo 1366x768 a cualquier TV
   manteniendo proporción 16:9 sin barras ni recorte raro.
   --------------------------------------------------------- */
@media (max-width: 900px), (max-height: 600px) {
  .slide-title { font-size: 64px; }
  .slide-message { font-size: 22px; }
  .slide-cta { font-size: 22px; padding: 12px 24px; }
}
