
/* ===================== FONDO NEGRO GLOBAL ===================== */
html, body {
  background-color: #000;
  color: #c0c0c0;
  margin: 2vh;
  padding: 0;
  font-family: "Segoe UI", sans-serif;
}

/* ===================== HEADER PRINCIPAL ===================== */
header.header-principal {
  background-color: #000;
  color: #c0c0c0;
  padding: 0.6em 1em;
  margin: 0;
  border: none;
  box-shadow: none;
}

.top-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo img {
  height: 70px;
  margin-left: 20px; 
  margin-top: 20px;  
}

.titulo-sitio {
  font-size: 2.5em;
  font-weight: bold;
  color: white;
  text-shadow: 0 0 10px #007aff;
}

.info-cliente-linea {
  width: 100%;
  text-align: center;
  margin-top: 0.4em;
  font-size: 0.95em;
  color: #fff;
}

.reloj {
  font-family: 'Roboto Mono', monospace;
  font-size: 1.9em;
  color: #00ffcc;
  text-shadow: 0 0 6px #00ffccaa;
  letter-spacing: 0.05em;

  font-variant-numeric: tabular-nums;
  white-space: nowrap;

  width: 10ch;        /* espacio fijo para '00:00:00' */
  text-align: center;
  display: inline-block;
}

/* ===================== TITULOS Y TARJETAS ===================== */
.titulo-blanco {
	color: #00ffccaa;
	text-align: center;
	margin: 0 0 0.6rem 0;
}
.card {
	background-color: #0b0b0b;
	color: #007aff;
	padding: 10px;
	border-radius: 6px;
	border: 1px solid #007aff;
	box-shadow: 0 0 10px #007aff66;
}
/* ===================== ESTRUCTURA DASHBOARD ===================== */
.dashboard-main {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 40px);
  box-sizing: border-box;
  padding: 10px;
  gap: 10px;
  background-color: #0b0b0b;
  color: #007aff;
}

.dashboard-fila {
  display: flex;
  height: 100vh;
  gap: 10px;
  min-height: 0;
}

#seccion-controles,
#seccion-grafico,
#seccion-parametros {
  height: 95%;
  min-height: 0;
}

/* ===================== SECCIONES ===================== */
#seccion-controles, #seccion-parametros {
  flex: 1;
  min-width: 250px;
  background-color: #0b0b0b;
  color: #007aff;
  padding: 10px;
  border-radius: 6px;
  border: 1px solid #007aff;
  box-shadow: 0 0 10px #007aff66;
}

#seccion-grafico {
  flex: 2;
  background-color: #0b0b0b;
  color: #007aff;
  padding: 10px;
  border-radius: 6px;
  border: 1px solid #007aff;
  box-shadow: 0 0 10px #007aff66;
  display: flex;
  justify-content: center;
  align-items: center;
}

#seccion-grafico canvas {
  max-height: 100%;
  height: 100%;
}

/* ===================== ESTILO CONTROLES ORDENADOS ===================== */
.controles-grid {
  display: grid;
  grid-template-areas:
    "parametros frecuencia"
    "archivos eventos"
    "power     power";
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto auto;
  gap: 10px;
}

.ctrl-parametros  { grid-area: parametros; }
.ctrl-frecuencia  { grid-area: frecuencia; }
.ctrl-archivos    { grid-area: archivos; }
.ctrl-eventos     { grid-area: eventos; }
.ctrl-power       { grid-area: power; }

.controles-grid .btn {
  width: 100%;
  padding: 1em;
  text-align: center;
  font-size: 1em;
}

/* ===================== PARÁMETROS ===================== */
.parametros-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.6em;
  text-align: center;
}

.parametro {
  background: #111;
  padding: 0.5em;
  border-radius: 4px;
  box-shadow: inset 0 0 5px #007aff33;
  border: 1px solid #007aff;
}

.parametro label {
  display: block;
  font-size: 0.85em;
  color: #007aff;
  margin-bottom: 0.3em;
}

.parametro span {
  font-size: 1.4em;
  font-weight: bold;
  color: #007aff;
}

.parametro input, .parametro button, .parametro select {
  width: 100%;
  padding: 0.5em;
  background: #111;
  color: #007aff;
  border: 1px solid #007aff;
  border-radius: 5px;
}

.parametro button:hover,
.parametro select:hover {
  background-color: #222;
}

/* ===================== LOGS ===================== */
#seccion-logs.logs {
  height: 150px;
  background-color: #0b0b0b;
  color: #007aff;
  padding: 10px;
  overflow-y: auto;
  border-radius: 10px;
  border: 1px solid #007aff;
  box-shadow: 0 0 10px #007aff66;
}

/* ===================== TOOLTIP ===================== */
.tooltip {
  position: relative;
  display: inline-block;
  cursor: help;
}

