/* Reset y base */
* {
  margin: 0;
  padding: 0;
  font-family: sans-serif;
  text-decoration: none;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background: #0c0c0c;
  color: white;
}

body::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at center, transparent 20%, #0c0c0c 80%);
  animation: rotateBg 60s linear infinite;
  z-index: -2;
}

@keyframes rotateBg {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* Header */
header {
  background: darkred;
  height: 80px;
  display: flex;
  align-items: center;
  padding: 0 20px;
}

a.Premos img {
  max-width: 73px;
  border-radius: 20%;
}

.navbar {
  margin-left: auto;
}

.navbar a {
  color: black;
  background: #f44336;
  padding: 0.5rem 1rem;
  margin-left: 0.5rem;
  border-radius: 4px;
  line-height: 1;
}

.navbar a:hover {
  background: #e53935;
}

/* Contenedor de métricas */
#metrics {
  max-width: 600px;
  margin: 2rem auto;
  background: #1e1e1e;
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 4px 10px rgba(0,0,0,0.5);
  animation: glow 4s alternate infinite;
}

@keyframes glow {
  from { box-shadow: 0 0 10px #e53935; }
  to   { box-shadow: 0 0 20px #2979ff; }
}

/* Título secundario */
#metrics h2 {
  margin-bottom: 1rem;
  color: #e53935;
  text-align: center;
}

/* Controles */
.controls {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 1rem;
}

.btn {
  background: #e53935;
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1rem;
  transition: background 0.3s ease;
}

.btn:hover {
  background: #d32f2f;
}

.btn[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Loader animado */
.loader {
  margin-left: 1rem;
  width: 20px;
  height: 20px;
  border: 3px solid #f44336;
  border-top: 3px solid transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* Lista de resultados */
.metrics-list {
  list-style: none;
  padding: 0;
  margin-top: 1rem;
}

.metrics-list li {
  padding: 0.75rem;
  background: #2a2a2a;
  margin-bottom: 0.5rem;
  border-radius: 4px;
  font-size: 1.1rem;
  color: #bdbdbd;
  transition: background 0.3s ease;
}

.metrics-list li:hover {
  background: #333;
}

/* Mensajes de error */
.error {
  color: #f44336;
  font-weight: bold;
  text-align: center;
  margin-top: 1rem;
}

/* Chart.js barras animadas */
canvas {
  margin-top: 1rem;
}

.chartjs-render-monitor {
  transition: all 0.5s ease-in-out;
}
