/* Base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: Arial, sans-serif;
  background-color: #f0f2f5;
  min-height: 100vh;
}

/* Top navigation */
.top-nav {
  background-color: #2c3e50;
  color: white;
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: 2rem;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.controls-group {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.filter-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.time-slider,
.day-slider {
  -webkit-appearance: none;
  width: 200px;
  height: 4px;
  background: #465670;
  border-radius: 2px;
}

.time-slider::-webkit-slider-thumb,
.day-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #3498db;
  cursor: pointer;
  border: 2px solid #ffffff;
}

.file-input-container label,
#resetTime {
  background-color: #3498db;
  color: white;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  border: none;
  font-size: 0.9rem;
  display: inline-block;
  text-align: center;
  transition: background-color 0.3s ease;
}

.file-input-container label:hover,
#resetTime:hover {
  background-color: #2980b9;
}

input[type="file"] {
  display: none;
}

.main-content {
  padding: 2rem;
}

/* Layout styles */
.areas-container {
  display: grid;
  grid-template-columns: 0.5fr 2.0fr 0.5fr;
  gap: 1rem;
  width: 100%;
}

.areas-row {
  display: contents;
}

.area {
  background: white;
  border-radius: 8px;
  width: 100%;
  min-height: calc(100vh - 140px);
  margin-bottom: 1rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.area-header {
  background-color: #3498db;
  color: white;
  padding: 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 10; /* Valor base para el header */
}

.area-header h3 {
  font-size: 1rem;
  margin: 0;
}

.area-content {
  flex: 1;
  padding: 0.5rem;
  overflow-y: auto;
  height: calc(100vh - 200px);
}

.subarea {
  background: #f8f9fa;
  border-radius: 4px;
  margin-bottom: 0.5rem;
  padding: 0.5rem;
}
.subarea-header {
  display: none;
}

/* Spots container */
.spots-container {
  display: grid;
  gap: 0.5rem;
  padding: 0.25rem;
}

.subarea {
  background: #f8f9fa;
  border-radius: 4px;
  margin-bottom: 0.5rem;
  padding: 0.25rem;  /* Reducido de 0.5rem para compensar el espacio del header removido */
}

.spot {
  background: white;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  padding: 0.5rem;
  min-height: 60px;
  display: flex;
  flex-direction: column;
}

.spot-label {
  font-size: 0.8rem;
  color: #6c757d;
  margin-bottom: 0.25rem;
}

.spot-content {
  flex: 1;
  min-height: 40px;
  background: #f8f9fa;
  border-radius: 4px;
  padding: 0.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.employee {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.7rem;
  cursor: move;
  text-align: center;
  transition: transform 0.2s ease;
  background-color: #b90808;
}

.employee.flexible {
  background-color: #ba2ecc;
}

.employee:hover {
  transform: scale(1.1);
}

.employee.dragging {
  opacity: 0.5;
}

/* Subareas specific styles */
.area[data-area="TICKETS"] .spots-container {
  grid-template-columns: 1fr;
}

.area[data-area="GATES"] .subarea[data-subarea="ACTIVE_FLIGHTS"] .spots-container {
  grid-template-columns: repeat(8, 1fr);
}

.area[data-area="GATES"] .subarea[data-subarea="NHC"] .spots-container,
.area[data-area="GATES"] .subarea[data-subarea="RED_COAT"] .spots-container,
.area[data-area="GATES"] .subarea[data-subarea="RTSM"] .spots-container {
  grid-template-columns: 1fr;
}

.area[data-area="GATES"] .subarea[data-subarea="ACTIVE_FLIGHTS"] .spot.staff-shortage {
    background-color: #ffebee; /* Fondo rojo claro */
    border: 1px solid #ef5350; /* Borde rojo */
}

.area[data-area="GATES"] .subarea[data-subarea="ACTIVE_FLIGHTS"] .spot.staff-shortage .spot-label {
      color: #d32f2f; /* Texto rojo oscuro */
}

/* Estilo para spots con staff insuficiente */
.area .subarea:not([data-subarea="RED_COAT"]):not([data-subarea="BREAKROOM"]) .spot.staff-shortage {
  background-color: #ffebee; /* Fondo rojo claro */
  border: 1px solid #ef5350; /* Borde rojo */
}

.area .subarea:not([data-subarea="RED_COAT"]):not([data-subarea="BREAKROOM"]) .spot.staff-shortage .spot-label {
  color: #d32f2f; /* Texto rojo oscuro */
}
.spot.staff-shortage {
  background-color: #ffebee; /* Fondo rojo claro */
  border: 1px solid #ef5350; /* Borde rojo */
}

.spot.staff-shortage .spot-label {
  color: #d32f2f; /* Texto rojo oscuro */
}

.area[data-area="BREAKROOM"] .spots-container {
  width: 100%; /* Ocupa todo el ancho del área */
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); /* Ajusta los elementos dinámicamente */
  gap: 1rem; /* Espaciado entre los elementos */
}

.area[data-area="GATES"] .subarea[data-subarea="RTSM"] .spots-container {
  grid-template-columns: 1fr;
}
/* Responsive adjustments */
@media (max-width: 1400px) {
  .areas-container {
    grid-template-columns: 1fr 1.5fr 0.5fr;
  }
  
  .area[data-area="GATES"] .subarea[data-subarea="ACTIVE_FLIGHTS"] .spots-container {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 1024px) {
  .controls-group {
    flex-direction: column;
    align-items: stretch;
  }
  
  .areas-container {
    grid-template-columns: 1fr 1fr;
  }
  
  .time-slider,
  .day-slider {
    width: 100%;
  }
  
  .area[data-area="GATES"] .subarea[data-subarea="ACTIVE_FLIGHTS"] .spots-container {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .main-content {
    padding: 1rem;
  }
  
  .areas-container {
    grid-template-columns: 1fr;
  }
  
  .spots-container {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}
/* Actualizar/agregar estos estilos en el archivo CSS */
/* Actualizar los estilos de los íconos de vuelo */

.flight-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
  width: 100%;
  position: relative;
  z-index: 2;
}

.flight-icon {
  width: 24px;
  height: 24px;
  fill: #6c757d; 
}

/* Color rojo para íconos cuando hay shortage de personal */
.spot.staff-shortage .flight-icon {
  fill: #ef5350;
}

.area[data-area="GATES"] .subarea[data-subarea="ACTIVE_FLIGHTS"] .spot {
  padding: 8px;
}

.area[data-area="GATES"] .subarea[data-subarea="ACTIVE_FLIGHTS"] .spot-label {
  margin-bottom: 8px;
}
/* Tooltip container */
.flight-tooltip {
  position: fixed;
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 12px;
  z-index: 9999;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.2s ease-in-out;
  pointer-events: none;
  white-space: pre-line;
  line-height: 1.4;
  width: max-content;
  max-width: 200px;
  min-width: 150px;
  transform: translate(-50%, -100%);
}


.flight-tooltip:after {
  content: "";
  position: absolute;
  bottom: -10px; /* Flecha apuntando hacia abajo */
  left: 50%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: rgba(0, 0, 0, 0.8) transparent transparent transparent;
}

/* Container del ícono con posición relativa para el tooltip */
.flight-icon-container {
  position: relative;
  cursor: help;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Mostrar tooltip al hacer hover */
.flight-icon-container:hover .flight-tooltip {
  visibility: visible;
  opacity: 1;
}

/* Ajustar el ícono */
.flight-icon {
  width: 24px;
  height: 24px;
  fill: #6c757d;
}

/* Color rojo para íconos cuando hay shortage de personal */
.spot.staff-shortage .flight-icon {
  fill: #ef5350;
}