/* ============================================
   ESTILOS ESPECÍFICOS PARA REPORTE DE ALERTAS
   ============================================ */

/* Loader */
#loader {
  transition: all 0.3s ease-in-out;
  opacity: 1;
  visibility: visible;
  position: fixed;
  height: 100vh;
  width: 100%;
  background: #fff;
  z-index: 90000;
  top: 0;
  left: 0;
}

#loader.fadeOut {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

#loader[style*="display: none"] {
  display: none !important;
}

.spinner {
  width: 40px;
  height: 40px;
  position: absolute;
  top: calc(50% - 20px);
  left: calc(50% - 20px);
  background-color: #333;
  border-radius: 100%;
  -webkit-animation: sk-scaleout 1.0s infinite ease-in-out;
  animation: sk-scaleout 1.0s infinite ease-in-out;
}

@-webkit-keyframes sk-scaleout {
  0% { -webkit-transform: scale(0) }
  100% {
    -webkit-transform: scale(1.0);
    opacity: 0;
  }
}

@keyframes sk-scaleout {
  0% {
    -webkit-transform: scale(0);
    transform: scale(0);
  } 100% {
    -webkit-transform: scale(1.0);
    transform: scale(1.0);
    opacity: 0;
  }
}

/* SOLUCIÓN ESPECÍFICA SOLO PARA ESTA PÁGINA */
body.app.reporte-alertas-page {
  overflow-x: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

body.app.reporte-alertas-page::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

/* IMPORTANTE: NO modificar .page-container ni el navbar
   Estos elementos están en base.php y deben mantener sus estilos originales
   Solo modificamos el contenido dentro de #mainContent */

/* CONTENEDOR PRINCIPAL CON SCROLL */
body.app.reporte-alertas-page .main-content {
  overflow-y: auto !important;
  overflow-x: hidden !important;
  height: auto !important;
  max-height: none !important;
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
  padding: 20px !important;
}

body.app.reporte-alertas-page .main-content::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

body.app.reporte-alertas-page #mainContent {
  overflow: visible !important;
  height: auto !important;
  max-height: none !important;
  padding: 0 !important;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

body.app.reporte-alertas-page #mainContent::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

/* Aplicar padding solo al contenido interno, no al contenedor principal */
body.app.reporte-alertas-page #mainContent > .row,
body.app.reporte-alertas-page #mainContent > .masonry {
  padding: 0 !important;
}

/* MASONRY CONTAINER */
body.app.reporte-alertas-page .masonry {
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
}

/* MASONRY ITEMS */
body.app.reporte-alertas-page .masonry-item {
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
  width: 100% !important;
  max-width: 100% !important;
}

body.app.reporte-alertas-page .masonry-item.w-100 {
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
  width: 100% !important;
  max-width: 100% !important;
}

/* CONTENEDORES DE TARJETAS */
body.app.reporte-alertas-page .bd.bgc-white.p-20,
body.app.reporte-alertas-page .bd.bgc-white,
body.app.reporte-alertas-page .layers.bd.bgc-white.p-20 {
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
  min-height: auto !important;
  width: 100% !important;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  position: relative !important;
  z-index: 1 !important;
}

/* COLUMNAS PERSONALIZADAS PARA FILTROS */
.col-md-2-4 {
  flex: 0 0 20%;
  max-width: 20%;
  padding-left: 8px;
  padding-right: 8px;
}

@media (min-width: 768px) {
  .col-md-2-4 {
    flex: 0 0 20%;
    max-width: 20%;
  }
}

/* ESTILOS PARA BOTONES DEL HEADER */
.btn-transparent-red {
  background-color: transparent !important;
  border: 2px solid #dc3545 !important;
  color: #dc3545 !important;
  transition: all 0.3s ease !important;
}

.btn-transparent-red:hover {
  background-color: #dc3545 !important;
  color: white !important;
  border-color: #dc3545 !important;
}

.header-buttons {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
}

/* ESTILOS PARA FORMULARIOS */
.form-label {
  margin-bottom: 8px;
  font-weight: 500;
}

.form-group {
  margin-bottom: 10px;
}

/* Reducir altura del div de filtros */
.filters-section {
  margin-top: -10px;
}

.filters-section .bd {
  padding: 15px !important;
}

.filters-section h6 {
  margin-bottom: 12px !important;
}

.filters-section .form-label {
  margin-bottom: 5px !important;
}

.form-control {
  text-align: center;
}

/* ALINEACIÓN ESPECÍFICA PARA CAMPOS DE FECHA/HORA */
.row.justify-content-center .col-md-2-4 {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.row.justify-content-center .col-md-2-4 .form-group {
  width: 100%;
  text-align: center;
}

/* ESTILOS PARA TABLA DE RESULTADOS */
.table-container {
  max-height: 600px;
  overflow-y: auto;
  border: 1px solid #dee2e6;
  border-radius: 0.375rem;
  /* Ocultar scrollbars */
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
}

.table-container::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}

.table-responsive {
  margin: 0;
}

.table th {
  background-color: #f8f9fa;
  border-top: none;
  font-weight: 600;
  color: #495057;
  position: sticky;
  top: 0;
  z-index: 10;
}

.table td {
  vertical-align: middle;
}

.alert-badge {
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
}

.alert-critica {
  background-color: #f8d7da;
  color: #721c24;
}

.alert-advertencia {
  background-color: #fff3cd;
  color: #856404;
}

.alert-info {
  background-color: #d1ecf1;
  color: #0c5460;
}

/* ESTILOS PARA MODO OSCURO */
[data-theme="dark"] .table th {
  background-color: #343a40;
  color: #f8f9fa;
}

[data-theme="dark"] .table td {
  color: #f8f9fa;
}

[data-theme="dark"] .table-container {
  border-color: #495057;
}

[data-theme="dark"] .alert-critica {
  background-color: #2c1810;
  color: #f5c6cb;
}

[data-theme="dark"] .alert-advertencia {
  background-color: #332701;
  color: #ffeaa7;
}

[data-theme="dark"] .alert-info {
  background-color: #0c2d33;
  color: #b8daff;
}

/* CONTENEDOR DE RESULTADOS */
#reportResults {
  min-height: 500px;
}

/* ASEGURAR QUE EL SELECTOR DE TEMA SEA VISIBLE */
body.app.reporte-alertas-page .header .nav-left .theme-toggle,
body.app.reporte-alertas-page .header .nav-right .theme-toggle {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  height: 65px !important;
  align-items: center !important;
}

body.app.reporte-alertas-page .header .theme-toggle .form-check {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  margin: 0 !important;
}

body.app.reporte-alertas-page .header .theme-toggle .form-check-input {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

body.app.reporte-alertas-page .header .theme-toggle .form-check-label {
  display: inline-block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* ROW Y COLUMNAS - Asegurar que ocupen todo el ancho */
body.app.reporte-alertas-page .row {
  width: 100% !important;
  max-width: 100% !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

body.app.reporte-alertas-page .row.gap-20 {
  width: 100% !important;
}