.tooltip::after {
  content: attr(data-tooltip);
  visibility: hidden;
  background-color: #111;
  color: #00e5ff;
  text-align: center;
  border-radius: 6px;
  padding: 6px 10px;
  position: absolute;
  z-index: 10;
  bottom: 120%;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: 0.75rem;
  opacity: 0;
  transition: opacity 0.3s;
  box-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
}

.tooltip:hover::after {
  visibility: visible;
  opacity: 1;
}

/* ===================== FOOTER ===================== */
footer.footer {
  background-color: #0b0b0b;
  color: #888;
  padding: 0.5em 1em;
  font-size: 0.85em;
  width: 100%;
}

/* ===================== BOTONES ===================== */
.btn, .btn-guardar, .btn-descargar, .btn-power {
  border-radius: 6px;
  padding: 0.6em 1.2em;
  font-size: 1em;
  font-weight: bold;
  cursor: pointer;
  transition: 0.3s ease;
}

.btn {
  background: #111;
  color: #007aff;
  border: 1px solid #007aff;
}

.btn:hover {
  background: #222;
  box-shadow: 0 0 10px #007aff88;
}

.btn-guardar {
  background: #007aff;
  color: #fff;
  border: none;
}

.btn-guardar:hover {
  background: #00aaff;
}

.btn-descargar {
  background: transparent;
  color: #00ffff;
  border: 1px solid #00ffff;
}

.btn-descargar:hover {
  background: #001f1f;
}

.btn-power {
  background: #111;
  color: #00ff00;
  border: 2px solid #00ff00;
  box-shadow: 0 0 10px #00ff0033;
}

.btn-power.off {
  color: #ff0033;
  border-color: #ff0033;
  box-shadow: 0 0 10px #ff003333;
}

/* ===================== MODAL CONFIGURACIÓN ===================== */
.modal {
  position: fixed;
  z-index: 999;
  left: 0; top: 0;
  width: 100%; height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-contenido {
  background-color: #0b0b0b;
  padding: 20px;
  border: 1px solid #007aff;
  border-radius: 10px;
  box-shadow: 0 0 10px #007aff66;
  width: 90%;
  max-width: 700px;
  color: #fff;
}

.modal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1em;
  margin-top: 1em;
}

.modal-parametro label {
  font-size: 0.85em;
  color: #007aff;
  margin-bottom: 0.2em;
  display: block;
}

.modal-parametro input {
  width: 100%;
  padding: 0.4em;
  font-size: 0.95em;
  background: #111;
  color: #00eaff;
  border: 1px solid #007aff;
  border-radius: 5px;
}

/* Tamaño de fuente reducido para tabla de logs en modal */
#modalLogs #tablaLogs table {
  font-size: 0.75em;
}

#modalLogs #tablaLogs th,
#modalLogs #tablaLogs td {
  padding: 0.2em;
}
#btnPower {
  padding: 12px 20px;
  font-size: 1.2em;
  font-weight: bold;
  border-radius: 8px;
  cursor: pointer;
  border: none;
  transition: background 0.3s, color 0.3s;
}

.power-on {
  background-color: #00ff00;
  color: #10152b;
  box-shadow: 0 0 10px #00ff00;
}

.power-off {
  background-color: #ff0033;
  color: #ffffff;
  box-shadow: 0 0 10px #ff0033;
}
/* ================= VUMETRO ANIMADO HORIZONTAL ================= */
.vumetro {
  display: flex;                   /* Barras en fila horizontal */
  justify-content: center;        /* Centrado horizontal */
  align-items: center;            /* Centrado vertical */
  gap: 6px;                       /* Espacio entre barras */
  margin-top: 10px;
  height: 20px;                   /* Altura del vumetro */
}

/* Estilo base de cada barra */
.vumetro .barra {
  width: 10px;                    /* Grosor de barra */
  height: 100%;                   /* Ocupa todo el alto del vumetro */
  background-color: #00ff88;
  opacity: 0.2;
  border-radius: 4px;
  animation: encenderBarra 1s ease-in-out infinite;
  animation-play-state: paused;   /* Se activa dinámicamente */
  transition: opacity 0.2s ease-in-out;
}

/* Secuencia escalonada de animación */
.vumetro .barra:nth-child(1) { animation-delay: 0s; }
.vumetro .barra:nth-child(2) { animation-delay: 0.1s; }
.vumetro .barra:nth-child(3) { animation-delay: 0.2s; }
.vumetro .barra:nth-child(4) { animation-delay: 0.3s; }
.vumetro .barra:nth-child(5) { animation-delay: 0.4s; }
.vumetro .barra:nth-child(6) { animation-delay: 0.5s; }
.vumetro .barra:nth-child(7) { animation-delay: 0.6s; }
.vumetro .barra:nth-child(8) { animation-delay: 0.7s; }
.vumetro .barra:nth-child(9) { animation-delay: 0.8s; }
.vumetro .barra:nth-child(10) { animation-delay: 0.9s; }

