/* ============================================================
   Dulce Espera — extra tool components ("Atardecer" system)
   Only loaded on the advanced tool pages (patadas, peso-embarazo,
   contracciones, concepcion, test-embarazo). All classes prefixed
   with x-. Mobile-first, large touch targets.
   ============================================================ */

/* ---------- big tap button (kick counter, contraction timer) ---------- */
.x-tap-btn {
  display: block;
  width: 100%;
  min-height: 104px;
  padding: 1.25rem 1rem;
  font-size: 1.3rem;
  font-weight: 800;
  font-family: var(--font-sans);
  color: #fff;
  background: linear-gradient(135deg, #b65176 0%, var(--rose-700) 60%, #9c3a5c 100%);
  border: none;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: var(--shadow-glow);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.x-tap-btn:hover { filter: brightness(1.06); }
.x-tap-btn:active { transform: scale(0.97); }
.x-tap-btn .x-tap-sub {
  display: block;
  font-size: 0.86rem;
  font-weight: 600;
  opacity: 0.92;
  margin-top: 0.25rem;
}
.x-tap-btn.is-active {
  background: linear-gradient(135deg, #4a2b40, var(--night) 70%);
}
.x-tap-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

/* ---------- big timer display ---------- */
.x-timer {
  font-family: var(--font-display);
  font-weight: 560;
  font-size: clamp(3.4rem, 15vw, 5.2rem);
  line-height: 1;
  color: var(--plum-900);
  text-align: center;
  font-variant-numeric: tabular-nums;
  margin: 0.4rem 0;
  letter-spacing: -0.02em;
}
.x-timer-label {
  text-align: center;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--plum-500);
  margin-bottom: 0.8rem;
}
.x-count-big {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.4rem, 10vw, 3.4rem);
  background: linear-gradient(120deg, var(--rose-600), var(--rose-700));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-align: center;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

/* ---------- mode toggle (two-option switch) ---------- */
.x-mode-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  margin-bottom: 1.2rem;
  background: var(--cream-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.35rem;
}
.x-mode-toggle button {
  min-height: 54px;
  padding: 0.7rem 0.6rem;
  font-size: 0.95rem;
  font-weight: 800;
  font-family: var(--font-sans);
  color: var(--plum-700);
  background: transparent;
  border: none;
  border-radius: 999px;
  cursor: pointer;
}
.x-mode-toggle button[aria-pressed="true"] {
  background: var(--night);
  color: #fff;
  box-shadow: var(--shadow-s);
}

/* ---------- scrollable tables (mobile) ---------- */
.x-scroll { background: var(--white); margin: 1rem 0 0; }
.x-table {
  width: 100%;
  min-width: 540px;
  border-collapse: collapse;
  font-size: 0.94rem;
}
.x-table caption {
  text-align: left;
  font-weight: 600;
  font-family: var(--font-display);
  font-size: 1.05rem;
  padding: 0.9rem 1rem 0.4rem;
  color: var(--plum-900);
}
.x-table th,
.x-table td {
  text-align: left;
  padding: 0.7rem 1rem;
  border-top: 1px solid var(--line);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.x-table thead th {
  border-top: none;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--plum-500);
}
.x-table tbody tr:nth-child(even) { background: var(--cream); }
.x-table .x-ok { color: var(--sage-700); font-weight: 800; }
.x-table .x-no { color: var(--plum-500); }

/* ---------- chart container ---------- */
.x-chart {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  padding: 1rem 0.6rem 0.6rem;
  margin-top: 1rem;
  box-shadow: var(--shadow-s);
}
.x-chart svg { width: 100%; height: auto; display: block; }
.x-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.2rem;
  font-size: 0.85rem;
  color: var(--plum-700);
  padding: 0.4rem 0.6rem 0.2rem;
}
.x-chart-legend .swatch {
  display: inline-block;
  width: 16px;
  height: 10px;
  border-radius: 3px;
  margin-right: 0.35rem;
  vertical-align: baseline;
}

/* ---------- two-button action row ---------- */
.x-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
  margin-top: 1rem;
}
@media (max-width: 420px) {
  .x-actions { grid-template-columns: 1fr; }
}

/* ---------- danger (ghost) button ---------- */
.x-btn-danger {
  background: transparent;
  color: var(--rose-700);
  border: 2px solid var(--rose-200);
  box-shadow: none;
}
.x-btn-danger:hover { background: var(--rose-50); color: var(--rose-700); filter: none; }

/* ---------- session state helpers ---------- */
.x-live-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--sage-700);
  margin-right: 0.4rem;
  box-shadow: 0 0 0 4px rgba(46, 107, 58, 0.18);
}
@keyframes x-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}
/* motion: transitions/animations only when the user wants them */
@media (prefers-reduced-motion: no-preference) {
  .x-tap-btn { transition: transform 0.08s ease, filter 0.2s ease; }
  .x-mode-toggle button { transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease; }
  .x-live-dot { animation: x-pulse 1.6s ease-in-out infinite; }
}
