/* ============================================================================
   index.css — Estilos específicos de la página de Inicio (index.html)
   ---------------------------------------------------------------------------
   Asocia: index.html / index.js
   Contiene estilos para:
     - Formulario ZIP y bloque Spectralon
     - Log de procesamiento
     - Zona visual inferior de portada (logo + ondas)
     - Botón “Procesar y descargar” (estados)
     - Adaptaciones modo oscuro y responsive
============================================================================ */


/* ============================================================================
   1) FORMULARIO PRINCIPAL (ZIP)
============================================================================ */

/* Input group del ZIP */
#form-datos .input-group { flex-wrap: nowrap; }

/* Mensaje de nombre del ZIP cargado */
#nombre-carpeta-datos {
  font-size: .9rem;
  color: #555;
}
body.modo-oscuro #nombre-carpeta-datos {
  color: var(--c-muted);
}


/* ============================================================================
   2) LOG DE PROCESAMIENTO
============================================================================ */

/* Área del log */
textarea.form-control {
  background: #f8fcff;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  resize: none;
}
#log-area {
  white-space: pre-wrap;
  line-height: 1.25;
  overflow: auto;
}
body.modo-oscuro textarea.form-control {
  background: #0f1317;
  border-color: var(--c-border);
}


/* ============================================================================
   3) ZONA VISUAL DE PORTADA — LOGO + ONDAS
============================================================================ */

.home-visual-zone {
  position: relative;
  width: 100%;
  min-height: 300px;
  margin-top: 0.5rem;
  margin-bottom: 0.25rem;
  overflow: hidden;
  pointer-events: none;
}

/* Ondas decorativas */
.home-bg-lines {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 135vw;
  max-width: none;
  height: 210px;
  z-index: 1;
  opacity: 0.30;
  background-repeat: no-repeat;
  background-position: center bottom;
  background-size: 100% 100%;
}

/* Modo oscuro */
body.modo-oscuro .home-bg-lines {
  background-image: url("/static/img/waves-dark.svg");
  opacity: 0.34;
}

/* Modo claro */
body.modo-claro .home-bg-lines {
  background-image: url("/static/img/waves-light.svg");
  opacity: 1;
}

/* Logo centrado por delante */
.logo-app-wrapper {
  position: absolute;
  left: 50%;
  bottom: 54px;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  justify-content: center;
  align-items: center;
}

.logo-app {
  max-width: 170px;
  opacity: 0.92;
  transition: transform .3s ease;
  filter: drop-shadow(0 0 8px rgba(0, 0, 0, .10));
}

body.modo-oscuro .logo-app {
  filter: drop-shadow(0 0 10px rgba(8, 14, 24, 0.70));
}

.logo-app:hover {
  transform: scale(1.05);
}


/* ============================================================================
   4) BOTÓN “VISOR DE RESULTADOS”
============================================================================ */

#btn-proxima-funcion {
  transition: background-color 0.3s ease, transform 0.2s ease;
}
#btn-proxima-funcion:hover {
  transform: scale(1.04);
}


/* ============================================================================
   5) MODO OSCURO — Correcciones visuales
============================================================================ */

/* Texto de “ningún archivo seleccionado” o “archivo cargado” */
body.modo-oscuro #nombre-carpeta-datos {
  color: #d8e3ef !important;
  font-weight: 500;
}

/* Texto aclaratorio */
body.modo-oscuro .text-secondary,
body.modo-oscuro small {
  color: #c9d7e3 !important;
  font-weight: 400;
}


/* ============================================================================
   6) FIX — Hover del botón “Seleccionar archivo” (modo oscuro)
============================================================================ */

body.modo-oscuro input[type="file"]::-webkit-file-upload-button,
body.modo-oscuro input[type="file"]::file-selector-button {
  background: #2b3138 !important;
  color: #eaf2fa !important;
  border: 1px solid var(--c-border);
  transition: background-color 0.25s ease, color 0.25s ease;
}

body.modo-oscuro input[type="file"]::-webkit-file-upload-button:hover,
body.modo-oscuro input[type="file"]::file-selector-button:hover {
  background: #3b424c !important;
  color: #ffffff !important;
  border-color: #4b5661;
}

body.modo-oscuro input[type="file"]::-webkit-file-upload-button:active,
body.modo-oscuro input[type="file"]::file-selector-button:active {
  background: #1f2429 !important;
  color: #ffffff !important;
  border-color: #4b5661;
}


/* ============================================================================
   7)BLOQUE SPECTRALON DE REFERENCIA — Mejora visual
============================================================================ */

/* --- Modo claro --- */
.spectralon-block {
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid #d9e1e8;
  border-radius: 6px;
  padding: 12px 16px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
}

/* --- Modo oscuro --- */
body.modo-oscuro .spectralon-block {
  background: #1f252b;
  border: 1px solid #39424b;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

/* Separación superior */
.spectralon-block {
  margin-top: 1.5rem;
}


/* ============================================================================
   8) BOTÓN “PROCESAR Y DESCARGAR” — Estados
============================================================================ */

/* Deshabilitado (modo claro general) */
#btn-procesar:disabled {
  background-color: #a9c5ff !important;
  border-color: #a9c5ff !important;
  color: #e6e6e6 !important;
  cursor: not-allowed;
  opacity: 1;
}

/* Activo */
#btn-procesar {
  background-color: #007bff;
  border-color: #007bff;
  transition: background-color 0.3s ease, box-shadow 0.2s ease;
}

/* Hover */
#btn-procesar:hover {
  background-color: #0056d6;
  box-shadow: 0 0 10px rgba(0, 91, 230, 0.5);
}

/* Estado “Procesando…” */
#btn-procesar.procesando {
  background-color: #004080 !important;
  border-color: #004080 !important;
  color: #ffffff !important;
  cursor: wait;
  animation: pulsar 1.2s infinite;
}

/* Animación del estado procesando */
@keyframes pulsar {
  0% { box-shadow: 0 0 0 0 rgba(0,123,255,0.4); }
  70% { box-shadow: 0 0 0 10px rgba(0,123,255,0); }
  100% { box-shadow: 0 0 0 0 rgba(0,123,255,0); }
}


/* ============================================================================
   9) CONTRASTE — Botón “Procesar y descargar” deshabilitado
============================================================================ */

/* --- Modo oscuro --- */
body.modo-oscuro #btn-procesar:disabled {
  background-color: #2b3b55 !important;
  border-color: #32425f !important;
  color: #b0bed0 !important;
  opacity: 1;
  cursor: not-allowed;
}

/* --- Modo claro --- */
body.modo-claro #btn-procesar:disabled {
  background-color: #c7dafd !important;
  border-color: #b2c8fa !important;
  color: #6c757d !important;
  opacity: 1;
  cursor: not-allowed;
}


/* ============================================================================
   10) FIX — Texto del Spectralon por defecto (modo oscuro)
============================================================================ */

body.modo-oscuro .spectralon-block #nombre-spectralon,
body.modo-oscuro #nombre-spectralon.text-muted {
  color: #ffffff !important;
  font-weight: 500 !important;
  opacity: 1 !important;
}

#btn-ver-error {
  position: relative;
  z-index: 5;
}


