/* ===== TEMAS CLARO Y OSCURO ===== */

/* Tema claro (por defecto) */
.theme-light {
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-glass: rgba(255, 255, 255, 0.95);
  --text-primary: #1f2937;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;
  --border-color: rgba(255, 255, 255, 0.3);
  --shadow-color: rgba(0, 0, 0, 0.1);
}

/* Tema oscuro */
.theme-dark {
  --bg-primary: #1f2937;
  --bg-secondary: #111827;
  --bg-glass: rgba(31, 41, 55, 0.95);
  --text-primary: #f9fafb;
  --text-secondary: #d1d5db;
  --text-muted: #9ca3af;
  --border-color: rgba(255, 255, 255, 0.1);
  --shadow-color: rgba(0, 0, 0, 0.3);
}

/* Fondo tecnológico para tema claro */
.theme-light::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  opacity: 0.1;
}

/* Fondo tecnológico para tema oscuro */
.theme-dark::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%);
}

/* Grid animado para tema claro */
.theme-light::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 50px 50px;
  animation: grid-move 20s linear infinite;
}

/* Grid animado para tema oscuro */
.theme-dark::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 50px 50px;
  animation: grid-move 20s linear infinite;
}

@keyframes grid-move {
  0% {
    transform: translate(0, 0);
  }
  100% {
    transform: translate(50px, 50px);
  }
}

/* Ajustes específicos para tema oscuro */
.theme-dark .mobile-plans-header {
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

.theme-dark .filter-header {
  border-bottom-color: var(--color-movistar);
}

.theme-dark .btn-reset {
  border-color: var(--text-muted);
  color: var(--text-muted);
}

.theme-dark .btn-reset:hover {
  border-color: var(--color-orange);
  color: var(--color-orange);
}

.theme-dark .operator-filters label:hover,
.theme-dark .type-filters label:hover {
  background: var(--bg-primary);
}

.theme-dark .filter-group select {
  background: var(--bg-primary);
  border-color: var(--bg-secondary);
  color: var(--text-primary);
}

.theme-dark .product-card {
  border-color: rgba(255, 255, 255, 0.1);
}

.theme-dark .product-features {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(139, 92, 246, 0.1));
}

.theme-dark .comparison-card {
  border-color: rgba(255, 255, 255, 0.1);
}

.theme-dark .comparison-table th {
  background: var(--bg-primary);
}

.theme-dark .comparison-table th,
.theme-dark .comparison-table td {
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

.theme-dark .calculator-results {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(139, 92, 246, 0.1));
}

.theme-dark .result-item {
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

/* Partículas flotantes para ambos temas */
.tech-particles {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}

.tech-particle {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  animation: float-particle 15s infinite ease-in-out;
}

.theme-light .tech-particle {
  background: rgba(255, 255, 255, 0.3);
}

.theme-dark .tech-particle {
  background: rgba(255, 255, 255, 0.5);
}

@keyframes float-particle {
  0%, 100% {
    transform: translate(0, 0);
    opacity: 0;
  }
  
  10%, 90% {
    opacity: 1;
  }
  
  50% {
    transform: translate(100px, -100px);
  }
}

/* Transiciones suaves entre temas */
.mobile-plans-container,
.mobile-plans-header,
.filter-system,
.product-card,
.comparison-card,
.calculator-form {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Operadores con colores específicos */
.operator-movistar .price-amount,
.operator-movistar .product-title {
  color: var(--color-movistar) !important;
}

.operator-vodafone .price-amount,
.operator-vodafone .product-title {
  color: var(--color-vodafone) !important;
}

.operator-orange .price-amount,
.operator-orange .product-title {
  color: var(--color-orange) !important;
}

.operator-movistar .btn-contract {
  background: linear-gradient(135deg, var(--color-movistar), #0066cc) !important;
}

.operator-vodafone .btn-contract {
  background: linear-gradient(135deg, var(--color-vodafone), #cc0000) !important;
}

.operator-orange .btn-contract {
  background: linear-gradient(135deg, var(--color-orange), #e65c00) !important;
}

/* Estados de carga mejorados */
.skeleton {
  background: linear-gradient(90deg, 
    var(--bg-secondary) 25%, 
    var(--bg-glass) 50%, 
    var(--bg-secondary) 75%
  );
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
}

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

.skeleton-card {
  height: 400px;
  border-radius: var(--border-radius-xl);
}

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

.skeleton-text.large {
  height: 2rem;
}

.skeleton-text.small {
  height: 0.75rem;
  width: 60%;
}

/* Efectos de enfoque mejorados */
.focus-ring:focus {
  outline: 2px solid var(--color-movistar);
  outline-offset: 2px;
}

/* Indicadores de estado */
.status-indicator {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: var(--spacing-xs);
}

.status-indicator.online {
  background: #10b981;
  animation: pulse 2s infinite;
}

.status-indicator.offline {
  background: #ef4444;
}

.status-indicator.loading {
  background: #f59e0b;
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* Modo de alto contraste */
@media (prefers-contrast: high) {
  :root {
    --shadow-color: rgba(0, 0, 0, 0.3);
    --border-color: rgba(0, 0, 0, 0.3);
  }
  
  .theme-dark {
    --shadow-color: rgba(255, 255, 255, 0.3);
    --border-color: rgba(255, 255, 255, 0.3);
  }
  
  .product-card,
  .filter-system,
  .comparison-card,
  .calculator-form {
    border-width: 2px;
  }
}

/* Preferencias de movimiento reducido */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .tech-particle,
  .loading-spinner {
    animation: none;
  }
}