/* ----------------------------------------------------------------------------
   CCOO Asturias · Cliente de pantalla informativa (kiosko)
   Paleta de marca: rojo #E2231A, blanco, negro #1A1A1A, gris #9B9B9B
---------------------------------------------------------------------------- */
:root {
  --ccoo-red: #e2231a;
  --ccoo-red-dark: #b51b14;
  --ccoo-black: #1a1a1a;
  --ccoo-gray: #9b9b9b;
  --ccoo-white: #ffffff;
}

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

/* El atributo `hidden` debe ganar siempre, aunque la clase fije display:flex */
[hidden] { display: none !important; }

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
  color: var(--ccoo-white);
  font-family: "Helvetica Neue", Arial, "Segoe UI", sans-serif;
  cursor: none; /* kiosko: sin cursor */
}

/* Escenario a pantalla completa -------------------------------------------- */
.stage {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
}

/* Cada "slide" del carrusel ocupa todo y aparece con un fundido suave */
.slide {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 600ms ease;
  container-type: size; /* referencia para las unidades cqmin de las plantillas */
}
.slide.is-active { opacity: 1; }

.slide img,
.slide video {
  max-width: 100%;
  max-height: 100%;
  width: 100%;
  height: 100%;
  object-fit: contain;       /* nunca recorta el cartel/vídeo */
  background: #000;
}

/* Reproductor de YouTube: ocupa toda la pantalla */
.yt-holder,
.yt-holder iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
}

/* Pantalla "apagada": negro absoluto ---------------------------------------- */
.screen-off { background: #000; }

/* Pantalla por defecto (sin contenido): logo CCOO --------------------------- */
.screen-idle {
  background: radial-gradient(circle at 50% 40%, #ffffff 0%, #f3f3f3 70%, #e9e9e9 100%);
  flex-direction: column;
  gap: 2.5vh;
}
.screen-idle img {
  width: auto;
  height: auto;
  max-width: 60%;
  max-height: 55%;
  object-fit: contain;
  background: transparent;
}
.screen-idle .idle__tagline {
  color: var(--ccoo-gray);
  font-size: 2.2vh;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Pantalla "no registrada" -------------------------------------------------- */
.screen-unregistered {
  flex-direction: column;
  background: var(--ccoo-black);
  color: var(--ccoo-white);
  text-align: center;
  padding: 6vh;
  gap: 3vh;
}
.screen-unregistered .un__bar {
  width: 100%;
  background: var(--ccoo-red);
  height: 1.2vh;
  position: fixed;
  top: 0;
  left: 0;
}
.screen-unregistered img { width: 26vh; height: auto; object-fit: contain; }
.screen-unregistered h1 { font-size: 4.2vh; font-weight: 800; }
.screen-unregistered p { font-size: 2.6vh; color: #d8d8d8; max-width: 70%; line-height: 1.5; }
.screen-unregistered .un__mac {
  font-family: "SF Mono", "Roboto Mono", ui-monospace, monospace;
  font-size: 6vh;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #fff;
  background: var(--ccoo-red);
  padding: 1.6vh 3vh;
  border-radius: 1.2vh;
  box-shadow: 0 1vh 4vh rgba(0,0,0,0.4);
}
.screen-unregistered .un__hint { font-size: 2vh; color: var(--ccoo-gray); }

/* Aviso de carga inicial ---------------------------------------------------- */
.screen-loading {
  background: var(--ccoo-black);
  flex-direction: column;
  gap: 3vh;
}
.screen-loading img { width: 28vh; height: auto; opacity: 0.9; }
.spinner {
  width: 5vh; height: 5vh;
  border: 0.6vh solid rgba(255,255,255,0.2);
  border-top-color: var(--ccoo-red);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Indicador de conexión ----------------------------------------------------- */
.conn {
  position: fixed;
  bottom: 2vh; right: 2vh;
  display: flex; align-items: center; gap: 1vh;
  background: rgba(0,0,0,0.65);
  color: #fff; font-size: 1.7vh;
  padding: 1vh 1.6vh; border-radius: 999px;
  z-index: 50;
}
.conn__dot { width: 1.2vh; height: 1.2vh; border-radius: 50%; background: var(--ccoo-red); animation: pulse 1.2s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.3} }

/* Panel de configuración manual (pruebas) ----------------------------------- */
.setup {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  background: var(--ccoo-black);
  cursor: auto;
}
.setup__card {
  background: #fff; color: var(--ccoo-black);
  width: min(92vw, 460px);
  padding: 36px; border-radius: 16px;
  display: flex; flex-direction: column; gap: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.setup__logo { width: 180px; align-self: center; }
.setup__card h1 { font-size: 22px; }
.setup__card p { font-size: 14px; color: #555; line-height: 1.5; }
.setup__card label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: #444; }
.setup__card input {
  padding: 12px; border: 1px solid #ccc; border-radius: 8px; font-size: 15px;
}
.setup__card input:focus { outline: 2px solid var(--ccoo-red); border-color: transparent; }
.setup__card button {
  margin-top: 8px; padding: 14px; border: 0; border-radius: 8px;
  background: var(--ccoo-red); color: #fff; font-size: 16px; font-weight: 700; cursor: pointer;
}
.setup__card button:hover { background: var(--ccoo-red-dark); }
