/**
 * GoToSend Widgets - Estilos Comunes
 * Estilos base compartidos por todos los widgets
 * Incluye: Variables CSS, fuentes, utilidades, animaciones
 */

/* ===============================================
   VARIABLES CSS GLOBALES
   =============================================== */

:root {
  /* Colores principales (sobrescritos por configuración) */
  --gotosend-primary: #4e50a2;
  --gotosend-secondary: #42a3bd;
  --gotosend-success: #00b140;
  --gotosend-danger: #e31837;
  --gotosend-dark: #003057;
  
  /* Colores derivados */
  --gotosend-primary-light: color-mix(in srgb, var(--gotosend-primary) 80%, white);
  --gotosend-primary-dark: color-mix(in srgb, var(--gotosend-primary) 80%, black);
  --gotosend-secondary-light: color-mix(in srgb, var(--gotosend-secondary) 80%, white);
  --gotosend-secondary-dark: color-mix(in srgb, var(--gotosend-secondary) 80%, black);
  
  /* Colores neutros */
  --gotosend-white: #ffffff;
  --gotosend-black: #000000;
  --gotosend-gray-100: #f8f9fa;
  --gotosend-gray-200: #e9ecef;
  --gotosend-gray-300: #dee2e6;
  --gotosend-gray-400: #ced4da;
  --gotosend-gray-500: #adb5bd;
  --gotosend-gray-600: #6c757d;
  --gotosend-gray-700: #495057;
  --gotosend-gray-800: #343a40;
  --gotosend-gray-900: #212529;
  
  /* Tipografía */
  --gotosend-font-family-primary: 'Play', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --gotosend-font-family-secondary: 'Roboto Condensed', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --gotosend-font-family-mono: 'SF Mono', Monaco, 'Roboto Mono', Consolas, monospace;
  
  /* Tamaños de fuente */
  --gotosend-font-size-xs: 0.75rem;    /* 12px */
  --gotosend-font-size-sm: 0.875rem;   /* 14px */
  --gotosend-font-size-base: 1rem;     /* 16px */
  --gotosend-font-size-lg: 1.125rem;   /* 18px */
  --gotosend-font-size-xl: 1.25rem;    /* 20px */
  --gotosend-font-size-2xl: 1.5rem;    /* 24px */
  --gotosend-font-size-3xl: 1.875rem;  /* 30px */
  --gotosend-font-size-4xl: 2.25rem;   /* 36px */
  --gotosend-font-size-5xl: 3rem;      /* 48px */
  
  /* Espaciados */
  --gotosend-spacing-xs: 0.25rem;   /* 4px */
  --gotosend-spacing-sm: 0.5rem;    /* 8px */
  --gotosend-spacing-md: 1rem;      /* 16px */
  --gotosend-spacing-lg: 1.5rem;    /* 24px */
  --gotosend-spacing-xl: 2rem;      /* 32px */
  --gotosend-spacing-2xl: 2.5rem;   /* 40px */
  --gotosend-spacing-3xl: 3rem;     /* 48px */
  --gotosend-spacing-4xl: 4rem;     /* 64px */
  
  /* Radios de borde */
  --gotosend-radius-sm: 0.25rem;     /* 4px */
  --gotosend-radius-md: 0.5rem;      /* 8px */
  --gotosend-radius-lg: 0.75rem;     /* 12px */
  --gotosend-radius-xl: 1rem;        /* 16px */
  --gotosend-radius-2xl: 1.5rem;     /* 24px */
  --gotosend-radius-full: 9999px;
  
  /* Sombras */
  --gotosend-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --gotosend-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --gotosend-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --gotosend-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --gotosend-shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  
  /* Transiciones */
  --gotosend-transition-fast: 0.15s ease-out;
  --gotosend-transition-base: 0.3s ease-out;
  --gotosend-transition-slow: 0.5s ease-out;
  
  /* Z-index layers */
  --gotosend-z-dropdown: 1000;
  --gotosend-z-sticky: 1020;
  --gotosend-z-fixed: 1030;
  --gotosend-z-modal-backdrop: 1040;
  --gotosend-z-modal: 1050;
  --gotosend-z-popover: 1060;
  --gotosend-z-tooltip: 1070;
  --gotosend-z-toast: 1080;
}

