/* ============================================================================
   Ranking Interno — Estilos Complementarios (Tailwind + Custom)
   ============================================================================ */

:root {
  --primary: #c81e3a;
  --primary-dark: #9f1830;
  --secondary: #1f2937;
  --accent: #f97316;
  --success: #10b981;
  --warning: #f59e0b;
  --error: #c81e3a;
  --paper: #faf7f5;
  --shadow-color: 350 60% 20%;
}

html {
  font-family: 'Inter', ui-sans-serif, system-ui, sans-serif;
}

h1, h2, h3, h4,
.font-display {
  font-family: 'Space Grotesk', ui-sans-serif, system-ui, sans-serif;
  letter-spacing: -0.01em;
}

/* Fondo de "cancha": textura sutil de puntos que rompe el blanco plano */
.bg-court {
  background-color: var(--paper);
  background-image: radial-gradient(circle, rgba(200, 30, 58, 0.07) 1px, transparent 1px);
  background-size: 22px 22px;
}

/* Foco visible consistente y accesible en toda la app */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ============================================================================
   Animaciones
   ============================================================================ */

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

@keyframes fadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

@keyframes shimmer {
  0% {
    background-position: -200px 0;
  }
  100% {
    background-position: 200px 0;
  }
}

.animate-slide-in {
  animation: slideIn 0.3s ease-out;
}

.fade-out {
  animation: fadeOut 0.3s ease-out;
}

.animate-bounce {
  animation: bounce 1s infinite;
}

/* ============================================================================
   Componentes Personalizados
   ============================================================================ */

/* Net decoration — franja tipo red de tenis de mesa, con brillo sutil */
.net {
  height: 8px;
  border-radius: 9999px;
  background: repeating-linear-gradient(
    90deg,
    var(--primary) 0,
    var(--primary) 10px,
    transparent 10px,
    transparent 20px
  );
  position: relative;
  overflow: hidden;
  margin: 1rem 0;
}

.net::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
  background-size: 200px 100%;
  background-repeat: no-repeat;
  animation: shimmer 3.5s ease-in-out infinite;
}

/* Tab underline effect */
.tab-underline {
  position: relative;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
  cursor: pointer;
  font-weight: 500;
  color: #4b5563;
}

.tab-underline:hover {
  color: var(--primary);
}

.tab-underline.active {
  color: #111827;
  font-weight: 600;
  border-bottom-color: var(--primary);
}

/* Login / signup toggle */
.auth-toggle-btn {
  color: #6b7280;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all 0.2s ease;
}

.auth-toggle-btn:hover {
  color: var(--primary);
}

.auth-toggle-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* Gradients */
.gradient-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
}

.gradient-secondary {
  background: linear-gradient(135deg, #1f2937 0%, #374151 100%);
}

/* Botones primario/secundario reutilizables */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-weight: 700;
  color: #fff;
  background-color: var(--primary);
  padding: 0.75rem 1.5rem;
  border-radius: 0.75rem;
  box-shadow: 0 8px 20px -8px hsl(var(--shadow-color) / 0.55);
  transition: background-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

.btn-primary:hover {
  background-color: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 12px 24px -8px hsl(var(--shadow-color) / 0.6);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-weight: 600;
  color: #1f2937;
  background-color: #f3f4f6;
  padding: 0.75rem 1.5rem;
  border-radius: 0.75rem;
  transition: background-color 0.2s ease;
}

.btn-secondary:hover {
  background-color: #e5e7eb;
}

/* Cards with hover effect */
.card-hover {
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.25s ease, border-color 0.25s ease;
  cursor: pointer;
}

.card-hover:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 30px -12px hsl(var(--shadow-color) / 0.25);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.badge-success {
  background-color: rgba(16, 185, 129, 0.1);
  color: #065f46;
}

.badge-warning {
  background-color: rgba(245, 158, 11, 0.1);
  color: #78350f;
}

.badge-error {
  background-color: rgba(239, 68, 68, 0.1);
  color: #7f1d1d;
}

.badge-info {
  background-color: rgba(59, 130, 246, 0.1);
  color: #1e3a8a;
}

/* Input focus styles */
input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 3px rgba(200, 30, 58, 0.12);
}

/* Scrollbar customization */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f3f4f6;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Loading spinner */
.spinner {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border: 2px solid rgba(0, 0, 0, 0.1);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Table enhancements */
table {
  width: 100%;
  border-collapse: collapse;
}

thead {
  background-color: #f9fafb;
}

tbody tr {
  border-bottom: 1px solid #e5e7eb;
  transition: background-color 0.2s ease;
}

tbody tr:hover {
  background-color: #f9fafb;
}

/* Utility classes */
.text-truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Print styles */
@media print {
  .no-print,
  .sidebar,
  .navbar,
  .fab {
    display: none !important;
  }

  body {
    background: white;
  }

  table {
    break-inside: avoid;
  }
}

