body {
    background-color: #121212;
    color: #ffffff;
    font-family: Arial, sans-serif;
    margin: 0;
    min-height: 100vh;
}

/* Contenedor principal */
.container {
    text-align: center;
    padding: 20px;
    width: 95%;
    max-width: 1100px;
    margin: 0 auto;
    margin-bottom: 18px;      /* separa bloques verticalmente */
}

h1, h2 {
  margin: 22px 0 16px 0;    /* más espacio arriba/abajo */
}

/* Botones */
.btn {
    background-color: #1db954;
    color: white;
    border: none;
    padding: 10px 16px;
    cursor: pointer;
    font-size: 0.95em;
    border-radius: 6px;
    transition: background-color 0.2s ease;
}
.btn:hover { background-color: #1aa34a; }

.btn-ghost {
    background: transparent;
    border: 1px solid #444;
    color: #ddd;
}
.btn-ghost:hover { border-color: #777; color: #fff; }

/* Logo */
.logo {
    width: 200px;
    margin: 12px auto 4px auto;
    display: block;
}

/* Logout */
.logout-container {
    text-align: right;
    margin: 10px 20px;
    position: absolute;
    top: 0; right: 0;
}
.btn-logout {
    background-color: #ff4d4d;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9em;
}
.btn-logout:hover { background-color: #ff1a1a; }

/* === Tabla de planificación === */
.plan-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    background: #1e1e1e;
    border-radius: 8px;
    overflow: hidden;
}
.plan-table th, .plan-table td {
    border-bottom: 1px solid #2b2b2b;
    padding: 10px 8px;
    text-align: center;
    vertical-align: middle;
    font-size: 0.95em;
}
.plan-table thead th {
    position: sticky;
    top: 0;
    background: #242424;
    z-index: 1;
}
.plan-table tfoot td {
    background: #181818;
    border-top: 1px solid #2b2b2b;
}

/* Selects e inputs */
select, input[type="number"], input[type="date"] {
    width: 100%;
    padding: 6px 8px;
    font-size: 0.95em;
    border: 1px solid #3a3a3a;
    border-radius: 5px;
    background: #ffffff;
    color: #111;
    box-sizing: border-box;
}
input[type="number"] {
    text-align: center;
}

/* Fila de acciones */
.row-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
}
.btn-delete {
    background: #ff4d4d;
    border: none;
    color: #fff;
    border-radius: 50%;
    width: 28px; height: 28px;
    cursor: pointer;
    font-weight: 600;
}
.btn-delete:hover { background: #d93434; }

#output {
  margin-top: 16px;
  padding: 15px;
  background-color: #1e1e1e;
  color: #ffffff;
  font-family: monospace;
  white-space: pre-wrap;
  border-radius: 8px;
  text-align: left;
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
}

#output h2 {
  margin-top: 0 !important;
  margin-bottom: 0.3rem !important;
  text-align: center;
  font-weight: 600;
  line-height: 1.2;
}

/* === Estilos de login === */
body.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    background-color: #121212;
    color: white;
    font-family: Arial, sans-serif;
}

/* Contenedor del login */
.login-container {
    margin: 0 auto;
    width: 100%;
    max-width: 400px;
    padding: 30px;
    background-color: #1e1e1e;
    border-radius: 10px;
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.3);
    box-sizing: border-box;
    text-align: center;
}

.login-container h1 {
    margin-bottom: 20px;
    font-size: 1.8em;
    color: #ffffff;
}

.login-container input[type="email"],
.login-container input[type="password"] {
    width: calc(100% - 20px);
    padding: 10px;
    margin: 10px auto;
    display: block;
    border: 1px solid #444;
    border-radius: 5px;
    background-color: #2b2b2b;
    color: white;
    font-size: 1em;
    box-sizing: border-box;
}

.login-container .btn {
    width: calc(100% - 20px);
    padding: 10px;
    background-color: #1db954;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 1em;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin-top: 10px;
}

.login-container .btn:hover {
    background-color: #1aa34a;
}

/* === Tabla de resultados NPC === */
#npc-table-container {
    width: 100%;
    overflow-x: auto;
    margin-top: 15px;
}

#npc-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 1.15em;           /* texto un poco más grande */
    background-color: #1e1e1e;
    border-radius: 8px;
    overflow: hidden;
}

#npc-table th, #npc-table td {
    border: 1px solid #2b2b2b;
    padding: 10px 8px;
    text-align: center;
    min-width: 90px;
}

#npc-table th {
    background-color: #242424;
    color: #ffffff;
    font-weight: 600;
}

#npc-table td {
    color: #ffffff;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

#npc-table td:hover {
    transform: scale(1.05);
    box-shadow: 0 0 6px rgba(255, 255, 255, 0.2);
}

