/* ==========================================
   ALMA DIGITAL ACADEMY - SISTEMA DE ESTILOS UNIFICADO
   Versión: 2.0 - Implementación 2025
   ========================================== */

/* ==========================================
   VARIABLES Y DESIGN TOKENS
   ========================================== */
:root {
  /* Colores Principales del Brand */
  --color-background: #F8F5F2;
  --color-text: #4A4A4A;
  --color-text-light: #6B7280;
  --color-text-lighter: #9CA3AF;
  --color-dark: #2C3E50;
  --color-primary: #8C7B6C;
  --color-primary-dark: #736558;
  --color-primary-light: #A6958B;
  --color-secondary: #D4CFC7;
  --color-secondary-light: #E8E2DA;
  
  /* Colores de Estado */
  --color-success: #059669;
  --color-success-light: #D1FAE5;
  --color-warning: #D97706;
  --color-warning-light: #FEF3C7;
  --color-error: #DC2626;
  --color-error-light: #FEE2E2;
  --color-info: #2563EB;
  --color-info-light: #DBEAFE;
  
  /* Colores Especiales */
  --color-venezuela: #B8860B;
  --color-venezuela-light: #D4AF37;
  --color-europa: #556B2F;
  --color-europa-light: #6B8E23;
  
  /* Tipografía */
  --font-primary: 'Playfair Display', serif;
  --font-secondary: 'Lato', sans-serif;
  --font-mono: 'Fira Code', monospace;
  
  /* Espaciado */
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;
  --spacing-2xl: 3rem;
  --spacing-3xl: 4rem;
  
  /* Bordes */
  --border-radius-sm: 0.375rem;
  --border-radius-md: 0.5rem;
  --border-radius-lg: 0.75rem;
  --border-radius-xl: 1rem;
  
  /* Sombras */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  
  /* Transiciones */
  --transition-fast: 0.15s ease-in-out;
  --transition-normal: 0.3s ease-in-out;
  --transition-slow: 0.5s ease-in-out;
}

/* ==========================================
   RESET Y BASE
   ========================================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--color-background);
  color: var(--color-text);
  font-family: var(--font-secondary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ==========================================
   TIPOGRAFÍA UNIFICADA
   ========================================== */
.font-playfair { 
  font-family: var(--font-primary); 
  font-weight: 400;
}

.font-lato { 
  font-family: var(--font-secondary); 
}

.font-mono { 
  font-family: var(--font-mono); 
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-primary);
  font-weight: 700;
  line-height: 1.2;
  color: var(--color-dark);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

/* ==========================================
   CLASES DE UTILIDAD DE COLOR
   ========================================== */
.bg-brand { background-color: var(--color-primary); }
.text-brand { color: var(--color-primary); }
.border-brand { border-color: var(--color-primary); }

.bg-brand-background { background-color: var(--color-background); }
.bg-brand-primary { background-color: var(--color-primary); }
.bg-brand-primary-light { background-color: var(--color-primary-light); }
.bg-brand-primary-dark { background-color: var(--color-primary-dark); }
.bg-brand-secondary { background-color: var(--color-secondary); }
.bg-brand-secondary-light { background-color: var(--color-secondary-light); }

.text-brand-text { color: var(--color-text); }
.text-brand-text-light { color: var(--color-text-light); }
.text-brand-text-lighter { color: var(--color-text-lighter); }
.text-brand-dark { color: var(--color-dark); }

/* Colores de estado */
.bg-success { background-color: var(--color-success); }
.bg-warning { background-color: var(--color-warning); }
.bg-error { background-color: var(--color-error); }
.bg-info { background-color: var(--color-info); }

.text-success { color: var(--color-success); }
.text-warning { color: var(--color-warning); }
.text-error { color: var(--color-error); }
.text-info { color: var(--color-info); }

/* ==========================================
   COMPONENTES BASE
   ========================================== */

/* Header */
#header {
  transition: box-shadow var(--transition-normal);
  background-color: rgba(248, 245, 242, 0.95);
  backdrop-filter: blur(10px);
}

#header.scrolled {
  box-shadow: var(--shadow-md);
}

/* Cards */
.card {
  background-color: white;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: all var(--transition-normal);
  border: 1px solid var(--color-secondary);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--color-primary-light);
}

.card-brand {
  border-left: 4px solid var(--color-primary);
}

/* Botones */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-sm) var(--spacing-lg);
  border-radius: var(--border-radius-md);
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: var(--font-secondary);
}

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

