/* ════════════════════════════════════════════════
   styles.css — Estilos compartidos de UrData
   ════════════════════════════════════════════════ */

/* ── RESET MÍNIMO ───────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }

/* ── PANTALLA (simula el móvil) ─────────────── */
body {
  background: #06192a;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  font-family: var(--font-body);
}

.screen {
  position: relative;
  width: 390px;
  height: 844px;
  background: var(--bg-base);
  border-radius: 52px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 0 10px #111, 0 40px 80px rgba(0,0,0,0.6);
}

/* ── STATUS BAR ─────────────────────────────── */
.status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-4) var(--space-6) var(--space-2);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
}
.status-bar__right {
  display: flex;
  gap: var(--space-2);
  font-size: 13px;
}

/* ── HEADER ─────────────────────────────────── */
.header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: var(--space-2) var(--space-6) var(--space-5);
}
.header__app-name {
  font-size: var(--text-xs);
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--space-1);
}
.header__title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  color: var(--text-primary);
  line-height: var(--leading-tight);
}
.header__avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--accent), var(--bg-raised));
  border: 1px solid var(--border-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.header__avatar i {
  color: var(--text-on-accent);
  font-size: 16px;
}

/* ── MAIN ───────────────────────────────────── */
main {
  flex: 1;
  overflow-y: auto;
  scrollbar-width: none;
}
main::-webkit-scrollbar { display: none; }

/* ── FOOTER Y NAV ───────────────────────────── */
footer {
  height: var(--nav-height);
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  flex-shrink: 0;
  position: relative;
  z-index: 20;
}
footer nav { height: 100%; }

footer nav ul {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 100%;
  padding: 0 var(--space-6);
}

footer nav ul li a {
  color: var(--text-secondary);
  font-size: 24px;
  transition: color var(--ease-default);
}

/* Oculta el ítem de nav sin ocupar espacio visual pero manteniendo el layout */
.nav-item--hidden { visibility: hidden; }

/* ── FAB (Floating Action Button) ───────────── */
.fab {
  position: absolute;
  left: 50%;
  bottom: var(--nav-height);
  transform: translateX(-50%);
  width: var(--fab-size);
  height: var(--fab-size);
  border-radius: var(--radius-full);
  background: var(--accent);
  color: var(--text-on-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-size: 22px;
  font-weight: var(--weight-semibold);
  box-shadow: var(--shadow-accent);
  transition: transform var(--ease-bounce), box-shadow var(--ease-default);
  z-index: 10;
  cursor: pointer;
  border: none;
}
.fab:active {
  transform: translateX(-50%) scale(0.92);
  box-shadow: var(--shadow-sm);
}
.fab i { color: var(--text-on-accent); }

/* FAB deshabilitado */
.fab.disabled {
  background: var(--bg-raised);
  color: var(--text-disabled);
  box-shadow: none;
  cursor: not-allowed;
  transform: translateX(-50%);
}
.fab.disabled i { color: var(--text-disabled); }

/* FAB píldora (con texto) */
.fab--pill {
  min-width: 160px;
  height: 52px;
  padding: 0 var(--space-6);
  border-radius: var(--radius-full);
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
}
.fab--pill i    { font-size: 18px; }
.fab--pill span { color: var(--text-on-accent); }

/* Footer de ancho completo (parameters.html) */
footer.footer--wide {
  padding: 0 var(--space-6);
  display: flex;
  align-items: center;
}
footer.footer--wide nav { width: 100%; }
footer.footer--wide nav ul { justify-content: space-between; }

/* ── BOTTOM NAV (index) ─────────────────────── */
.bottom-nav {
  height: var(--nav-height);
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0 var(--space-6);
  flex-shrink: 0;
}
.bottom-nav__item {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 20px;
  transition: color var(--ease-default);
}
.bottom-nav__item p {
  font-size: var(--text-xs);
  margin-top: var(--space-1);
}
.bottom-nav__item--active { color: var(--accent); }
.bottom-nav__fab-gap { width: var(--fab-size); }

/* ── CARD BASE ──────────────────────────────── */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform var(--ease-default), border-color var(--ease-default);
  padding: 0;
  flex-shrink: 0;
}
.card:active {
  transform: scale(0.98);
  border-color: var(--accent-border);
}
.card a {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding: var(--space-5);
  width: 100%;
  height: 100%;
}

/* Variante compleja (index) */
.card__link { display: block; padding: var(--space-5); }
.card__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--space-4);
}
.card__name {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  color: var(--text-primary);
  line-height: var(--leading-tight);
}
.card__sub {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  margin-top: var(--space-1);
}
.card__footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: var(--space-3);
  border-top: 1px solid var(--border-subtle);
}
.card__timestamp {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: var(--space-1);
}
.card__arrow { color: var(--text-secondary); font-size: 12px; }

