@charset "UTF-8";

/* ==========================================================================
   GLOBAL RESET & LAYOUT
   ========================================================================== */

/* Reset básico */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Body & container principal */
body {
  background-color: #f0f0f0;
  font-family: sans-serif;
  color: #333;
}
.container-fluid {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  padding: 1rem;
  gap: 1rem;
}

/* ==========================================================================
   QUARTO / OVERLAYS
   ========================================================================== */

#quarto-container {
  position: relative;
  flex: 1 1 auto;
  max-width: 600px;
  width: 100%;
}
#quarto-img {
  width: 100%;
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(0,0,0,0.2);
  display: block;
}

/* Película escura */
#pelicula {
  position: absolute; top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,1);
  opacity: 1;
  transition: opacity .2s ease;
  z-index: 2;
}

/* LED Balizador */
#led-balizador {
  position: absolute; display: none;
  top: 73%; left: 92%;
  width: 15px; height: 0;
  border-top: 7px solid #fff9c4;
  transform: rotate(1deg) skewX(3deg);
  filter: drop-shadow(0 0 12px rgba(255,249,196,0.7)) drop-shadow(0 0 30px rgba(255,249,150,0.5));
  z-index: 5;
}
#led-balizador::after {
  content: '';
  position: absolute; top: 40px; left: 30px;
  width: 120px; height: 150px;
  background: radial-gradient(ellipse at top, rgba(255,249,196,0.35), transparent 75%);
  filter: blur(10px);
  transform: rotate(110deg);
  transform-origin: top left;
  z-index: 1;
  pointer-events: none;
}

/* LED Central */
#led-central {
  position: absolute; display: none;
  top: 1.3%; left: 41.6%;
  width: 77px; height: 0;
  border-top: 41px solid #fff9c4;
  border-left: 7px solid transparent;
  border-bottom: 4px solid transparent;
  transform: rotate(-13deg) skewX(36deg);
  filter: drop-shadow(0 0 12px rgba(255,249,196,0.7)) drop-shadow(0 0 30px rgba(255,249,150,0.5));
  z-index: 5;
}
#led-central::after {
  content: '';
  position: absolute; top: 0; left: 10px;
  width: 550px; height: 320px;
  background: radial-gradient(ellipse at top, rgba(255,249,196,0.35), transparent 55%);
  filter: blur(50px);
  transform: rotate(115deg);
  transform-origin: top left;
  z-index: 1;
  pointer-events: none;
}

/* LED Cabeceira */
#led-cabeceira {
  position: absolute; display: block;
  top: 45.8%; left: 6.4%;
  width: 187px; height: 0;
  border-top: 1.5px solid #fff9c4;
  transform: rotate(1.2deg) skewX(3deg);
  filter: drop-shadow(0 0 10px rgba(255,249,196,0.7)) drop-shadow(0 0 25px rgba(255,249,150,0.5));
  opacity: 1;
  transition: opacity .2s ease;
  z-index: 4;
}
#led-cabeceira::after {
  content: '';
  position: absolute; top: 50px; left: 210px;
  width: 245px; height: 50px;
  background: radial-gradient(ellipse at top, rgba(255,249,196,0.5), transparent 100%);
  filter: blur(15px);
  transform: rotate(180deg);
  transform-origin: top left;
  z-index: 3;
  pointer-events: none;
}

/* LED Arandela */
#led-arandela {
  position: absolute; display: block;
  top: 34.1%; left: 18.1%;
  width: 33.8px; height: 0;
  border-top: 0.8px solid #fff9c4;
  transform: rotate(6.9deg) skewX(3deg);
  filter: drop-shadow(0 0 10px rgba(255,249,196,0.7)) drop-shadow(0 0 25px rgba(255,249,150,0.5));
  opacity: 1;
  transition: opacity .2s ease;
  z-index: 4;
}
#led-arandela::after {
  content: '';
  position: absolute; top: -5px; left: 35px;
  width: 50px; height: 150px;
  background: radial-gradient(ellipse at top, rgba(255,249,196,0.5), transparent 100%);
  filter: blur(15px);
  transform: rotate(180deg);
  transform-origin: top left;
  z-index: 3;
  pointer-events: none;
}