/* ===============================================
   RESETEOS Y BASE
   =============================================== */

.gotosend-widget,
.gotosend-widget *,
.gotosend-widget *::before,
.gotosend-widget *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

.gotosend-widget {
  font-family: var(--gotosend-font-family-secondary);
  font-size: var(--gotosend-font-size-base);
  line-height: 1.5;
  color: var(--gotosend-gray-800);
  background-color: var(--gotosend-white);
  border-radius: var(--gotosend-radius-lg);
  overflow: hidden;
  position: relative;
}

/* ===============================================
   TIPOGRAFÍA
   =============================================== */

.gotosend-title,
.gotosend-widget h1,
.gotosend-widget h2,
.gotosend-widget h3,
.gotosend-widget h4,
.gotosend-widget h5,
.gotosend-widget h6 {
  font-family: var(--gotosend-font-family-primary);
  font-weight: 600;
  line-height: 1.2;
  color: var(--gotosend-dark);
  margin: 0 0 var(--gotosend-spacing-sm);
}

.gotosend-widget h1 { font-size: var(--gotosend-font-size-4xl); }
.gotosend-widget h2 { font-size: var(--gotosend-font-size-3xl); }
.gotosend-widget h3 { font-size: var(--gotosend-font-size-2xl); }
.gotosend-widget h4 { font-size: var(--gotosend-font-size-xl); }
.gotosend-widget h5 { font-size: var(--gotosend-font-size-lg); }
.gotosend-widget h6 { font-size: var(--gotosend-font-size-base); }

.gotosend-text-xs { font-size: var(--gotosend-font-size-xs); }
.gotosend-text-sm { font-size: var(--gotosend-font-size-sm); }
.gotosend-text-base { font-size: var(--gotosend-font-size-base); }
.gotosend-text-lg { font-size: var(--gotosend-font-size-lg); }
.gotosend-text-xl { font-size: var(--gotosend-font-size-xl); }

.gotosend-font-mono {
  font-family: var(--gotosend-font-family-mono);
}

.gotosend-text-center { text-align: center; }
.gotosend-text-left { text-align: left; }
.gotosend-text-right { text-align: right; }

/* ===============================================
   BOTONES
   =============================================== */

.gotosend-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--gotosend-spacing-xs);
  padding: var(--gotosend-spacing-sm) var(--gotosend-spacing-md);
  font-family: var(--gotosend-font-family-primary);
  font-size: var(--gotosend-font-size-sm);
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  text-align: center;
  white-space: nowrap;
  border: 1px solid transparent;
  border-radius: var(--gotosend-radius-md);
  cursor: pointer;
  transition: all var(--gotosend-transition-fast);
  user-select: none;
  -webkit-user-select: none;
  vertical-align: middle;
}

.gotosend-btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: var(--gotosend-shadow-md);
}

.gotosend-btn:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(var(--gotosend-primary), 0.25);
}

.gotosend-btn:active {
  transform: translateY(0);
  box-shadow: var(--gotosend-shadow-sm);
}

.gotosend-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Variantes de botones */
.gotosend-btn-primary {
  background: linear-gradient(135deg, var(--gotosend-primary) 0%, var(--gotosend-secondary) 100%);
  color: var(--gotosend-white);
  border-color: var(--gotosend-primary);
}

.gotosend-btn-primary:hover {
  background: linear-gradient(135deg, var(--gotosend-primary-dark) 0%, var(--gotosend-secondary-dark) 100%);
  border-color: var(--gotosend-primary-dark);
}

.gotosend-btn-secondary {
  background-color: var(--gotosend-gray-100);
  color: var(--gotosend-gray-700);
  border-color: var(--gotosend-gray-300);
}

.gotosend-btn-secondary:hover {
  background-color: var(--gotosend-gray-200);
  color: var(--gotosend-gray-800);
  border-color: var(--gotosend-gray-400);
}

.gotosend-btn-success {
  background-color: var(--gotosend-success);
  color: var(--gotosend-white);
  border-color: var(--gotosend-success);
}