/* Título de card genérico */
.card h3 {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  color: var(--text-primary);
  line-height: var(--leading-tight);
  margin: 0;
}

/* Descripción/meta de card genérico */
.card p {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── CARD "AÑADIR" ──────────────────────────── */
.card-add {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  border: 1.5px dashed var(--accent-border);
  border-radius: var(--radius-lg);
  background: var(--accent-dim);
  transition: background var(--ease-default);
}
.card-add:active { background: rgba(46, 196, 182, 0.12); }
.card-add__icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--accent-dim);
  border: 1px solid var(--accent-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-size: 16px;
  flex-shrink: 0;
}
.card-add__label {
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  color: var(--accent);
}
.card-add__sub {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  margin-top: var(--space-1);
}

/* ── LISTA PRINCIPAL (index) ────────────────── */
.aquarium-list {
  flex: 1;
  overflow-y: auto;
  padding: 0 var(--space-6) calc(var(--nav-height) + var(--space-8));
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  scrollbar-width: none;
}
.aquarium-list::-webkit-scrollbar { display: none; }
.list-meta {
  font-size: var(--text-xs);
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.list-end-spacer { height: var(--nav-height); flex-shrink: 0; }

/* ── LISTA VERTICAL GENÉRICA ────────────────── */
/* Para .aquariums, .parameters y cualquier lista de cards */
.list {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-6) var(--space-6);
  overflow-y: auto;
  scrollbar-width: none;
}
.list::-webkit-scrollbar { display: none; }
.list--gap-sm { gap: var(--space-3); }

/* ── PARÁMETROS (chips del index) ───────────── */
.params {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  margin-bottom: var(--space-3);
}
.param {
  background: var(--bg-raised);
  border-radius: var(--radius-sm);
  padding: 3px var(--space-2);
  display: flex;
  flex-direction: row;
  align-items: baseline;
  gap: var(--space-1);
}
.param__label {
  font-size: 10px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  white-space: nowrap;
}
.param__value {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  line-height: 1;
}
.param__value--ok     { color: var(--ok); }
.param__value--warn   { color: var(--warn); }
.param__value--danger { color: var(--danger); }
.param--more {
  background: transparent;
  border: 1px dashed var(--border-soft);
  justify-content: center;
}
.param__more-label { font-size: var(--text-xs); color: var(--text-secondary); }

/* ── BADGES ─────────────────────────────────── */
.badge {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.6px;
  text-transform: uppercase;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  flex-shrink: 0;
}
.badge--ok     { background: var(--ok-dim);     color: var(--ok);     border: 1px solid rgba(46, 196, 182, 0.3); }
.badge--warn   { background: var(--warn-dim);   color: var(--warn);   border: 1px solid rgba(255, 209, 102, 0.3); }
.badge--danger { background: var(--danger-dim); color: var(--danger); border: 1px solid rgba(255, 107, 107, 0.3); }

/* ── FORMULARIOS ─────────────────────────────── */
.form {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  padding: var(--space-2) var(--space-6) var(--space-6);
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

/* Fila horizontal (label + input en línea) */
.form-field--row {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
}

label {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

input[type="text"],
input[type="number"],
input[type="email"],
textarea,
select {
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border-soft);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: var(--text-base);
  padding: var(--space-4);
  border-radius: var(--radius-md);
  transition: border-color var(--ease-default), box-shadow var(--ease-default);
}

textarea {
  min-height: 100px;
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

input::placeholder,
textarea::placeholder {
  color: var(--text-disabled);
}

/* Input numérico: quitar flechas */
input[type="number"] { -moz-appearance: textfield; }
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

/* Sufijo junto a un input (ej: "L" de litros) */
.input-suffix {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.input-suffix span {
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  color: var(--text-secondary);
  white-space: nowrap;
}

/* ── BOTÓN PRIMARIO ──────────────────────────── */
.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-4);
  background: var(--accent);
  color: var(--text-on-accent);
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: var(--shadow-accent);
  transition: transform var(--ease-bounce), box-shadow var(--ease-default);
  cursor: pointer;
  width: 100%;
}
.btn-primary:active {
  transform: scale(0.97);
  box-shadow: var(--shadow-sm);
}

/* ── BOTÓN DASHED "AÑADIR" ───────────────────── */
.btn-add {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-3) var(--space-4);
  background: transparent;
  border: 1.5px dashed var(--accent-border);
  border-radius: var(--radius-md);
  color: var(--accent);
  font-family: var(--font-body);
  font-weight: var(--weight-semibold);
  font-size: var(--text-sm);
  transition: background var(--ease-default);
  cursor: pointer;
  width: 100%;
}
.btn-add:active { background: var(--accent-dim); }

