:root {
  --bg-main: #060913;
  --bg-card: rgba(13, 17, 28, 0.7);
  --border-light: rgba(255, 255, 255, 0.08);
  --blue-glow: rgba(56, 189, 248, 0.15);
  --green-glow: rgba(34, 197, 94, 0.15);
  --red-glow: rgba(244, 63, 94, 0.15);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --accent-blue: #38bdf8;
  --accent-green: #22c55e;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Outfit", sans-serif;
  background: var(--bg-main);
  background-image:
    radial-gradient(
      circle at 15% 50%,
      rgba(56, 189, 248, 0.05),
      transparent 25%
    ),
    radial-gradient(circle at 85% 30%, rgba(34, 197, 94, 0.05), transparent 25%);
  color: var(--text-main);
  min-height: 100vh;
  padding-bottom: 60px;
}

.page-shell {
  width: min(1200px, 92%);
  margin: 0 auto;
  padding-top: 40px;
  display: flex;
  flex-direction: column;
  gap: 32px;
  animation: fadeIn 0.8s ease-out;
}

/* ================= TYPOGRAPHY & UTILS ================= */
.text-white {
  color: #ffffff !important;
  font-weight: 600;
}
.text-green {
  color: var(--accent-green) !important;
}
.mb-4 {
  margin-bottom: 16px;
}

/* ================= CARDS (Equal height magic) ================= */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 24px;
  padding: 24px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  flex-direction: column;
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease,
    border-color 0.3s ease;
}

.card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

/* ================= HERO SECTION ================= */
.hero {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 32px;
  align-items: center;
}

.eyebrow {
  color: var(--accent-blue);
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-size: 0.85rem;
}

.hero h1 {
  font-size: clamp(2.5rem, 4vw, 3.5rem);
  line-height: 1.1;
  margin: 12px 0 16px;
  background: linear-gradient(to right, #fff, #94a3b8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero p {
  color: var(--text-muted);
  font-size: 1.1rem;
  line-height: 1.6;
}

.status-card {
  background: linear-gradient(
    145deg,
    rgba(15, 23, 42, 0.9),
    rgba(6, 9, 19, 0.9)
  );
  border: 1px solid var(--blue-glow);
  border-radius: 28px;
  padding: 28px;
  box-shadow: 0 0 40px var(--blue-glow);
}

.status-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

.status-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: rgba(0, 0, 0, 0.3);
  padding: 16px;
  border-radius: 16px;
  border: 1px solid var(--border-light);
}

.status-item span {
  font-size: 0.85rem;
  color: var(--text-muted);
}
.status-item strong {
  font-size: 1.2rem;
}

/* ================= DIVIDERS & TITLES ================= */
.section-divider {
  margin-top: 24px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-light);
}

.section-title {
  font-size: 1.8rem;
  margin-bottom: 8px;
}

.section-subtitle {
  color: var(--text-muted);
  font-size: 1rem;
}

.neon-blue {
  color: var(--accent-blue);
  text-shadow: 0 0 20px var(--blue-glow);
}
.neon-green {
  color: var(--accent-green);
  text-shadow: 0 0 20px var(--green-glow);
}

/* ================= GRIDS ================= */
.controls-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}

.comparison-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  align-items: stretch; /* Esto hace que tengan la misma altura */
}

/* ================= CARD INTERNALS ================= */
.summary-card p {
  color: var(--text-muted);
  margin-top: 12px;
  flex-grow: 1; /* Empuja el contenido hacia abajo y estira la tarjeta */
  line-height: 1.5;
}

.summary-header {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.summary-header span {
  font-size: 0.9rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.summary-header strong {
  font-size: 2.2rem;
  line-height: 1;
}

.highlight-card {
  border-width: 2px;
}
.green-glow {
  border-color: var(--accent-green);
  background: linear-gradient(180deg, rgba(34, 197, 94, 0.08), transparent);
}
.red-glow {
  border-color: #f43f5e;
  background: linear-gradient(180deg, rgba(244, 63, 94, 0.08), transparent);
}

/* ================= MINI INFO CARDS ================= */
.info-grid {
  grid-template-columns: repeat(3, 1fr);
}

.info-card {
  padding: 18px 24px;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
}

.info-card span {
  color: var(--text-muted);
  font-size: 0.95rem;
}
.info-card strong {
  font-size: 1.3rem;
  color: var(--accent-blue);
}

.flex-center {
  justify-content: center;
  align-items: center;
  padding: 12px;
}

/* ================= BUTTONS & INPUTS ================= */
.toggle-row {
  display: flex;
  gap: 12px;
  background: rgba(0, 0, 0, 0.3);
  padding: 8px;
  border-radius: 100px;
  border: 1px solid var(--border-light);
  margin-top: 16px;
}

.mode-button {
  flex: 1;
  padding: 12px 0;
  border-radius: 100px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.mode-button.active {
  background: var(--text-main);
  color: var(--bg-main);
  box-shadow: 0 4px 15px rgba(255, 255, 255, 0.2);
}

.primary-btn {
  width: 100%;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid var(--accent-blue);
  color: var(--accent-blue);
}

.primary-btn:hover {
  background: rgba(56, 189, 248, 0.2);
  transform: scale(1.02);
}

.danger-btn {
  background: rgba(244, 63, 94, 0.1);
  border: 1px solid #f43f5e;
  color: #f43f5e;
  width: 100%;
}
.danger-btn:hover {
  background: rgba(244, 63, 94, 0.2);
}

.connect-button {
  padding: 16px;
  border-radius: 16px;
  font-family: inherit;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.connect-button.compact {
  padding: 10px 16px;
  font-size: 0.9rem;
  border-radius: 12px;
}

.params-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-top: 16px;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.input-group label {
  font-size: 0.9rem;
  color: var(--text-muted);
}

input[type="number"] {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-light);
  color: var(--text-main);
  padding: 12px 16px;
  border-radius: 12px;
  font-family: inherit;
  font-size: 1rem;
  transition: border-color 0.3s;
}

input[type="number"]:focus {
  outline: none;
  border-color: var(--accent-blue);
}

.input-inline {
  display: flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  overflow: hidden;
}

.input-inline .currency {
  padding: 0 16px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
  height: 100%;
  display: flex;
  align-items: center;
}

.input-inline input {
  border: none;
  border-radius: 0;
  background: transparent;
}

.range-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
}

input[type="range"] {
  flex: 1;
  accent-color: var(--accent-green);
}

.badge {
  background: rgba(34, 197, 94, 0.15);
  color: var(--accent-green);
  padding: 4px 10px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
}

/* ================= PROGRESS BAR ================= */
.progress-pill {
  margin-top: auto;
  padding-top: 16px;
}
.progress-label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.progress-bar {
  height: 8px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  overflow: hidden;
}
.progress-bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--accent-blue), var(--accent-green));
  box-shadow: 0 0 10px var(--accent-green);
  transition: width 0.5s ease;
}