/* Animación horizontal tipo onda */
@keyframes encenderBarra {
  0%, 100% {
    opacity: 0.2;
    transform: scaleX(1);
  }
  50% {
    opacity: 1;
    transform: scaleX(1.6);
  }
}
/* ====================== TOAST FLOTANTE ====================== */
.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background-color: #1e1e1e;
  color: #00f0ff;
  padding: 12px 20px;
  border: 1px solid #00f0ff;
  border-radius: 6px;
  box-shadow: 0 0 10px #00f0ff88;
  font-size: 14px;
  z-index: 9999;
  opacity: 0;
  animation: aparecer 0.4s ease-out forwards, desaparecer 0.4s ease-in 4s forwards;
}

@keyframes aparecer {
  from { opacity: 0; transform: translateX(-50%) translateY(20px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@keyframes desaparecer {
  to { opacity: 0; transform: translateX(-50%) translateY(-20px); }
}
/* =================== MODAL LOG EN VIVO + ACORDEÓN =================== */
.acordeon-btn {
  width: 100%;
  text-align: left;
  background-color: #0b0b0b;
  border: 1px solid #00f0ff;
  padding: 12px;
  color: #00ffcc;
  font-size: 1em;
  cursor: pointer;
  border-radius: 6px;
  margin-bottom: 6px;
  transition: background 0.2s ease;
}

.acordeon-btn:hover {
  background-color: #10152b;
}

.acordeon-panel {
  background-color: #0b0b0b;
  border-left: 1px solid #00f0ff;
  border-right: 1px solid #00f0ff;
  border-bottom: 1px solid #00f0ff;
  border-radius: 0 0 6px 6px;
  padding: 10px;
  display: none;
  margin-bottom: 1em;
}

.log-live {
  background: #000;
  border: 1px solid #00f0ff;
  border-radius: 6px;
  padding: 10px;
  font-family: monospace;
  font-size: 12px;
  color: #00ffcc;
  height: 200px;
  overflow-y: auto;
  white-space: pre-wrap;
  box-shadow: 0 0 10px #00f0ff66;
}

.btn-modal, .btn-parametro {
  background: #000;
  border: 1px solid #00f0ff;
  color: #00ffcc;
  padding: 10px 20px;
  border-radius: 6px;
  box-shadow: 0 0 10px #00f0ff88;
  cursor: pointer;
  transition: background 0.3s ease;
}

.btn-modal:hover, .btn-parametro:hover {
  background: #00f0ff;
  color: black;
}
.ctrl-frecuencia {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  position: relative;
}

.ctrl-frecuencia select {
  margin-bottom: 4px;
}

.ctrl-frecuencia #valFrecuencia {
  text-align: right;
  font-size: 0.9em;
  color: #00ff88;
  padding-top: 2px;
}


/* 1. Evita scroll vertical y horizontal */
html, body {
  margin: 0;
  padding: 0;
  overflow: hidden;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
}

/* 2. Asegura que el main no se desborde */
main {
  overflow: hidden;
  flex: 1;
}

/* 3. Corrige cualquier overflow interno */
#seccion-controles,
#seccion-grafico,
#seccion-parametros {
  overflow: hidden;
}

/* 4. Opcional: diagnosticar desbordes */
* {
  box-sizing: border-box;
}
/* ======================== MODO DE CONTROL ======================== */

/* Estilo general del contenedor */
#modoControl {
  display: flex;              /* coloca en fila */
  align-items: center;        /* centra verticalmente */
  justify-content: center;    /* centra horizontalmente */
  gap: 0.5em;                 /* espacio entre los elementos */
  font-weight: bold;
  color: #007aff;
}

/* Estilo base del texto del modo */
#modoControl span {
  margin-left: 0.3em;
}

/* Modo desconocido */
.modo-desconocido {
  background-color: #555;
  color: #ccc;
  border: 1px solid #999;
}

/* Modo REMOTO */
.modo-remoto {
  background-color: #002b80;
  color: #00cfff;
  border: 1px solid #00cfff;
  box-shadow: 0 0 6px #00cfff;
}

/* Modo MANUAL (LOCAL) */
.modo-manual {
  background-color: #333300;
  color: #ffff00;
  border: 1px solid #ffff00;
  box-shadow: 0 0 6px #ffff00;
}

/* Modo EMERGENCIA */
.modo-emergencia {
  background-color: #4d0000;
  color: #ff3333;
  border: 1px solid #ff3333;
  box-shadow: 0 0 6px #ff3333;
}