/* TV Ligada */
#tv-ligada {
  position: absolute; display: none;
  top: 187px; left: 509px;
  width: 74px; height: 61px;
  background: #00cfcf;
  clip-path: polygon(10% 0%,100% 0%,90% 100%,0% 88%);
  box-shadow: inset -4px 0 10px rgba(0,0,0,0.3);
  border: 1px solid #222;
  transform: rotate(-9deg);
  z-index: 4;
  background-image: url("data:image/svg+xml;utf8,\
<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 496 512'>\
<path fill='white' d='M248 8C111 8 0 119 0 256s111 248 248 248 \
248-111 248-248S385 8 248 8zm124 168c13.3 0 24 14.3 24 32s-10.7 \
32-24 32-24-14.3-24-32 10.7-32 24-32zm-248 0c13.3 0 24 14.3 24 \
32s-10.7 32-24 32-24-14.3-24-32 10.7-32 24-32zm248.1 159.9c-29.8 \
35.5-73.8 55.1-124.1 55.1s-94.3-19.6-124.1-55.1c-11-13.1-9.4-32.5 \
3.7-43.6 13.2-11.1 32.6-9.4 43.6 3.7 17.8 21.1 44.5 32.1 \
76.8 32.1s59-11 76.8-32.1c11-13.1 30.4-14.8 43.6-3.7 13.1 11.1 \
14.7 30.5 3.7 43.6z'/></svg>");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 30px;
}

/* Persiana Rolô */
#persiana-rolo {
  position: absolute;
  top: 22.7%; left: 60%;
  width: 133.2px; height: 12px;
  background: rgba(75,59,66,1);
  transform: rotate(-6.9deg) skewX(-6deg);
  border-top-left-radius: 6px;
  border-bottom-left-radius: 6px;
  z-index: 1;
}
#persiana-sheet {
  position: absolute;
  top: 24.5%; left: 61%;
  width: 127px; height: 0;
  background: rgba(75,59,66,0.6);
  clip-path: polygon(0% 0%,100% 0%,100% 100%,0% 89.7%);
  transform: skewY(-6.4deg);
  transition: height .2s ease;
  z-index: 1;
}
#pelicula{
  border-radius: 12px;
}

/* Fluxo de Ar (GIF) */
#ac-gif-flow {
  display: none;
  position: absolute; top: 5.5%; left: 62%;
  width: 90px; height: 250px;
  perspective: 400px; z-index: 5;
  opacity: 0.2;
}
#ac-gif-flow img {
  width:100%; height:100%;
  transform: rotateZ(90deg) rotateX(60deg);
  transform-origin: center;
}
/* LED Power do AC */
#ac-power-led {
  display: none;
  position: absolute; top: 18.9%; left: 77.5%;
  width: 5px; height: 5px;
  background: #ffeb3b;
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(255,235,59,0.7);
  z-index: 6;
}

/* LED enfermagem */
#enfermagem-led {
  display: none;
  position: absolute;
  top: 42.9%;    /* ajuste fino conforme a posição na régua */
  left: 33.3%;
  width: 6px;
  height: 9px;
  background: red;
  border: 2px solid yellow;
  border-radius: 50%;
  z-index: 6;
  animation: blink 1s steps(1) infinite;
}
@keyframes blink {
  0%, 49%   { opacity: 1; }
  50%,100%  { opacity: 0; }
}


/* ==========================================================================
   PAINEL DE CONTROLES
   ========================================================================== */

/* Container geral */
.controls-panel {
  flex: 0 0 330px;
  max-width: 330px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  padding: 1rem;
  overflow-y: auto;
}

/* Logo & Título */
.controls-panel .header {
  text-align: center;
  margin-bottom: 1rem;
}
.controls-panel .header img {
  max-width: 120px;
  margin-bottom: .5rem;
}
.controls-panel .header h5 {
  font-size: 1.2rem;
  color: #333;
}

/* Iluminação */
.controls-panel .section-illum h6 {
  margin-bottom: .75rem;
  font-size: 1rem;
  font-weight: 600;
  color: #333;
}
.controls-panel .illum-switches {
  display: flex;
  gap: .75rem;
}

/* Sliders de iluminação */
.controls-panel .illum-sliders {
  display: flex;
  gap: 1rem;
  margin-bottom: 0.8rem;
}
.controls-panel .illum-sliders .col {
  flex: 1;
  border: solid 1px lightgreen;
  border-radius: 6px;
}
.controls-panel .illum-sliders .form-label {
  font-size: .9rem;
  color: #333;
  margin-bottom: .25rem;
}
.controls-panel .illum-sliders .input-group {
  gap: .5rem;
}
.controls-panel .illum-sliders .input-group-text {
  background: none;
  border: none;
  color: #333;
  font-size: .85rem;
}
.controls-panel .illum-sliders .form-range {
  flex: 1;
  height: 6px;
  background: rgba(0,0,0,0.1);
  border-radius: 3px;
}
.controls-panel .illum-sliders .fw-bold {
  text-align: center;
  font-size: .9rem;
  margin-top: .25rem;
  color: #333;
}

/* TV */
.controls-panel .section-tv h6 {
  margin: 1rem 0 .75rem;
  font-size: 1rem;
  font-weight: 600;
  color: #333;
}
.controls-panel .tv-switch {
  margin-bottom: 1rem;
}