.gotosend-btn-danger {
  background-color: var(--gotosend-danger);
  color: var(--gotosend-white);
  border-color: var(--gotosend-danger);
}

.gotosend-btn-outline {
  background-color: transparent;
  color: var(--gotosend-primary);
  border-color: var(--gotosend-primary);
}

.gotosend-btn-outline:hover {
  background-color: var(--gotosend-primary);
  color: var(--gotosend-white);
}

/* Tamaños de botones */
.gotosend-btn-sm {
  padding: var(--gotosend-spacing-xs) var(--gotosend-spacing-sm);
  font-size: var(--gotosend-font-size-xs);
}

.gotosend-btn-lg {
  padding: var(--gotosend-spacing-md) var(--gotosend-spacing-lg);
  font-size: var(--gotosend-font-size-lg);
}

.gotosend-btn-icon {
  padding: var(--gotosend-spacing-sm);
  width: 2.5rem;
  height: 2.5rem;
}

/* ===============================================
   BADGES Y INDICADORES
   =============================================== */

.gotosend-badge {
  display: inline-flex;
  align-items: center;
  padding: var(--gotosend-spacing-xs) var(--gotosend-spacing-sm);
  font-size: var(--gotosend-font-size-xs);
  font-weight: 600;
  line-height: 1;
  border-radius: var(--gotosend-radius-full);
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.gotosend-badge-primary {
  background-color: var(--gotosend-primary);
  color: var(--gotosend-white);
}

.gotosend-badge-success {
  background-color: var(--gotosend-success);
  color: var(--gotosend-white);
}

.gotosend-badge-danger {
  background-color: var(--gotosend-danger);
  color: var(--gotosend-white);
}

.gotosend-badge-live {
  background: linear-gradient(45deg, var(--gotosend-success), var(--gotosend-primary));
  color: var(--gotosend-white);
  animation: gotosend-pulse 2s infinite;
}

/* ===============================================
   LOADING Y SPINNERS
   =============================================== */

.gotosend-spinner {
  display: inline-block;
  width: 1.5rem;
  height: 1.5rem;
  border: 2px solid var(--gotosend-gray-200);
  border-radius: 50%;
  border-top-color: var(--gotosend-primary);
  animation: gotosend-spin 1s ease-in-out infinite;
}

.gotosend-spinner-sm {
  width: 1rem;
  height: 1rem;
  border-width: 1px;
}

.gotosend-spinner-lg {
  width: 2rem;
  height: 2rem;
  border-width: 3px;
}

.gotosend-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--gotosend-spacing-sm);
  padding: var(--gotosend-spacing-lg);
  text-align: center;
  color: var(--gotosend-gray-600);
}

/* ===============================================
   ALERTAS Y MENSAJES
   =============================================== */

.gotosend-alert {
  padding: var(--gotosend-spacing-md);
  margin-bottom: var(--gotosend-spacing-md);
  border: 1px solid transparent;
  border-radius: var(--gotosend-radius-md);
  font-size: var(--gotosend-font-size-sm);
}

.gotosend-alert-success {
  background-color: color-mix(in srgb, var(--gotosend-success) 10%, white);
  border-color: var(--gotosend-success);
  color: color-mix(in srgb, var(--gotosend-success) 80%, black);
}

.gotosend-alert-danger {
  background-color: color-mix(in srgb, var(--gotosend-danger) 10%, white);
  border-color: var(--gotosend-danger);
  color: color-mix(in srgb, var(--gotosend-danger) 80%, black);
}

.gotosend-alert-info {
  background-color: color-mix(in srgb, var(--gotosend-primary) 10%, white);
  border-color: var(--gotosend-primary);
  color: color-mix(in srgb, var(--gotosend-primary) 80%, black);
}

/* ===============================================
   UTILIDADES
   =============================================== */

.gotosend-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;
}

.gotosend-hidden { display: none !important; }
.gotosend-visible { visibility: visible !important; }
.gotosend-invisible { visibility: hidden !important; }