/* Colores de fondo y contraste de texto */
#npc-table td[style*="background:orange"],
#npc-table td[style*="background:yellow"] {
    color: #000000 !important;   /* texto negro sobre fondos claros */
    font-weight: 600;
}

/* Bordes redondeados en las esquinas */
#npc-table tr:first-child th:first-child { border-top-left-radius: 8px; }
#npc-table tr:first-child th:last-child  { border-top-right-radius: 8px; }
#npc-table tr:last-child td:first-child  { border-bottom-left-radius: 8px; }
#npc-table tr:last-child td:last-child   { border-bottom-right-radius: 8px; }

/* --- Bloque general: disposición horizontal --- */
#static-machines-wrapper {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 30px;
  margin-top: 20px;
  flex-wrap: wrap; /* se adapta bien si la pantalla es angosta */
}



/* --- Marcadores en el mapa --- */
.marker {
  position: absolute;
  width: 12px;
  height: 12px;
  border: 1px solid #fff;
  pointer-events: none;
  z-index: 10;
  transform-origin: center;
}

/* Pala = círculo naranjo */
.marker.pala {
  background: orange;
  border-radius: 50%;
}

/* Perfo = rombo rojo */
.marker.perfo {
  background: red;
  transform: rotate(45deg);
  border-radius: 2px;
}

/* --- Íconos visuales iguales a los del mapa --- */
.legend-icon {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 6px;
  vertical-align: middle;
}

.legend-icon.pala {
  background: orange;
  border-radius: 50%;
  border: 1px solid #fff;
}

.legend-icon.perfo {
  background: red;
  transform: rotate(45deg);
  border: 1px solid #fff;
  border-radius: 2px;
}

/* --- Contenedor horizontal (panel + mapa) --- */
#static-machines-wrapper {
  display: flex;
  align-items: stretch;          /* iguala la altura del panel y el mapa */
  justify-content: center;
  gap: 30px;
  margin-top: 20px;
  flex-wrap: wrap;               /* se adapta a pantallas pequeñas */
}

/* --- Panel izquierdo --- */
#static-machines-controls {
  display: flex;
  flex-direction: column;
  justify-content: space-between; /* separa parte superior e inferior */
  min-width: 220px;
  align-items: flex-start;
}

/* Parte superior del panel (selector y puntos) */
#static-machines-controls label {
  font-weight: bold;
}

#static-machines-controls select {
  padding: 6px;
  border-radius: 4px;
  border: 1px solid #666;
  background: #222;
  color: #eee;
}

#selected-points {
  margin-top: 8px;
  text-align: left;
  font-size: 0.9em;
}

#selected-points button {
  margin-left: 5px;
  background: #333;
  border: none;
  color: #eee;
  cursor: pointer;
  border-radius: 4px;
  padding: 2px 6px;
}

/* --- Contenedor del botón “Simular” al fondo del panel --- */
#simulate-button-container {
  display: flex;
  justify-content: flex-start;
  margin-top: auto; /* empuja hacia el borde inferior */
  width: 100%;
}

#simulate-button-container .btn {
  width: 100%;
  max-width: 140px;
}

/* --- Mapa (derecha) --- */
#mine-map-container {
  position: relative;
  display: inline-block;
  border: 2px solid #444;
  border-radius: 6px;
  overflow: hidden;
}

#mine-map {
  width: 600px;
  height: auto;
  cursor: crosshair;
}

/* === Spinner oculto por defecto === */
#spinner {
  display: none;
  text-align: center;
  margin-top: 15px;
}

/* Spinner circular animado */
.css-spinner {
  border: 4px solid rgba(255, 255, 255, 0.25);
  border-top: 4px solid white;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  animation: spin 1s linear infinite;
  display: inline-block;
  vertical-align: middle;
  margin-right: 8px;
}

/* Rotación del spinner */
@keyframes spin {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Texto “Simulando…” fijo */
#simulando-text {
  display: inline-block;
  vertical-align: middle;
  font-weight: 500;
  color: #ffffff;
  font-size: 1rem;
  white-space: nowrap;
  position: relative;
}

/* Puntos que parpadean sin mover el texto */
#simulando-text::after {
  content: "...";              /* espacio reservado */
  position: absolute;
  left: 100%;                  /* justo al final del texto */
  width: 1.5em;                /* reserva para tres puntos */
  overflow: hidden;
  animation: dotsSlide 1.4s steps(4, end) infinite;
  text-align: left;
}

/* Puntos de izquierda → derecha dentro del mismo ancho */
@keyframes dotsSlide {
  0%   { width: 0em; }
  25%  { width: 0.5em; }
  50%  { width: 1em; }
  75%,100% { width: 1.5em; }
}

/* --- Sección del spinner centrado debajo del mapa --- */
#simulate-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 18px;
}
