:root {
  --primary: #0a0e1a;
  --secondary: #1a1f2e;
  --tertiary: #252b3a;
  --accent: #6366f1;
  --accent-hover: #5855eb;
  --highlight: #10b981;
  --highlight-dark: #059669;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --card: rgba(30, 41, 59, 0.8);
  --card-border: rgba(51, 65, 85, 0.6);
  --card-hover: rgba(51, 65, 85, 0.8);
  --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --gradient-accent: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  --gradient-success: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  --gradient-card: linear-gradient(145deg, rgba(30, 41, 59, 0.9), rgba(15, 23, 42, 0.9));
  --orange: #f97316;
  --red: #ef4444;
  --yellow: #eab308;
  --trustpilot: #00b67a;
  --glass-bg: rgba(255, 255, 255, 0.05);
  --glass-border: rgba(255, 255, 255, 0.1);
  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  --shadow-accent: 0 10px 30px rgba(99, 102, 241, 0.3);
}

* { 
  margin: 0; 
  padding: 0; 
  box-sizing: border-box; 
}

body {
  background: linear-gradient(135deg, #0a0e1a 0%, #1a1f2e 50%, #252b3a 100%);
  background-attachment: fixed;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--text);
  line-height: 1.6;
  position: relative;
  overflow-x: hidden;
  /* Optimización de rendimiento */
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: 
    radial-gradient(circle at 20% 50%, rgba(99, 102, 241, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(16, 185, 129, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 40% 80%, rgba(245, 87, 108, 0.1) 0%, transparent 50%);
  pointer-events: none;
  z-index: -1;
  /* Optimización de rendimiento */
  will-change: transform;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

.container {
  max-width: 1400px;
  margin: auto;
  padding: 1rem;
  position: relative;
  z-index: 1;
  background: transparent;
}

/* Header */
header {
  text-align: center;
  margin-bottom: 3rem;
  padding: 3rem 0;
  position: relative;
}

header h1 {
  font-size: 3.5rem;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  position: relative;
  display: inline-block;
}

header h1::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 4px;
  background: var(--gradient-accent);
  border-radius: 2px;
}

header h1 i {
  margin-right: 0.8rem;
  background: var(--gradient-success);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 10px rgba(99, 102, 241, 0.5));
}

header p {
  color: var(--text-muted);
  font-size: 1.2rem;
  max-width: 700px;
  margin: 0 auto;
  font-weight: 400;
  line-height: 1.7;
}

/* Navigation */
.nav {
  display: flex;
  justify-content: center;
  margin-bottom: 3rem;
}

.nav-title {
  padding: 1.2rem 2.5rem;
  border-radius: 12px;
  border: 1px solid var(--glass-border);
  background: var(--gradient-primary);
  backdrop-filter: blur(10px);
  color: white;
  font-weight: 700;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  box-shadow: var(--shadow-accent);
  position: relative;
  overflow: hidden;
}

.nav-title::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: var(--gradient-accent);
  transition: left 0.3s ease;
  z-index: -1;
}

.nav-title:hover::before {
  left: 0;
}

.results-info {
  color: var(--text-muted);
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-weight: 500;
  background: var(--glass-bg);
  padding: 0.8rem 1.2rem;
  border-radius: 8px;
  backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  margin-bottom: 3rem;
  justify-content: center;
}

/* Table Header */
.table-header {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr 1fr 1fr;
  gap: 1rem;
  padding: 1.5rem 2rem;
  background: var(--glass-bg);
  backdrop-filter: blur(15px);
  border-radius: 16px;
  margin-bottom: 1.5rem;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  border: 1px solid var(--glass-border);
}

.table-header > div {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: color 0.2s ease;
}

.table-header > div.sortable {
  cursor: pointer;
}

.table-header > div.sortable:hover {
  color: var(--accent);
}