/* Flexbox utilities */
.gotosend-flex { display: flex; }
.gotosend-inline-flex { display: inline-flex; }
.gotosend-flex-col { flex-direction: column; }
.gotosend-flex-wrap { flex-wrap: wrap; }
.gotosend-items-center { align-items: center; }
.gotosend-items-start { align-items: flex-start; }
.gotosend-items-end { align-items: flex-end; }
.gotosend-justify-center { justify-content: center; }
.gotosend-justify-between { justify-content: space-between; }
.gotosend-justify-around { justify-content: space-around; }

/* Espaciados */
.gotosend-p-0 { padding: 0; }
.gotosend-p-xs { padding: var(--gotosend-spacing-xs); }
.gotosend-p-sm { padding: var(--gotosend-spacing-sm); }
.gotosend-p-md { padding: var(--gotosend-spacing-md); }
.gotosend-p-lg { padding: var(--gotosend-spacing-lg); }

.gotosend-m-0 { margin: 0; }
.gotosend-m-xs { margin: var(--gotosend-spacing-xs); }
.gotosend-m-sm { margin: var(--gotosend-spacing-sm); }
.gotosend-m-md { margin: var(--gotosend-spacing-md); }
.gotosend-m-lg { margin: var(--gotosend-spacing-lg); }

/* ===============================================
   ANIMACIONES
   =============================================== */

@keyframes gotosend-spin {
  to { transform: rotate(360deg); }
}

@keyframes gotosend-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

@keyframes gotosend-bounce {
  0%, 100% { transform: translateY(-25%); animation-timing-function: cubic-bezier(0.8, 0, 1, 1); }
  50% { transform: translateY(0); animation-timing-function: cubic-bezier(0, 0, 0.2, 1); }
}

@keyframes gotosend-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes gotosend-slide-up {
  from { transform: translateY(100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes gotosend-slide-down {
  from { transform: translateY(-100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Clases de animación */
.gotosend-animate-spin { animation: gotosend-spin 1s linear infinite; }
.gotosend-animate-pulse { animation: gotosend-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite; }
.gotosend-animate-bounce { animation: gotosend-bounce 1s infinite; }
.gotosend-animate-fade-in { animation: gotosend-fade-in 0.3s ease-out; }
.gotosend-animate-slide-up { animation: gotosend-slide-up 0.3s ease-out; }
.gotosend-animate-slide-down { animation: gotosend-slide-down 0.3s ease-out; }

/* ===============================================
   RESPONSIVE
   =============================================== */

@media (max-width: 768px) {
  :root {
    --gotosend-font-size-4xl: 1.875rem;  /* 30px en móvil */
    --gotosend-font-size-3xl: 1.5rem;    /* 24px en móvil */
    --gotosend-spacing-md: 0.75rem;      /* 12px en móvil */
    --gotosend-spacing-lg: 1rem;         /* 16px en móvil */
  }
  
  .gotosend-widget {
    font-size: var(--gotosend-font-size-sm);
  }
  
  .gotosend-btn {
    padding: var(--gotosend-spacing-xs) var(--gotosend-spacing-sm);
    font-size: var(--gotosend-font-size-xs);
  }
  
  .gotosend-btn-lg {
    padding: var(--gotosend-spacing-sm) var(--gotosend-spacing-md);
    font-size: var(--gotosend-font-size-sm);
  }
}

@media (max-width: 480px) {
  .gotosend-widget {
    border-radius: var(--gotosend-radius-md);
  }
  
  .gotosend-flex-col-mobile {
    flex-direction: column;
  }
  
  .gotosend-text-center-mobile {
    text-align: center;
  }
}

/* ===============================================
   TEMAS OSCUROS
   =============================================== */

@media (prefers-color-scheme: dark) {
  .gotosend-widget.gotosend-auto-dark {
    --gotosend-white: #1a1a1a;
    --gotosend-black: #ffffff;
    --gotosend-gray-100: #2d2d2d;
    --gotosend-gray-200: #3d3d3d;
    --gotosend-gray-300: #4d4d4d;
    --gotosend-gray-400: #6d6d6d;
    --gotosend-gray-500: #8d8d8d;
    --gotosend-gray-600: #adadad;
    --gotosend-gray-700: #cdcdcd;
    --gotosend-gray-800: #e0e0e0;
    --gotosend-gray-900: #f5f5f5;
    
    background-color: var(--gotosend-white);
    color: var(--gotosend-gray-800);
  }
}