/* ================= EQUIPMENT LIST ================= */
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.equipment-grid-static {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.eq-item {
  background: rgba(0, 0, 0, 0.2);
  padding: 16px;
  border-radius: 16px;
  border: 1px solid var(--border-light);
}

.eq-item label {
  display: block;
  margin-bottom: 12px;
  font-weight: 600;
  color: var(--accent-blue);
}

.eq-inputs {
  display: flex;
  gap: 8px;
  align-items: center;
}

.eq-inputs input {
  width: 100%;
}
.eq-inputs span {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.equipment-item {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr auto;
  gap: 12px;
  align-items: center;
  background: rgba(0, 0, 0, 0.2);
  padding: 12px;
  border-radius: 16px;
  border: 1px solid var(--border-light);
  margin-bottom: 12px;
}

.equipment-remove {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: none;
  background: rgba(244, 63, 94, 0.15);
  color: #f43f5e;
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.2s;
}

.equipment-remove:hover {
  background: #f43f5e;
  color: white;
}

/* ================= RESPONSIVE ================= */
@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .status-grid {
    grid-template-columns: 1fr;
  }
  .info-grid {
    grid-template-columns: 1fr;
  }
  .equipment-item {
    grid-template-columns: 1fr 1fr;
  }
  .equipment-item .equipment-name {
    grid-column: span 2;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Estilos para los inputs de los nuevos equipos */
.equipment-item input {
  background-color: #1e293b; /* Color de fondo oscuro (ejemplo) */
  color: #ffffff; /* Color del texto */
  border: 1px solid #334155; /* Borde sutil */
  border-radius: 6px; /* Bordes redondeados */
  padding: 8px 12px; /* Espaciado interno */
  outline: none; /* Quita el borde azul feo al hacer clic */
}

/* Cambia el color del borde cuando haces clic/escribes */
.equipment-item input:focus {
  border-color: #3b82f6; /* Azul brillante, similar a tu neon-blue */
}

/* Estilo para el texto de "Ej: Ventilador" (Placeholder) */
.equipment-item input::placeholder {
  color: #94a3b8; /* Gris clarito para que no resalte tanto como el texto real */
}

/* ================= TARIFAS POR HORARIO ================= */
.tarifas-card {
  gap: 12px;
}

.current-rate-display {
  font-size: 0.95rem;
  color: #f59e0b;
  font-weight: 600;
  margin: 0;
}

.tarifa-header-row {
  display: grid;
  grid-template-columns: 1fr 24px 1fr 1fr 42px;
  gap: 8px;
  padding: 0 4px;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.tarifas-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tarifa-item {
  display: grid;
  grid-template-columns: 1fr 24px 1fr 1fr 42px;
  gap: 8px;
  align-items: center;
  background: rgba(0, 0, 0, 0.2);
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--border-light);
}

.tarifa-sep {
  text-align: center;
  color: var(--text-muted);
  font-size: 1rem;
}

.tarifa-item input[type="time"],
.tarifa-item input[type="number"] {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-light);
  color: var(--text-main);
  padding: 8px 10px;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.95rem;
  width: 100%;
  transition: border-color 0.3s;
}

.tarifa-item input[type="time"]:focus,
.tarifa-item input[type="number"]:focus {
  outline: none;
  border-color: #f59e0b;
}

.tarifa-item input[type="time"]::-webkit-calendar-picker-indicator {
  filter: invert(1) opacity(0.4);
  cursor: pointer;
}

.tarifa-note {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 4px;
  line-height: 1.5;
}

.label-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 400;
}

@media (max-width: 600px) {
  .tarifa-item {
    grid-template-columns: 1fr 16px 1fr 80px 36px;
    gap: 6px;
    padding: 8px 10px;
  }
  .tarifa-header-row {
    grid-template-columns: 1fr 16px 1fr 80px 36px;
    gap: 6px;
  }
}