.btn-primary:hover {
  background-color: var(--color-primary-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background-color: var(--color-secondary);
  color: var(--color-dark);
}

.btn-secondary:hover {
  background-color: var(--color-primary);
  color: white;
}

.btn-outline {
  background-color: transparent;
  color: var(--color-primary);
  border: 2px solid var(--color-primary);
}

.btn-outline:hover {
  background-color: var(--color-primary);
  color: white;
}

/* Formularios */
.form-group {
  margin-bottom: var(--spacing-lg);
}

.form-label {
  display: block;
  margin-bottom: var(--spacing-sm);
  font-weight: 600;
  color: var(--color-dark);
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: var(--spacing-sm) var(--spacing-md);
  border: 2px solid var(--color-secondary);
  border-radius: var(--border-radius-md);
  font-family: var(--font-secondary);
  transition: all var(--transition-fast);
  background-color: white;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(140, 123, 108, 0.1);
}

/* ==========================================
   LAYOUT Y ESTRUCTURA
   ========================================== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--spacing-lg);
}

.section {
  padding: var(--spacing-3xl) 0;
}

.grid {
  display: grid;
  gap: var(--spacing-lg);
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* ==========================================
   ANIMACIONES Y EFECTOS
   ========================================== */
.animate-fade-in {
  animation: fadeIn var(--transition-slow) ease-in-out;
}

.animate-slide-up {
  animation: slideUp var(--transition-slow) ease-in-out;
}

.animate-bounce-in {
  animation: bounceIn var(--transition-normal) ease-in-out;
}

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

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

@keyframes bounceIn {
  0% { 
    opacity: 0; 
    transform: scale(0.3); 
  }
  50% { 
    opacity: 1; 
    transform: scale(1.05); 
  }
  70% { transform: scale(0.9); }
  100% { 
    opacity: 1; 
    transform: scale(1); 
  }
}

/* ==========================================
   UTILIDADES RESPONSIVE
   ========================================== */
@media (max-width: 768px) {
  .container {
    padding: 0 var(--spacing-md);
  }
  
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }
  
  h1 { font-size: 2rem; }
  h2 { font-size: 1.75rem; }
  h3 { font-size: 1.25rem; }
  
  .section {
    padding: var(--spacing-2xl) 0;
  }
}

/* ==========================================
   COMPONENTES ESPECÍFICOS
   ========================================== */

/* Navegación */
.nav-link {
  display: flex;
  align-items: center;
  padding: var(--spacing-md) var(--spacing-lg);
  color: inherit;
  text-decoration: none;
  transition: all var(--transition-fast);
  border-radius: var(--border-radius-md);
}

.nav-link:hover,
.nav-link.active {
  background-color: var(--color-primary);
  color: white;
}

/* Modales */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
}

.modal.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background-color: white;
  padding: var(--spacing-2xl);
  border-radius: var(--border-radius-xl);
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.8);
  transition: transform var(--transition-normal);
}

.modal.active .modal-content {
  transform: scale(1);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: var(--spacing-xs) var(--spacing-sm);
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--border-radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-primary {
  background-color: var(--color-primary);
  color: white;
}

.badge-secondary {
  background-color: var(--color-secondary);
  color: var(--color-dark);
}

.badge-success {
  background-color: var(--color-success-light);
  color: var(--color-success);
}

.badge-warning {
  background-color: var(--color-warning-light);
  color: var(--color-warning);
}

.badge-error {
  background-color: var(--color-error-light);
  color: var(--color-error);
}

/* ==========================================
   CAROUSEL BASE (Para Coaches)
   ========================================== */
.carousel-container {
  position: relative;
  overflow: hidden;
  border-radius: var(--border-radius-lg);
}

.carousel-track {
  display: flex;
  transition: transform var(--transition-normal);
}

.carousel-slide {
  min-width: 100%;
  position: relative;
}

.carousel-slide img {
  width: 100%;
  height: 300px;
  object-fit: cover;
  border-radius: var(--border-radius-lg);
}

.carousel-controls {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background-color: rgba(0, 0, 0, 0.5);
  color: white;
  border: none;
  padding: var(--spacing-sm) var(--spacing-md);
  border-radius: var(--border-radius-md);
  cursor: pointer;
  transition: background-color var(--transition-fast);
  z-index: 10;
}

.carousel-controls:hover {
  background-color: rgba(0, 0, 0, 0.7);
}

.carousel-prev {
  left: var(--spacing-md);
}

.carousel-next {
  right: var(--spacing-md);
}

.carousel-indicators {
  position: absolute;
  bottom: var(--spacing-md);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: var(--spacing-sm);
}

.carousel-indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: background-color var(--transition-fast);
}

.carousel-indicator.active {
  background-color: white;
}

/* ==========================================
   E-COMMERCE COMPONENTS
   ========================================== */
.product-card {
  background-color: white;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: all var(--transition-normal);
  border: 1px solid var(--color-secondary);
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.product-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.product-content {
  padding: var(--spacing-lg);
}

.product-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-dark);
  margin-bottom: var(--spacing-sm);
}

.product-price {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: var(--spacing-md);
}

.product-description {
  color: var(--color-text-light);
  margin-bottom: var(--spacing-lg);
}

/* Shopping Cart */
.cart-item {
  display: flex;
  align-items: center;
  padding: var(--spacing-lg);
  border-bottom: 1px solid var(--color-secondary);
}

.cart-item-image {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: var(--border-radius-md);
  margin-right: var(--spacing-lg);
}

.cart-item-details {
  flex: 1;
}

.cart-item-title {
  font-weight: 600;
  color: var(--color-dark);
  margin-bottom: var(--spacing-xs);
}