/* Ar-Condicionado */
.controls-panel .section-ac h6 {
  margin: 1rem 0 .75rem;
  font-size: 1rem;
  font-weight: 600;
  color: #333;
}
.controls-panel .ac-switch {
  margin-bottom: 1rem;
}

/* Persiana */
.controls-panel .section-pers h6 {
  margin: 1rem 0 .75rem;
  font-size: 1rem;
  font-weight: 600;
  color: #333;
}
.controls-panel .pers-slider {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
  margin-bottom: 1rem;
}
.controls-panel .pers-slider span {
  font-size: .9rem;
  color: #333;
}

/* Slider vertical */
.controls-panel .vertical-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 74px;   /* comprimento do track */
  height: 50px;    /* espessura do track */
  border-radius: 3px;
  transform: rotate(-90deg);
  margin: .5rem 0;
}
.controls-panel .vertical-slider::-webkit-slider-thumb,
.controls-panel .vertical-slider::-moz-range-thumb {
  width: 16px; height: 16px;
  background: #007bff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
}
.controls-panel .vertical-slider::-moz-range-track {
  background: rgba(0,0,0,0.1);
  height: 6px;
  border-radius: 3px;
}
.form-switch, .section-pers, .section-enfermagem {
  border: solid 1px lightgreen !important;
  border-radius: 6px !important;
}
.illum-sliders {
  margin-right: 0px !important;
  margin-left: 0px !important;
}
.input-group-text{
  padding: 0 0 !important;
}
.form-check-input{
  margin-left: -2em !important;
  margin-right: 0.4em !important;
}
hr {
    margin: 1rem 0;
    color: #000;
    border: 0;
    border-top: var(--bs-border-width) solid;
    opacity: 1;
}
.section-pers, .section-enfermagem {
    width: 49%;
    display: inline-block;
    height: 12.8em;
}
.section-enfermagem {
    height: 4.3em !important;
}
.enfermagem-switch{
  border: 0px !important;
}
#switch-enfermagem {
  background-color: yellow;
  height: 1.3em;
  width: 3em;
}
.section-cena {
    height: 8.3em !important;
}
.form-check-input-enfermagem:checked {
    background-position: right center;
    --bs-form-switch-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='rgba%255, 0, 0, 0.25%29'/%3e%3c/svg%3e") !important;
}
.global-section-extra{
    display: inline-grid;
}
.section-extra{
    width: 9.2em !important;
    margin-bottom: 2px;
    gap: 0rem !important;
}
#switch-bomdia, #switch-boanoite {
    background-color: cyan;
    height: 1.3em;
    width: 3em;
}

/* ==========================================================================
   WEBSOCKET - PAINEL DE MENSAGENS
   ========================================================================== */

.messages-panel {
  width: 40%;
}
#messages {
  border: 1px solid #ccc;
  padding: 10px;
  height: 568px;
  overflow-y: auto;
  margin-bottom: 20px;
  font-size: 14px;
  border-radius: 12px;
}
.message {
  margin: 5px 0;
  padding: 5px;
  border-radius: 4px;
}
.message.info {
  background-color: #e9f7ef;
  color: #155724;
}
.message.success {
  background-color: #d4edda;
  color: #155724;
}
.message.warning {
  background-color: #fff3cd;
  color: #856404;
}
.message.error {
  background-color: #f8d7da;
  color: #721c24;
}
.message.received {
  background-color: #cce5ff;
  color: #0c5460;
}
button {
  padding: 10px 20px;
  background-color: #007bff;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}
button:hover {
  background-color: #0056b3;
}

/* ----------------------------------------------------------------------------
   Película de bloqueio sobre o painel de controles
   ---------------------------------------------------------------------------- */
.controls-panel {
  position: relative; /* necessário para o overlay absoluto */
}

#controls-overlay {
  /* Remova qualquer display none !important */
  display: none;           /* começa oculto */
  position: absolute;      /* posicionamento relativo ao .controls-panel */
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255,255,255,0.9);
  z-index: 50;
  /* para centralizar o conteúdo */
  align-items: center;
  justify-content: center;
}

#controls-overlay.active {
  display: flex;  /* quando ativado, vira flexbox */
}

#controls-overlay .overlay-content {
  display: flex;
  flex-direction: column;
  align-items: center;
}

#controls-overlay .overlay-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 0.5rem;
  white-space: pre-line;
  text-align: center;
}

#controls-overlay .overlay-gif {
  width: 64px;
  height: 64px;
  margin-bottom: 0.5rem;
}

#controls-overlay #overlay-count {
  font-size: 1.5rem;
  font-weight: bold;
  color: #333;
}
