/**
 * PlayVigo - CSS Unificado
 * Versión: 1.0
 * Descripción: Estilos globales para todo el proyecto PlayVigo
 */

/* ========== VARIABLES GLOBALES ========== */
:root {
  /* Colores principales PlayVigo */
  --accent: #95dbc8;
  --accent-gradient-stop: #85d3c0;
  --accent-soft: #eaf7f3;
  
  /* Colores pastel */
  --rosa-pastel: #FFD1DC;
  --azul-pastel: #AEEAFD;
  --verde-pastel: #B6F2C8;
  
  /* Fondos y paneles */
  --bg-base: #fbfcfe;
  --panel: #ffffff;
  --panel-glass: rgba(255, 255, 255, 0.95);
  
  /* Textos */
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-dark: #1a1a1a;
  --text-light: #ffffff;
  
  /* Bordes y sombras */
  --border-subtle: rgba(2, 6, 23, 0.08);
  --border-medium: rgba(0, 0, 0, 0.1);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.12);
  --shadow-lg: 0 8px 28px rgba(2, 25, 48, 0.08);
  --shadow-xl: 0 10px 30px rgba(0, 0, 0, 0.2);
  
  /* Efectos y animaciones */
  --ring: 0 0 0 3px rgba(149, 219, 200, 0.35);
  --transition: 0.25s ease;
  --transition-slow: 0.4s ease;
  
  /* Radios de borde */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-pill: 999px;
  
  /* Espaciado */
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;
  
  /* Anchos máximos */
  --max-width-sm: 560px;
  --max-width-md: 720px;
  --max-width-lg: 960px;
  --max-width-xl: 1200px;
}

/* Modo oscuro */
@media (prefers-color-scheme: dark) {
  :root {
    --bg-base: #0e131b;
    --panel: #101826;
    --panel-glass: rgba(16, 24, 38, 0.95);
    --text-main: #e7eef7;
    --text-muted: #a7b3c8;
    --border-subtle: rgba(231, 236, 245, 0.14);
    --border-medium: rgba(255, 255, 255, 0.1);
    --accent: #a3e6d6;
    --accent-gradient-stop: #92dccb;
    --accent-soft: rgba(163, 230, 214, 0.12);
    --shadow-lg: 0 8px 28px rgba(0, 0, 0, 0.35);
  }
}

/* ========== RESET Y BASE ========== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  height: 100%;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  scroll-behavior: smooth;
}

body {
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Ubuntu, Cantarell, 'Noto Sans', sans-serif;
  background: var(--bg-base);
  color: var(--text-main);
  margin: 0;
  padding: 0;
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ========== TIPOGRAFÍA ========== */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: var(--spacing-md);
  color: var(--text-main);
}

h1 { font-size: clamp(1.8rem, 5vw, 2.5rem); }
h2 { font-size: clamp(1.5rem, 4vw, 2rem); }
h3 { font-size: clamp(1.3rem, 3vw, 1.75rem); }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.1rem; }
h6 { font-size: 1rem; }

p {
  margin-bottom: var(--spacing-md);
  line-height: 1.7;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: opacity var(--transition);
}

a:hover {
  opacity: 0.8;
}

/* ========== IMÁGENES Y MULTIMEDIA ========== */
img {
  display: block;
  max-width: 100%;
  height: auto;
}

/* ========== BOTONES ========== */
button, .btn {
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
  text-decoration: none;
  background: var(--panel);
  color: var(--text-main);
  border: 1px solid var(--border-medium);
  box-shadow: var(--shadow-sm);
}

button:hover, .btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

button:active, .btn:active {
  transform: translateY(0);
}

button:focus-visible, .btn:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}

.btn-primary {
  background: linear-gradient(180deg, var(--accent), var(--accent-gradient-stop));
  color: #0b1220;
  border: none;
  box-shadow: var(--shadow-md);
}

.btn-primary:hover {
  box-shadow: var(--shadow-lg);
}

.btn-secondary {
  background: var(--accent-soft);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--accent);
  color: var(--accent);
}

.btn-small {
  padding: 6px 12px;
  font-size: 0.875rem;
}

.btn-large {
  padding: 14px 28px;
  font-size: 1.1rem;
}

/* ========== CONTENEDORES Y LAYOUT ========== */
.container {
  width: 100%;
  max-width: var(--max-width-lg);
  margin: 0 auto;
  padding: 0 var(--spacing-md);
}

.container-sm { max-width: var(--max-width-sm); }
.container-md { max-width: var(--max-width-md); }
.container-lg { max-width: var(--max-width-lg); }
.container-xl { max-width: var(--max-width-xl); }

