/* =============================================================
   SITE.CSS — Rey de la Cancha
   Reglas PROPIAS que NO existen en theme-unified.css
   (Variables, cards, forms, modals, alerts, overrides → theme-unified.css)
   ============================================================= */

/* ===== GRADIENTES (únicos de site.css) ===== */
:root {
  --primary-dark: #4f46e5;
  --primary-light: #818cf8;
  --secondary-dark: #d97706;
  --success-dark: #059669;
  --gradient-1: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --gradient-2: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  --gradient-3: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  --gradient-4: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
  --gradient-5: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

/* ===== TIPOGRAFÍA ===== */
html {
  font-size: 14px;
  position: relative;
  min-height: 100%;
}

@media (min-width: 768px) {
  html { font-size: 16px; }
}

/* ===== ANIMACIONES ===== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

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

.slide-in-up {
  animation: slideInUp 0.8s ease-out forwards;
}

@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-50px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(50px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

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

@keyframes shine {
  to { background-position: 200% center; }
}

.fade-in { 
  animation: fadeIn 0.6s ease-out; 
  will-change: opacity;
}
.slide-in-left { 
  animation: slideInLeft 0.6s ease-out; 
  will-change: transform, opacity;
}
.slide-in-right { 
  animation: slideInRight 0.6s ease-out; 
  will-change: transform, opacity;
}

/* ===== BOTONES CON GRADIENTES (propios) ===== */

.btn:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

.btn-primary {
  background: var(--gradient-1);
  color: white;
}

.btn-success {
  background: var(--success);
  color: white;
}

[data-theme="dark"] .btn-success {
  background: var(--success);
  color: #000;
}

.btn-warning {
  background: var(--gradient-5);
  color: #000;
}

.btn-danger {
  background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
  color: white;
}

.btn-lg {
  padding: 16px 32px;
  font-size: 1.1rem;
  border-radius: 16px;
}

/* ===== BADGES ===== */
.badge {
  border-radius: 8px;
  padding: 6px 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* ===== PROGRESO (con variante oscura) ===== */
.progress {
  border-radius: 10px;
  height: 12px;
  background: var(--bg-tertiary);
  overflow: hidden;
}

[data-theme="dark"] .progress {
  background: var(--bg-elevated, #1c1c1c);
}

.progress-bar {
  border-radius: 10px;
  background: var(--gradient-4);
  transition: width 0.6s ease;
}

/* ===== GLASSMORPHISM ===== */
.glass {
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 20px;
}

[data-theme="dark"] .glass {
  background: rgba(18, 18, 18, 0.6);
  border-color: rgba(255, 255, 255, 0.08);
}

/* ===== TEXTOS CON GRADIENTE ===== */
.text-gradient {
  background: var(--gradient-1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ===== ICONOS Y EMOJIS ===== */
.emoji-large {
  font-size: 3rem;
  animation: bounce 2s infinite;
}

/* ===== SEPARADORES ===== */
hr {
  border: none;
  height: 3px;
  background: var(--gradient-1);
  border-radius: 10px;
  margin: 2rem 0;
}

/* ===== SOMBRAS PERSONALIZADAS ===== */
.shadow-custom {
  box-shadow: 0 10px 30px rgba(99, 102, 241, 0.3);
}

.shadow-success {
  box-shadow: 0 10px 30px rgba(16, 185, 129, 0.3);
}

.shadow-warning {
  box-shadow: 0 10px 30px rgba(245, 158, 11, 0.3);
}

/* ===== HOVER EFFECTS ===== */
.hover-scale {
  transition: transform 0.3s ease;
}

.hover-scale:hover {
  transform: scale(1.05);
}

/* ===== BOTÓN CAMBIO DE TEMA ===== */
.theme-toggle {
  position: relative;
  width: 60px;
  height: 32px;
  background: var(--bg-tertiary);
  border-radius: 50px;
  border: 2px solid var(--border-color);
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  padding: 4px;
  overflow: hidden;
}

.theme-toggle:hover {
  transform: scale(1.05);
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.3);
}

.theme-toggle-slider {
  position: absolute;
  width: 24px;
  height: 24px;
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  border-radius: 50%;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .theme-toggle-slider {
  transform: translateX(28px);
  background: linear-gradient(135deg, #818cf8 0%, #6366f1 100%);
}

.theme-icon {
  pointer-events: none;
}

/* ===== RESPONSIVE THEME TOGGLE ===== */
@media (max-width: 768px) {
  .btn-lg {
    padding: 12px 24px;
    font-size: 1rem;
  }
  
  .theme-toggle {
    width: 50px;
    height: 28px;
  }
  
  .theme-toggle-slider {
    width: 20px;
    height: 20px;
    font-size: 12px;
  }
  
  [data-theme="dark"] .theme-toggle-slider {
    transform: translateX(22px);
  }
}

/* ===== CLASES UTILIDAD TEMA (propias) ===== */
.card-theme {
  background-color: var(--bg-primary) !important;
  color: var(--text-primary) !important;
  border-color: var(--border-color) !important;
}

.card-theme .card-header {
  background-color: var(--bg-secondary) !important;
  color: var(--text-primary) !important;
  border-color: var(--border-color) !important;
}

.card-theme .card-footer {
  background-color: var(--bg-secondary) !important;
  color: var(--text-primary) !important;
  border-color: var(--border-color) !important;
}

.text-theme-primary { color: var(--text-primary) !important; }
.text-theme-secondary { color: var(--text-secondary) !important; }
.text-theme-muted { color: var(--text-tertiary) !important; }
.bg-theme-primary { background-color: var(--bg-primary) !important; }
.bg-theme-secondary { background-color: var(--bg-secondary) !important; }
.bg-theme-tertiary { background-color: var(--bg-tertiary) !important; }

/* ===== CLASES ADAPTATIVAS PARA INLINE STYLES ===== */

/* Colores de texto que se adaptan al tema */
.text-adaptive-dark {
  color: #374151;
}
[data-theme="dark"] .text-adaptive-dark {
  color: #e2e8f0;
}

.text-adaptive-muted {
  color: #6b7280;
}
[data-theme="dark"] .text-adaptive-muted {
  color: #a0aec0;
}

.text-adaptive-subtle {
  color: #94a3b8;
}
[data-theme="dark"] .text-adaptive-subtle {
  color: #94a3b8;
}

/* Fondos de info-cards adaptativas */
.bg-adaptive-green {
  background: linear-gradient(135deg, #f0fdf4, #d1fae5);
  border-left: 3px solid #10b981;
  color: #065f46;
}
[data-theme="dark"] .bg-adaptive-green {
  background: rgba(16, 185, 129, 0.1);
  border-left-color: #10b981;
  color: #6ee7b7;
}
[data-theme="dark"] .bg-adaptive-green strong,
[data-theme="dark"] .bg-adaptive-green p,
[data-theme="dark"] .bg-adaptive-green ul,
[data-theme="dark"] .bg-adaptive-green li {
  color: #6ee7b7;
}

.bg-adaptive-blue {
  background: linear-gradient(135deg, #dbeafe, #bfdbfe);
  border-left: 3px solid #3b82f6;
  color: #1e40af;
}
[data-theme="dark"] .bg-adaptive-blue {
  background: rgba(59, 130, 246, 0.1);
  border-left-color: #3b82f6;
  color: #93c5fd;
}
[data-theme="dark"] .bg-adaptive-blue strong,
[data-theme="dark"] .bg-adaptive-blue p,
[data-theme="dark"] .bg-adaptive-blue ul,
[data-theme="dark"] .bg-adaptive-blue li {
  color: #93c5fd;
}

.bg-adaptive-yellow {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border-left: 3px solid #f59e0b;
  color: #92400e;
}
[data-theme="dark"] .bg-adaptive-yellow {
  background: rgba(245, 158, 11, 0.1);
  border-left-color: #f59e0b;
  color: #fcd34d;
}

.bg-adaptive-red {
  background: linear-gradient(135deg, #fee2e2, #fecaca);
  border-left: 3px solid #ef4444;
  color: #991b1b;
}
[data-theme="dark"] .bg-adaptive-red {
  background: rgba(239, 68, 68, 0.1);
  border-left-color: #ef4444;
  color: #fca5a5;
}

.bg-adaptive-purple {
  background: linear-gradient(135deg, #ede9fe, #ddd6fe);
  border-left: 3px solid #8b5cf6;
  color: #5b21b6;
}
[data-theme="dark"] .bg-adaptive-purple {
  background: rgba(139, 92, 246, 0.1);
  border-left-color: #8b5cf6;
  color: #c4b5fd;
}

/* Token card modal — adaptativo */
.token-card-highlight {
  background: linear-gradient(135deg, #fff9e6 0%, #ffe9cc 100%);
  color: #92400e;
}
[data-theme="dark"] .token-card-highlight {
  background: rgba(245, 158, 11, 0.15);
  color: #fcd34d;
}

/* ==================== SPORTS LAZY LOADER & SKELETON ANIMATIONS ==================== */
#sports-lazy-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.78);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 99999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  pointer-events: none;
}

#sports-lazy-overlay.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.sports-loader-box {
  background: rgba(30, 41, 59, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 24px;
  padding: 2.5rem 2.5rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), 0 0 35px rgba(99, 102, 241, 0.35);
  text-align: center;
  max-width: 440px;
  width: 90%;
  animation: sportsPopIn 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes sportsPopIn {
  from { transform: scale(0.82); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.sports-ball-container {
  position: relative;
  width: 90px;
  height: 90px;
  margin: 0 auto 1.25rem auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sports-ball-icon {
  font-size: 3.8rem;
  animation: ballBounce 0.75s infinite alternate ease-in-out;
  filter: drop-shadow(0 12px 18px rgba(0,0,0,0.5));
  display: inline-block;
}

@keyframes ballBounce {
  0% { transform: translateY(0) scale(1, 1); }
  50% { transform: translateY(-22px) scale(0.95, 1.05); }
  100% { transform: translateY(0) scale(1.08, 0.92); }
}

.sports-loader-ripple {
  position: absolute;
  bottom: 5px;
  width: 65px;
  height: 12px;
  background: rgba(99, 102, 241, 0.45);
  border-radius: 50%;
  animation: shadowPulse 0.75s infinite alternate ease-in-out;
}

@keyframes shadowPulse {
  0% { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(0.35); opacity: 0.25; }
}

.sports-phrase-text {
  color: #f8fafc;
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
  letter-spacing: -0.01em;
  line-height: 1.4;
  min-height: 2.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sports-loader-subtext {
  color: #94a3b8;
  font-size: 0.85rem;
  font-weight: 500;
}

.sports-loader-progress {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  margin-top: 1.25rem;
  overflow: hidden;
  position: relative;
}

.sports-loader-progress-bar {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 40%;
  background: linear-gradient(90deg, #6366f1 0%, #10b981 50%, #f59e0b 100%);
  border-radius: 10px;
  animation: indeterminateProgress 1.4s infinite ease-in-out;
}

@keyframes indeterminateProgress {
  0% { left: -40%; width: 30%; }
  50% { left: 30%; width: 50%; }
  100% { left: 100%; width: 30%; }
}

/* SKELETON PULSE ANIMATIONS */
.skeleton-pulse {
  background: linear-gradient(90deg, rgba(255,255,255,0.06) 25%, rgba(255,255,255,0.18) 50%, rgba(255,255,255,0.06) 75%);
  background-size: 200% 100%;
  animation: skeletonShimmer 1.5s infinite;
  border-radius: 8px;
}

[data-theme="light"] .skeleton-pulse {
  background: linear-gradient(90deg, #e2e8f0 25%, #f8fafc 50%, #e2e8f0 75%);
  background-size: 200% 100%;
}

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

.skeleton-text {
  height: 1rem;
  margin-bottom: 0.5rem;
  width: 100%;
}

.skeleton-title {
  height: 1.5rem;
  margin-bottom: 1rem;
  width: 60%;
}

.skeleton-card {
  height: 220px;
  width: 100%;
  border-radius: 16px;
}

.skeleton-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
}

/* ===================================
   MAPAS LEAFLET - COMPATIBILIDAD CON Z-INDEX Y TEMAS
   =================================== */
#locationMap, #fieldsMap, #suggestMap, #editLocationMap, .leaflet-container {
    min-height: 380px !important;
    width: 100% !important;
    display: block !important;
    border-radius: 14px !important;
    position: relative !important;
    z-index: 1 !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.custom-marker {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}