/* ── COLOR GRADIENT (barra de escala de colores) */
.color-gradient {
  display: flex;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid rgba(0,0,0,0.1);
}
.color-gradient span { flex: 1; }

/* ── CIRCLE (reticulo JS en white-point y color-point) */
.circle {
  pointer-events: none;
  border: 2px solid #111 !important;
  box-shadow: 0 0 0 2px #fff, var(--shadow-sm);
  animation: pop-in var(--ease-bounce);
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  position: absolute;
}
@keyframes pop-in {
  0%   { transform: scale(0.5); opacity: 0; }
  100% { transform: scale(1);   opacity: 1; }
}

/* ── ANIMACIÓN SLIDE-UP (point-result) ──────── */
@keyframes slide-up {
  from { transform: translateY(12px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

/* ── PARÁMETROS (lista parameters.html) ─────── */
.parameters {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: var(--space-2) var(--space-6) var(--space-6);
}

.parameter { display: block; }

.parameter a {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--bg-surface);
  padding: var(--space-5) var(--space-4);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-sm);
  height: 100%;
  transition: transform var(--ease-default), border-color var(--ease-default);
}
.parameter a:active {
  transform: scale(0.96);
  border-color: var(--accent-border);
}

.parameter h3 {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  color: var(--accent);
  line-height: var(--leading-tight);
  margin-bottom: var(--space-1);
  flex-grow: 0.5;
}
.parameter h3 sub {
  font-size: var(--text-md);
  color: var(--text-secondary);
}
.parameter__meta {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  align-items: end;
  flex-grow: 0.5;
}
.parameter p {
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  color: var(--text-secondary);
  background: var(--bg-raised);
  padding: 4px var(--space-2);
  border-radius: var(--radius-sm);
  width: fit-content;
  text-transform: capitalize;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* ── PARAMETER — tipos ─────────────────────── */
.parameter a {
  align-items: flex-start;
  gap: var(--space-3);
}

.parameter__icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: var(--accent-dim);
  border: 1px solid var(--accent-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-size: 16px;
  flex-shrink: 0;
}
.parameter__icon--numeric {
  background: rgba(69, 123, 157, 0.10);
  border-color: rgba(69, 123, 157, 0.25);
  color: var(--text-secondary);
}

.parameter__body {
  flex: 1;
  min-width: 0;
}
.parameter__gradient {
  height: 10px;
  margin-top: var(--space-2);
  border-radius: var(--radius-sm);
}
.parameter__range {
  font-size: var(--text-xs) !important;
  color: var(--text-secondary) !important;
  background: transparent !important;
  padding: 0 !important;
  margin-top: var(--space-1);
  text-transform: none !important;
}

.parameter__meta {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  align-items: flex-end;
  flex-shrink: 0;
}
.parameter__meta > p {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  background: transparent;
  padding: 0;
  white-space: nowrap;
}

.parameter__type-badge {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  padding: 3px var(--space-2);
  border-radius: var(--radius-full);
  letter-spacing: 0.4px;
}
.parameter__type-badge--color {
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid var(--accent-border);
}
.parameter__type-badge--numeric {
  background: rgba(69, 123, 157, 0.10);
  color: var(--text-secondary);
  border: 1px solid rgba(69, 123, 157, 0.20);
}

.parameter--color > a { border-left: 3px solid var(--accent); }
.parameter--numeric > a { border-left: 3px solid rgba(69, 123, 157, 0.4); }

/* ── UTILIDADES COMPARTIDAS ─────────────────── */

/* Separador horizontal */
.divider {
  height: 1px;
  background: var(--border-subtle);
  margin: var(--space-2) 0;
}

/* Botón de acción destructiva */
.btn-danger {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  width: 100%;
  padding: var(--space-4);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  background: rgba(231,111,81,0.10);
  color: var(--danger);
  border: 1.5px solid rgba(231,111,81,0.3);
  cursor: pointer;
  text-decoration: none;
  transition: background var(--ease-default), border-color var(--ease-default);
}
.btn-danger:active {
  background: rgba(231,111,81,0.18);
  border-color: var(--danger);
}

/* Título de sección dentro de formularios */
.form-section-title {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: var(--space-3);
}