.panel, .card {
  background: var(--panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
  box-shadow: var(--shadow-md);
  margin-bottom: var(--spacing-lg);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
  transition: all var(--transition);
}

.glass {
  background: var(--panel-glass);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* ========== GRID Y FLEX ========== */
.flex {
  display: flex;
}

.flex-center {
  display: flex;
  justify-content: center;
  align-items: center;
}

.flex-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.flex-column {
  display: flex;
  flex-direction: column;
}

.grid {
  display: grid;
  gap: var(--spacing-lg);
}

.grid-2 { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }

/* ========== FORMULARIOS ========== */
input, textarea, select {
  font-family: inherit;
  font-size: 1rem;
  padding: 10px 14px;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  background: var(--panel);
  color: var(--text-main);
  width: 100%;
  transition: all var(--transition);
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: var(--ring);
}

label {
  display: block;
  margin-bottom: var(--spacing-xs);
  font-weight: 600;
  color: var(--text-main);
}

.form-group {
  margin-bottom: var(--spacing-lg);
}

/* ========== ENCABEZADO Y NAVEGACIÓN ========== */
header {
  background: var(--panel);
  border-bottom: 1px solid var(--border-subtle);
  padding: var(--spacing-md) 0;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

nav ul {
  list-style: none;
  display: flex;
  gap: var(--spacing-lg);
  margin: 0;
  padding: 0;
}

nav a {
  color: var(--text-main);
  font-weight: 500;
  padding: var(--spacing-sm) var(--spacing-md);
  border-radius: var(--radius-md);
  transition: all var(--transition);
}

nav a:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

/* ========== PIE DE PÁGINA ========== */
footer {
  background: var(--panel);
  border-top: 1px solid var(--border-subtle);
  padding: var(--spacing-xl) 0;
  margin-top: auto;
  color: var(--text-muted);
  font-size: 0.875rem;
}

footer a {
  color: var(--text-muted);
}

footer a:hover {
  color: var(--accent);
}

/* ========== UTILIDADES ========== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.text-muted { color: var(--text-muted); }
.text-accent { color: var(--accent); }

.mt-sm { margin-top: var(--spacing-sm); }
.mt-md { margin-top: var(--spacing-md); }
.mt-lg { margin-top: var(--spacing-lg); }
.mt-xl { margin-top: var(--spacing-xl); }

.mb-sm { margin-bottom: var(--spacing-sm); }
.mb-md { margin-bottom: var(--spacing-md); }
.mb-lg { margin-bottom: var(--spacing-lg); }
.mb-xl { margin-bottom: var(--spacing-xl); }

.p-sm { padding: var(--spacing-sm); }
.p-md { padding: var(--spacing-md); }
.p-lg { padding: var(--spacing-lg); }
.p-xl { padding: var(--spacing-xl); }

.rounded-sm { border-radius: var(--radius-sm); }
.rounded-md { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-pill { border-radius: var(--radius-pill); }

.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }
.shadow-xl { box-shadow: var(--shadow-xl); }

/* ========== EFECTOS Y ANIMACIONES ========== */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

.animate-fade-in {
  animation: fadeIn 0.5s ease-out;
}

.animate-pulse {
  animation: pulse 2s ease-in-out infinite;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
  :root {
    --spacing-lg: 16px;
    --spacing-xl: 24px;
  }
  
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }
  
  nav ul {
    flex-direction: column;
    gap: var(--spacing-sm);
  }
  
  .panel, .card {
    padding: var(--spacing-md);
  }
  
  h1 { font-size: 1.8rem; }
  h2 { font-size: 1.5rem; }
  h3 { font-size: 1.3rem; }
}

@media (max-width: 480px) {
  body {
    font-size: 14px;
  }
  
  .btn {
    width: 100%;
    justify-content: center;
  }
  
  .container {
    padding: 0 var(--spacing-sm);
  }
}

/* ========== ACCESIBILIDAD ========== */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ========== LOADER ========== */
.loader {
  width: 40px;
  height: 40px;
  border: 4px solid var(--accent-soft);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ========== MODAL ========== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
}

.modal {
  background: var(--panel);
  border-radius: var(--radius-xl);
  padding: var(--spacing-xl);
  max-width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

/* ========== BADGES ========== */
.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--accent-soft);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
}

.badge-primary {
  background: var(--accent);
  color: #0b1220;
  border: none;
}

/* ========== TOAST/NOTIFICACIÓN ========== */
.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--panel);
  padding: var(--spacing-md) var(--spacing-lg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border-subtle);
  z-index: 1001;
  animation: fadeIn 0.3s ease-out;
}

.toast-success {
  border-left: 4px solid var(--verde-pastel);
}

.toast-error {
  border-left: 4px solid var(--rosa-pastel);
}

.toast-info {
  border-left: 4px solid var(--azul-pastel);
}

/* ========== SCROLL PERSONALIZADO ========== */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg-base);
}

::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: var(--radius-pill);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-gradient-stop);
}

/* ========== SELECCIÓN DE TEXTO ========== */
::selection {
  background: var(--accent);
  color: #0b1220;
}

::-moz-selection {
  background: var(--accent);
  color: #0b1220;
}
