/* Salud PWA - estilos custom complementarios a Tailwind */

[x-cloak] { display: none !important; }

html {
  -webkit-tap-highlight-color: transparent;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

body {
  font-feature-settings: 'kern', 'liga', 'calt';
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.01em;
}

.tabular-nums, .font-mono {
  font-feature-settings: 'tnum';
  font-variant-numeric: tabular-nums;
}

/* Safe area iPhone */
@supports (padding: env(safe-area-inset-top)) {
  body {
    padding-top: env(safe-area-inset-top);
    padding-bottom: calc(env(safe-area-inset-bottom) + 5rem);
  }
  nav.fixed {
    padding-bottom: env(safe-area-inset-bottom);
  }
}

/* Scrollbar dark */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: #262626;
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: #404040; }

/* Inputs number sin spinners */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input[type=number] { -moz-appearance: textfield; }

/* Range slider acent */
input[type=range] {
  -webkit-appearance: none;
  height: 4px;
  background: #2c2c2e;
  border-radius: 999px;
  outline: none;
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  background: #ffffff;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}
/* Inputs estilo iOS */
input, select, textarea {
  font-size: 17px !important; /* evita zoom iOS */
}

/* Donut SVG ring helper */
.donut-track { stroke: #262626; }
.donut-progress { stroke: #a3e635; transition: stroke-dashoffset 0.6s cubic-bezier(0.4,0,0.2,1); }

/* Chart container - SIEMPRE altura fija para evitar bug "ampliación infinita" de Chart.js */
.chart-container { position: relative; height: 180px; width: 100%; }
.chart-container canvas { max-height: 180px !important; }

/* Calendario mensual (con !important para vencer al reset Tailwind) */
.cal-cell {
  aspect-ratio: 1 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 13px !important;
  font-family: 'SF Mono', 'Consolas', monospace !important;
  border-radius: 8px !important;
  color: #525252 !important;
  background: transparent;
}
.cal-cell.in-month { color: #d4d4d4 !important; }
.cal-cell.training-done {
  background-color: rgba(163, 230, 53, 0.22) !important;
  color: #bef264 !important;
}
.cal-cell.training-missed {
  background-color: rgba(239, 68, 68, 0.22) !important;
  color: #f87171 !important;
}
.cal-cell.hockey {
  background-color: rgba(132, 204, 22, 0.12) !important;
  color: #bef264 !important;
}
.cal-cell.today {
  outline: 2px solid #a3e635 !important;
  outline-offset: -2px !important;
}

/* Animaciones suaves */
@keyframes pulse-soft {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}
.animate-pulse-soft { animation: pulse-soft 2s ease-in-out infinite; }

/* Sticky timer descanso */
.sticky-top-safe {
  position: sticky;
  top: max(0.5rem, env(safe-area-inset-top));
  z-index: 30;
}

/* Tap targets mínimos 44px */
button, a, input[type=submit], input[type=checkbox], input[type=radio] {
  min-height: 32px;
}
