/* =============================================================================
   QUINTA PADEL · TORNEOS — Estilos compartidos (mismo look que index.html)
   ========================================================================== */
* { scroll-behavior: smooth; }

body {
  font-family: 'Barlow', sans-serif;
  background-color: #0f172a;
  color: #f8fafc;
}

:focus-visible {
  outline: 2px solid #22c55e;
  outline-offset: 2px;
}

[hidden] { display: none !important; }

/* Animated underline on nav links (igual que index.html) */
.nav-link {
  position: relative;
  transition: color 0.2s;
}
.nav-link::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  width: 0;
  height: 2px;
  background: #16a34a;
  transition: width 0.25s ease;
}
.nav-link:hover::after,
.nav-link[aria-current="page"]::after { width: 100%; }
.nav-link[aria-current="page"] { color: #fff; }

.section-tag {
  display: inline-block;
  background: rgba(22,163,74,0.15);
  color: #22c55e;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 4px 14px;
  border-radius: 999px;
  border: 1px solid rgba(22,163,74,0.3);
  margin-bottom: 14px;
}

/* ─────────────────────────────── Botones */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0 1.25rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s, color 0.2s, opacity 0.2s;
}
.btn:disabled,
.btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; }
/* Verde oscuro de la paleta (primary-dark) para que el texto blanco cumpla contraste AA */
.btn-primary { background: #15803d; color: #fff; }
.btn-primary:hover:not(:disabled) { background: #166534; }
.btn-ghost { background: transparent; color: #e2e8f0; border-color: rgba(255,255,255,0.2); }
.btn-ghost:hover:not(:disabled) { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.4); }
.btn-danger { background: transparent; color: #fca5a5; border-color: rgba(248,113,113,0.4); }
.btn-danger:hover:not(:disabled) { background: rgba(248,113,113,0.12); }
.btn-red { background: #dc2626; color: #fff; }
.btn-red:hover:not(:disabled) { background: #b91c1c; }
.btn-whatsapp { background: #15803d; color: #fff; }
.btn-whatsapp:hover { background: #166534; }
.btn:has(input:focus-visible) { outline: 2px solid #22c55e; outline-offset: 2px; }
.btn-sm { min-height: 36px; padding: 0 0.9rem; font-size: 0.9rem; }
.btn-icon { min-width: 44px; padding: 0; }
.btn-sm.btn-icon { min-width: 36px; }
.btn-block { width: 100%; }
.btn .spinner {
  width: 1rem;
  height: 1rem;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 999px;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─────────────────────────────── Formularios */
.label {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  color: #cbd5e1;
  margin-bottom: 0.375rem;
}
.hint { font-size: 0.85rem; color: #94a3b8; margin-top: 0.35rem; }
.input {
  width: 100%;
  min-height: 44px;
  background: #0f172a;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 12px;
  padding: 0.6rem 0.9rem;
  color: #f8fafc;
  font-size: 16px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.input:focus { outline: none; border-color: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,0.25); }
.input::placeholder { color: #64748b; }
.input:disabled, .input[readonly] { color: #94a3b8; background: rgba(15,23,42,0.6); }
.input[aria-invalid="true"] { border-color: #f87171; }
textarea.input { min-height: 96px; resize: vertical; line-height: 1.5; }
select.input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.8rem center;
  background-size: 1rem;
  padding-right: 2.4rem;
}
input[type="date"].input, input[type="time"].input { color-scheme: dark; }
.input-sm { min-height: 36px; padding: 0.35rem 0.7rem; font-size: 0.95rem; border-radius: 10px; }
.field-error { color: #fca5a5; font-size: 0.875rem; margin-top: 0.35rem; }
.check { display: flex; gap: 0.6rem; align-items: flex-start; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: #16a34a; margin-top: 2px; flex-shrink: 0; cursor: pointer; }

/* ─────────────────────────────── Tarjetas e insignias */
.card { background: #1e293b; border: 1px solid rgba(255,255,255,0.06); border-radius: 20px; }
.card-dark { background: #0f172a; border: 1px solid rgba(255,255,255,0.07); border-radius: 16px; }
.card-link { transition: border-color 0.2s, transform 0.25s ease, box-shadow 0.25s ease; }
.card-link:hover { border-color: rgba(34,197,94,0.4); box-shadow: 0 20px 40px rgba(22,163,74,0.15); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  border: 1px solid;
  white-space: nowrap;
  line-height: 1.5;
}
.badge-green  { color: #86efac; background: rgba(34,197,94,0.12);  border-color: rgba(34,197,94,0.3); }
.badge-yellow { color: #fde047; background: rgba(234,179,8,0.12);  border-color: rgba(234,179,8,0.3); }
.badge-blue   { color: #93c5fd; background: rgba(59,130,246,0.12); border-color: rgba(59,130,246,0.3); }
.badge-red    { color: #fca5a5; background: rgba(239,68,68,0.12);  border-color: rgba(239,68,68,0.3); }
.badge-gray   { color: #cbd5e1; background: rgba(148,163,184,0.1); border-color: rgba(148,163,184,0.25); }
.dot-live { width: 0.5rem; height: 0.5rem; border-radius: 999px; background: currentColor; animation: pulse 1.6s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

.notice { display: flex; gap: 0.75rem; align-items: flex-start; padding: 0.9rem 1rem; border-radius: 14px; border: 1px solid; font-size: 0.95rem; line-height: 1.5; }
.notice > svg { flex-shrink: 0; width: 1.25rem; height: 1.25rem; margin-top: 0.1rem; }
.notice-info  { color: #bfdbfe; background: rgba(59,130,246,0.08); border-color: rgba(59,130,246,0.25); }
.notice-warn  { color: #fef08a; background: rgba(234,179,8,0.08);  border-color: rgba(234,179,8,0.25); }
.notice-ok    { color: #bbf7d0; background: rgba(34,197,94,0.08);  border-color: rgba(34,197,94,0.25); }
.notice-error { color: #fecaca; background: rgba(239,68,68,0.08);  border-color: rgba(239,68,68,0.25); }

.prose-text { white-space: pre-line; line-height: 1.7; color: #cbd5e1; }

/* ─────────────────────────────── Pestañas y filtros */
.tabs { display: flex; gap: 0.25rem; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid rgba(255,255,255,0.08); }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex-shrink: 0;
  min-height: 48px;
  padding: 0 1rem;
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1.1rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #94a3b8;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}
.tab:hover { color: #e2e8f0; }
.tab[aria-selected="true"] { color: #fff; border-bottom-color: #22c55e; }

.pills { display: flex; gap: 0.5rem; overflow-x: auto; scrollbar-width: none; padding: 2px; }
.pills::-webkit-scrollbar { display: none; }
.pill {
  flex-shrink: 0;
  min-height: 40px;
  padding: 0 1rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.12);
  background: transparent;
  color: #cbd5e1;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}
.pill:hover { border-color: rgba(255,255,255,0.3); color: #fff; }
.pill[aria-pressed="true"] { background: #15803d; border-color: #15803d; color: #fff; }

/* ─────────────────────────────── Tablas */
.table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.table th {
  text-align: left;
  font-weight: 600;
  color: #94a3b8;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.5rem 0.45rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.table th.text-center { text-align: center; }
.table th.text-right { text-align: right; }
.table td { padding: 0.6rem 0.45rem; border-bottom: 1px solid rgba(255,255,255,0.05); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: center; width: 2.4rem; font-variant-numeric: tabular-nums; }
.table tr.qualified td:first-child { box-shadow: inset 3px 0 0 #22c55e; }

/* ─────────────────────────────── Ventanas (dialog) y avisos */
dialog.qp-modal {
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  width: calc(100vw - 24px);
  max-width: 640px;
  max-height: calc(100dvh - 24px);
  overflow: visible;
}
dialog.qp-modal.wide { max-width: 920px; }
dialog.qp-modal::backdrop { background: rgba(2,6,23,0.78); backdrop-filter: blur(3px); }
.qp-modal-box {
  background: #1e293b;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px;
  max-height: calc(100dvh - 24px);
  display: flex;
  flex-direction: column;
  box-shadow: 0 30px 80px rgba(0,0,0,0.5);
}
.qp-modal-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1rem 0.75rem 1.25rem; border-bottom: 1px solid rgba(255,255,255,0.07); }
.qp-modal-body { overflow-y: auto; padding: 1.25rem; }

#qp-toasts {
  position: fixed;
  z-index: 100;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: min(92vw, 420px);
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  padding: 0.8rem 1rem;
  border-radius: 14px;
  background: #0f172a;
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: 0 12px 30px rgba(0,0,0,0.45);
  font-size: 0.95rem;
  animation: toast-in 0.2s ease;
}
.toast-ok { border-color: rgba(34,197,94,0.5); }
.toast-error { border-color: rgba(239,68,68,0.6); }
.toast-warn { border-color: rgba(234,179,8,0.6); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ─────────────────────────────── Grilla de disponibilidad horaria */
.slot-grid { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.slot-btn {
  min-height: 40px;
  min-width: 66px;
  padding: 0 0.6rem;
  border-radius: 10px;
  border: 1px solid rgba(34,197,94,0.35);
  background: rgba(34,197,94,0.08);
  color: #bbf7d0;
  font-variant-numeric: tabular-nums;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}
.slot-btn:hover:not(:disabled) { border-color: rgba(34,197,94,0.7); }
.slot-btn[aria-pressed="true"] {
  border-color: rgba(239,68,68,0.6);
  background: rgba(239,68,68,0.16);
  color: #fecaca;
  text-decoration: line-through;
}
.slot-btn:disabled { cursor: default; }

/* ─────────────────────────────── Cuadro (llaves) */
.bracket { display: flex; gap: 1.25rem; overflow-x: auto; padding-bottom: 0.75rem; }
.bracket-col { display: flex; flex-direction: column; flex: 1 0 240px; min-width: 240px; }
.bracket-col .round-matches { flex: 1; display: flex; flex-direction: column; justify-content: space-around; gap: 0.75rem; }

/* ─────────────────────────────── Carga */
.skeleton {
  background: linear-gradient(90deg, rgba(255,255,255,0.04), rgba(255,255,255,0.09), rgba(255,255,255,0.04));
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 14px;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* Programación (admin) */
.sched-grid { border-collapse: separate; border-spacing: 0.4rem; min-width: 100%; }
.sched-grid th { font-size: 0.8rem; color: #94a3b8; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; text-align: left; padding: 0 0.25rem; }
.sched-grid td { vertical-align: top; min-width: 200px; }
.sched-grid td.time { min-width: 0; width: 1%; white-space: nowrap; font-variant-numeric: tabular-nums; color: #cbd5e1; font-weight: 600; padding-top: 0.6rem; }

@media print {
  body { background: #fff; color: #000; }
  #site-nav, #site-footer, .no-print { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