/* Firm List */
.firm-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.firm-card {
  background: var(--gradient-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 1.5rem;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr 1fr 1fr;
  gap: 1.5rem;
  align-items: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  animation: fadeInUp 0.6s ease forwards;
  opacity: 0;
  transform: translateY(20px);
  /* Optimización de rendimiento */
  will-change: transform, opacity;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.firm-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--gradient-accent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.firm-card::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.05) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.firm-card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: 
    0 8px 30px rgba(99, 102, 241, 0.15),
    0 0 20px rgba(99, 102, 241, 0.05);
}

.firm-card:hover::before {
  opacity: 1;
}

.firm-card:hover::after {
  opacity: 1;
}

.firm-card:nth-child(1) { animation-delay: 0.1s; }
.firm-card:nth-child(2) { animation-delay: 0.2s; }
.firm-card:nth-child(3) { animation-delay: 0.3s; }
.firm-card:nth-child(4) { animation-delay: 0.4s; }
.firm-card:nth-child(5) { animation-delay: 0.5s; }
.firm-card:nth-child(6) { animation-delay: 0.6s; }

/* Firm Info */
.firm-info {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.firm-logo {
  width: 60px;
  height: 60px;
  border-radius: 16px;
  object-fit: contain;
  padding: 12px;
  border: 2px solid var(--glass-border);
  transition: all 0.3s ease;
  box-shadow: var(--shadow-sm);
}

/* Colores de fondo específicos para cada prop firm */
.firm-card[data-company="ftmo"] .firm-logo {
  background: #1c1c1c;
}

.firm-card[data-company="e2t"] .firm-logo {
  background: #0d1318;
}

.firm-card[data-company="blue-guardian"] .firm-logo {
  background: #062133;
}

.firm-card[data-company="alpha-futures"] .firm-logo {
  background: #14af84;
}

.firm-card[data-company="aqua-futures"] .firm-logo {
  background: #272735;
}

.firm-card[data-company="the5ers"] .firm-logo {
  background: #001c38;
}

.firm-card:hover .firm-logo {
  transform: scale(1.05);
  box-shadow: var(--shadow-md);
}

.firm-details h3 {
  font-size: 1.3rem;
  color: var(--text);
  margin-bottom: 0.5rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.firm-meta {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  font-size: 0.95rem;
}

.rating {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--yellow);
  font-weight: 600;
}

.country-flag {
  width: 24px;
  height: 18px;
  border-radius: 3px;
  box-shadow: var(--shadow-sm);
}

.country-name {
  margin-top: 0.3rem;
  font-size: 0.85rem;
  font-weight: 600;
}

.reviews-count {
  color: var(--text-muted);
  font-weight: 500;
}

/* Stats */
.stat-cell {
  text-align: center;
  font-weight: 700;
}

.capital-amount {
  font-size: 1.3rem;
  color: var(--highlight);
  font-weight: 800;
}

.capital-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
}

.reviews-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.trustpilot-rating {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, var(--trustpilot), #059669);
  color: white;
  padding: 0.6rem 1rem;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 700;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease;
}

.trustpilot-rating:hover {
  transform: scale(1.02);
}

.trustpilot-stars {
  display: flex;
  gap: 2px;
}

.trustpilot-star {
  width: 14px;
  height: 14px;
  background: rgba(255, 255, 255, 0.3);
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
  transition: all 0.2s ease;
}

.trustpilot-star.filled {
  background: white;
  filter: drop-shadow(0 0 2px rgba(255, 255, 255, 0.5));
}

.trustpilot-star.half {
  background: linear-gradient(90deg, white 50%, rgba(255, 255, 255, 0.3) 50%);
}

.trustpilot-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.trustpilot-link:hover {
  color: var(--trustpilot);
  transform: translateY(-1px);
}

.loading {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.platforms {
  display: flex;
  gap: 0.6rem;
  justify-content: center;
  flex-wrap: wrap;
}

.platform-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: white;
  font-weight: 700;
  transition: all 0.3s ease;
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(10px);
  cursor: help;
  position: relative;
}

