/* Estilos personalizados para el Tablero Operativo de Tundish */

:root {
  --color-green: #10b981;
  --color-green-dark: #059669;
  --color-green-bg: #d1fae5;
  --color-yellow: #f59e0b;
  --color-yellow-dark: #d97706;
  --color-yellow-bg: #fef3c7;
  --color-red: #ef4444;
  --color-red-dark: #dc2626;
  --color-red-bg: #fee2e2;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background-color: #0f172a;
  color: #f8fafc;
}

/* Tabla Matrix Industrial */
.table-matrix-wrapper {
  overflow-x: auto;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
  border-radius: 0.75rem;
  border: 1px solid #334155;
}

.table-matrix {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  min-width: 1280px;
}

.table-matrix th, 
.table-matrix td {
  border: 1px solid #334155;
  text-align: center;
}

/* Encabezados de Grupos según la paleta del diagrama original */
.group-header-carreton {
  background-color: #d9ead3 !important;
  color: #14532d !important;
  font-weight: 800 !important;
  border-bottom: 2px solid #86efac !important;
  letter-spacing: 0.05em;
}

.group-header-basculador {
  background-color: #c9daf8 !important;
  color: #1e3a8a !important;
  font-weight: 800 !important;
  border-bottom: 2px solid #93c5fd !important;
  letter-spacing: 0.05em;
}

.group-header-armado {
  background-color: #fce5cd !important;
  color: #7c2d12 !important;
  font-weight: 800 !important;
  border-bottom: 2px solid #fdba74 !important;
  letter-spacing: 0.05em;
}

.group-header-colada {
  background-color: #e2e8f0 !important;
  color: #1e293b !important;
  font-weight: 800 !important;
  border-bottom: 2px solid #cbd5e1 !important;
  letter-spacing: 0.05em;
}

/* Encabezados de Estaciones */
.station-header {
  background-color: #1e293b;
  color: #e2e8f0;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 8px 6px;
  vertical-align: middle;
  min-width: 88px;
  line-height: 1.25;
}

.station-std {
  display: block;
  font-size: 0.7rem;
  font-weight: 400;
  color: #94a3b8;
  margin-top: 2px;
}

/* Columna fijada de Tundish */
.tundish-col {
  background-color: #1e293b;
  color: #f8fafc;
  font-weight: 700;
  font-size: 0.88rem;
  padding: 10px 14px;
  text-align: left !important;
  min-width: 130px;
  border-right: 2px solid #475569 !important;
  position: sticky;
  left: 0;
  z-index: 10;
}

/* Celdas del tablero */
.matrix-cell {
  height: 54px;
  padding: 2px;
  position: relative;
  background-color: #0f172a;
  transition: all 0.15s ease-in-out;
}

.matrix-cell:hover:not(.is-occupied) {
  background-color: #1e293b;
  cursor: pointer;
}

.matrix-cell:hover:not(.is-occupied)::after {
  content: 'Mover aquí';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.65rem;
  color: #38bdf8;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
  background: rgba(15, 23, 42, 0.85);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px dashed #38bdf8;
}

/* Estados de los Tundish activos */
.cell-active {
  cursor: pointer;
  border-radius: 4px;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4px;
  font-weight: 700;
  box-shadow: inset 0 0 8px rgba(0,0,0,0.3);
  transition: transform 0.15s ease, filter 0.15s ease;
  position: relative;
}

.cell-active:hover {
  transform: scale(0.98);
  filter: brightness(1.15);
}

/* Colores de Semáforo exactos */
.cell-green {
  background: linear-gradient(135deg, #059669 0%, #10b981 100%);
  color: #ffffff;
  border: 1px solid #34d399;
}

.cell-yellow {
  background: linear-gradient(135deg, #facc15 0%, #f59e0b 100%);
  color: #0f172a;
  border: 1px solid #fef08a;
  font-weight: 800;
}

.cell-red {
  background: linear-gradient(135deg, #dc2626 0%, #ef4444 100%);
  color: #ffffff;
  border: 1px solid #f87171;
  animation: pulse-red 2s infinite ease-in-out;
}

@keyframes pulse-red {
  0% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
  }
  70% {
    box-shadow: 0 0 0 6px rgba(239, 68, 68, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
  }
}

.cell-time {
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  line-height: 1;
}

.cell-percent {
  font-size: 0.65rem;
  font-weight: 600;
  opacity: 0.92;
  margin-top: 2px;
}

/* Badges y Leyendas */
.badge-green {
  background-color: #064e3b;
  color: #6ee7b7;
  border: 1px solid #059669;
}

.badge-yellow {
  background-color: #78350f;
  color: #fde68a;
  border: 1px solid #d97706;
}

.badge-red {
  background-color: #7f1d1d;
  color: #fca5a5;
  border: 1px solid #dc2626;
}

/* Modal Overlay */
.modal-backdrop {
  backdrop-filter: blur(4px);
  background-color: rgba(15, 23, 42, 0.75);
}

/* Scrollbars industriales delgados */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #0f172a;
}

::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #475569;
}