.cart-item-price {
  color: var(--color-primary);
  font-weight: 600;
}

.cart-item-quantity {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.quantity-btn {
  width: 30px;
  height: 30px;
  border: 1px solid var(--color-secondary);
  background-color: white;
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.quantity-btn:hover {
  background-color: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
}

/* ==========================================
   RESPONSIVE ADJUSTMENTS
   ========================================== */
@media (max-width: 1024px) {
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .grid-3 {
    grid-template-columns: 1fr;
  }
  
  .container {
    padding: 0 var(--spacing-sm);
  }
  
  .modal-content {
    padding: var(--spacing-lg);
    margin: var(--spacing-sm);
  }
}

/* ==========================================
   PRINT STYLES
   ========================================== */
@media print {
  .no-print {
    display: none !important;
  }
  
  .card {
    box-shadow: none;
    border: 1px solid #000;
  }
}

/* ==========================================
   ACCESIBILIDAD
   ========================================== */
.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;
}

/* Focus styles */
.btn:focus,
.form-input:focus,
.form-textarea:focus,
.form-select:focus,
.nav-link:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ==========================================
   ENHANCED COACH CAROUSEL
   ========================================== */
.coach-carousel {
  position: relative;
  background: linear-gradient(135deg, #f8f5f2 0%, #e8e2da 100%);
  border-radius: var(--border-radius-xl);
  padding: var(--spacing-xl);
  margin: var(--spacing-lg) 0;
  box-shadow: var(--shadow-lg);
}

.coach-carousel-header {
  text-align: center;
  margin-bottom: var(--spacing-xl);
}

.coach-carousel-header h3 {
  color: var(--color-dark);
  margin-bottom: var(--spacing-sm);
}

.coach-carousel-header p {
  color: var(--color-text-light);
  font-size: 1.1rem;
}

.coach-carousel-images {
  position: relative;
  height: 350px;
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-xl);
}

.coach-image-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transform: scale(1.1);
  transition: all var(--transition-slow);
  background-size: cover;
  background-position: center;
}

.coach-image-slide.active {
  opacity: 1;
  transform: scale(1);
}

.coach-image-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
  color: white;
  padding: var(--spacing-xl);
  text-align: center;
}

.coach-image-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: var(--spacing-sm);
}

.coach-image-description {
  font-size: 1rem;
  opacity: 0.9;
}

.coach-carousel-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 50px;
  height: 50px;
  background: rgba(255, 255, 255, 0.9);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-md);
  z-index: 10;
}

.coach-carousel-nav:hover {
  background: white;
  transform: translateY(-50%) scale(1.1);
  box-shadow: var(--shadow-lg);
}

.coach-carousel-nav:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: translateY(-50%);
}

.coach-carousel-nav.prev {
  left: var(--spacing-md);
}

.coach-carousel-nav.next {
  right: var(--spacing-md);
}

.coach-carousel-dots {
  position: absolute;
  bottom: var(--spacing-md);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: var(--spacing-sm);
  z-index: 10;
}

.coach-carousel-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  border: 2px solid rgba(255, 255, 255, 0.8);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.coach-carousel-dot:hover {
  background: rgba(255, 255, 255, 0.8);
  transform: scale(1.2);
}

.coach-carousel-dot.active {
  background: white;
  transform: scale(1.3);
  box-shadow: 0 0 0 2px var(--color-primary);
}

/* Coach Card Enhancement */
.coach-card {
  background: white;
  border-radius: var(--border-radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: all var(--transition-normal);
  border: 1px solid var(--color-secondary);
}

.coach-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-xl);
  border-color: var(--color-primary-light);
}

.coach-card-header {
  padding: var(--spacing-xl);
  text-align: center;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  color: white;
}

.coach-card-name {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: var(--spacing-xs);
}

.coach-card-title {
  opacity: 0.9;
  font-size: 1rem;
}

.coach-card-body {
  padding: var(--spacing-xl);
}

.coach-card-description {
  color: var(--color-text-light);
  line-height: 1.6;
  margin-bottom: var(--spacing-lg);
}

.coach-card-actions {
  display: flex;
  gap: var(--spacing-sm);
}

.coach-card-actions .btn {
  flex: 1;
  font-size: 0.9rem;
  padding: var(--spacing-sm) var(--spacing-md);
}

/* ==========================================
   LOADING STATES
   ========================================== */
.loading-skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

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

.skeleton-text {
  height: 1rem;
  margin-bottom: var(--spacing-sm);
  border-radius: var(--border-radius-sm);
}

.skeleton-text.wide {
  width: 80%;
}

.skeleton-text.medium {
  width: 60%;
}

.skeleton-text.short {
  width: 40%;
}

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

.skeleton-card {
  height: 200px;
  border-radius: var(--border-radius-lg);
}

/* ==========================================
   DARK MODE SUPPORT (Optional)
   ========================================== */
@media (prefers-color-scheme: dark) {
  :root {
    --color-background: #1a1a1a;
    --color-text: #e5e5e5;
    --color-text-light: #a0a0a0;
    --color-text-lighter: #666666;
    --color-dark: #f5f5f5;
  }
}