.platform-icon:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* Tooltip styles */
.platform-icon::before {
  content: attr(title);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.9);
  color: white;
  padding: 0.5rem 0.8rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 1000;
  pointer-events: none;
  margin-bottom: 5px;
}

.platform-icon::after {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 4px solid transparent;
  border-top-color: rgba(0, 0, 0, 0.9);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 1000;
  pointer-events: none;
  margin-bottom: 1px;
}

.platform-icon:hover::before,
.platform-icon:hover::after {
  opacity: 1;
  visibility: visible;
}

.platform-icon.mt4 { background: linear-gradient(135deg, #2563eb, #1d4ed8); }
.platform-icon.mt5 { background: linear-gradient(135deg, #7c3aed, #6d28d9); }
.platform-icon.trader { background: linear-gradient(135deg, #059669, #047857); }
.platform-icon.ninjatrader { background: linear-gradient(135deg, #dc2626, #b91c1c); }
.platform-icon.tradovate { background: linear-gradient(135deg, #0891b2, #0e7490); }
.platform-icon.quantower { background: linear-gradient(135deg, #ea580c, #c2410c); }
.platform-icon.sierra { background: linear-gradient(135deg, #65a30d, #4d7c0f); }
.platform-icon.tradingview { background: linear-gradient(135deg, #1e40af, #1e3a8a); }
.platform-icon.alphaticks { background: linear-gradient(135deg, #059669, #047857); }
.platform-icon.rithmic { background: linear-gradient(135deg, #7c2d12, #92400e); }

/* Promo Cell - Minimalista con indicios visuales de copiado */
.promo-cell {
  display: flex;
  justify-content: center;
  align-items: center;
}

.promo-card {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  padding: 0.8rem 1.2rem;
  border-radius: 10px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.1);
  box-shadow: 
    0 3px 15px rgba(239, 68, 68, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  user-select: none;
  min-width: 100px;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.promo-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s ease;
}

.promo-card:hover {
  transform: translateY(-3px);
  box-shadow: 
    0 8px 30px rgba(239, 68, 68, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.2);
}

.promo-card:hover::before {
  left: 100%;
}

.promo-card:hover .promo-code {
  background: rgba(0, 0, 0, 0.35);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

.promo-card:hover .promo-code::after {
  opacity: 1;
}

.promo-discount {
  font-size: 1.1rem;
  font-weight: 800;
  color: white;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.promo-code {
  font-size: 0.75rem;
  font-weight: 600;
  color: white;
  background: rgba(0, 0, 0, 0.25);
  padding: 0.35rem 0.7rem;
  border-radius: 6px;
  letter-spacing: 1px;
  font-family: 'Inter', sans-serif;
  text-transform: uppercase;
  border: 1px solid rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  position: relative;
  transition: all 0.3s ease;
}

.promo-code::after {
  content: '📋';
  position: absolute;
  right: -6px;
  top: -6px;
  font-size: 0.65rem;
  opacity: 0;
  transition: opacity 0.3s ease;
  background: rgba(255, 255, 255, 0.9);
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.promo-card.copied {
  background: linear-gradient(135deg, #10b981, #059669);
  transform: translateY(-3px);
}

.promo-card.copied .promo-code {
  background: rgba(255, 255, 255, 0.2);
}

.promo-card.copied .promo-code::before {
  content: '✓ ';
}

.promo-card.copied .promo-code::after {
  content: '✓';
  opacity: 1;
  background: rgba(255, 255, 255, 1);
  color: #10b981;
}

/* Estilo especial para "Sin Descuento" */
.promo-card[data-code="NO-CODE"] {
  background: linear-gradient(135deg, #6b7280, #4b5563);
  cursor: default;
}

.promo-card[data-code="NO-CODE"]:hover {
  transform: none;
  box-shadow: 
    0 4px 20px rgba(107, 114, 128, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Botones primarios optimizados para móvil iOS */
.btn-primary {
  background: linear-gradient(135deg, #10b981, #059669);
  border: none;
  color: white;
  font-weight: 700;
  padding: 0.8rem 1.2rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-width: 140px;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
  position: relative;
  overflow: hidden;
  text-transform: uppercase;
  letter-spacing: 0.2px;
  white-space: nowrap;
  /* Optimizaciones específicas para iOS */
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  /* Evitar zoom en iOS */
  touch-action: manipulation;
}

.btn-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  transition: left 0.4s ease;
}

.btn-primary:hover::before {
  left: 100%;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.4);
  background: linear-gradient(135deg, #059669, #047857);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

/* Mejoras específicas para móvil iOS */
@media (max-width: 768px) {
  .btn-primary {
    padding: 1rem 1.5rem;
    font-size: 0.9rem;
    min-width: 160px;
    /* Aumentar área de toque en móvil */
    min-height: 48px;
  }
  
  /* Evitar efectos hover en móvil */
  .btn-primary:hover {
    transform: none;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
    background: linear-gradient(135deg, #10b981, #059669);
  }
  
  /* Efecto de toque en móvil */
  .btn-primary:active {
    transform: scale(0.98);
    background: linear-gradient(135deg, #047857, #065f46);
  }
}

/* Actions - Simplificado */
.actions-cell {
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Sección de información SEO */
.info-section {
  background: white;
  margin-top: 5rem;
  padding: 4rem 0;
}

.info-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

.info-title {
  font-size: 2.5rem;
  color: #1f2937;
  text-align: center;
  margin-bottom: 3rem;
  font-weight: 800;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.info-card {
  background: #f9fafb;
  padding: 2rem;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
}

.info-card h3 {
  color: #1f2937;
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.info-card p {
  color: #4b5563;
  line-height: 1.7;
}

.info-card strong {
  color: #1f2937;
}

/* Responsive */
@media (max-width: 1200px) {
  .table-header,
  .firm-card {
    grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
  }
  
  .table-header > div:nth-child(3),
  .table-header > div:nth-child(4),
  .firm-card > div:nth-child(3),
  .firm-card > div:nth-child(4) {
    display: none;
  }
}

@media (max-width: 768px) {
  header h1 {
    font-size: 2.5rem;
  }

  .nav-title {
    padding: 1rem 1.5rem;
    font-size: 1rem;
  }

  .table-header {
    display: none;
  }
  
  .firm-card {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 1.5rem;
    padding: 1.5rem;
  }
  
  .firm-info {
    flex-direction: column;
    text-align: center;
  }
  
  .firm-meta {
    justify-content: center;
  }

  .info-title {
    font-size: 2rem;
  }

  .info-grid {
    grid-template-columns: 1fr;
  }
  
  /* Optimizaciones adicionales para iOS móvil */
  .promo-card {
    /* Aumentar área de toque */
    min-height: 44px;
    padding: 1rem 1.5rem;
  }
  
  .platform-icon {
    /* Mejorar tooltips en móvil */
    width: 36px;
    height: 36px;
  }
  
  /* Desactivar tooltips en móvil */
  .platform-icon::before,
  .platform-icon::after {
    display: none;
  }
}

/* Additional enhancements */
.pulse {
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.glow {
  filter: drop-shadow(0 0 10px rgba(99, 102, 241, 0.5));
}

/* Ripple effect animation */
@keyframes ripple {
  to {
    transform: scale(2);
    opacity: 0;
  }
}

/* Scroll animations optimizado */
@media (prefers-reduced-motion: no-preference) {
  .firm-card {
    animation-fill-mode: both;
  }
}

/* Evitar parpadeo en modo motion reducido */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  
  .firm-card {
    opacity: 1;
    transform: none;
  }
}