/* AI-Themed Design System */

/* Updated AI Color Variables */
:root {
  /* AI Brand Colors */
  --ai-primary: #00ffff;
  --ai-secondary: #ff0080;
  --ai-accent: #7c3aed;
  --ai-glow: #00ffff;
  --ai-neural: #8b5cf6;
  
  /* AI Gradients */
  --ai-gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --ai-gradient-neural: linear-gradient(45deg, #00ffff, #ff0080, #7c3aed);
  --ai-gradient-cyber: linear-gradient(135deg, #0f0f0f 0%, #1a1a2e 50%, #16213e 100%);
  --ai-gradient-hologram: linear-gradient(45deg, transparent 30%, rgba(0,255,255,0.1) 50%, transparent 70%);
  
  /* AI Shadows */
  --ai-shadow-glow: 0 0 20px rgba(0, 255, 255, 0.3);
  --ai-shadow-neural: 0 0 30px rgba(139, 92, 246, 0.4);
  --ai-shadow-cyber: 0 10px 30px rgba(0, 0, 0, 0.8);
  
  /* AI Animations */
  --ai-pulse-duration: 2s;
  --ai-glow-duration: 3s;
  --ai-neural-duration: 4s;
}

/* Dark theme AI enhancements */
[data-theme="dark"] {
  --ai-primary: #00d9ff;
  --ai-secondary: #ff1a8c;
  --ai-accent: #9d5bff;
  --ai-glow: #00d9ff;
  
  /* Enhanced dark backgrounds */
  --bg-primary: #0a0a0a;
  --bg-secondary: #111111;
  --bg-tertiary: #1a1a1a;
  --bg-card: linear-gradient(145deg, #1a1a1a 0%, #0f0f0f 100%);
}

/* AI Neural Network Background */
.neural-network {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

#neural-canvas {
  width: 100%;
  height: 100%;
  opacity: 0.6;
}

[data-theme="dark"] #neural-canvas {
  opacity: 0.8;
}

/* AI Particles */
.ai-particles {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.ai-particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: var(--ai-primary);
  border-radius: 50%;
  animation: aiFloat var(--ai-neural-duration) infinite ease-in-out;
  box-shadow: 0 0 10px var(--ai-primary);
}

@keyframes aiFloat {
  0%, 100% { 
    transform: translateY(0) scale(1);
    opacity: 0.7;
  }
  50% { 
    transform: translateY(-30px) scale(1.5);
    opacity: 1;
  }
}

/* AI Glow Effects */
.ai-glow {
  position: relative;
  transition: all 0.3s ease;
}

.ai-glow::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: var(--ai-gradient-neural);
  border-radius: inherit;
  opacity: 0;
  z-index: -1;
  transition: opacity 0.3s ease;
}

.ai-glow:hover::before {
  opacity: 0.7;
  animation: aiGlow var(--ai-glow-duration) infinite;
}

@keyframes aiGlow {
  0%, 100% { transform: scale(1); opacity: 0.7; }
  50% { transform: scale(1.05); opacity: 1; }
}

/* AI Pulse Effects */
.ai-pulse {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  background: var(--ai-primary);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  animation: aiPulse var(--ai-pulse-duration) infinite;
  opacity: 0.8;
}

@keyframes aiPulse {
  0% {
    transform: translate(-50%, -50%) scale(0.8);
    opacity: 1;
  }
  50% {
    transform: translate(-50%, -50%) scale(1.2);
    opacity: 0.5;
  }
  100% {
    transform: translate(-50%, -50%) scale(0.8);
    opacity: 1;
  }
}

/* AI Loading Spinner */
.ai-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid transparent;
  border-top: 3px solid var(--ai-primary);
  border-right: 3px solid var(--ai-secondary);
  border-radius: 50%;
  animation: aiSpin 1s linear infinite;
  position: relative;
}

.ai-spinner::before {
  content: '';
  position: absolute;
  top: -3px;
  left: -3px;
  right: -3px;
  bottom: -3px;
  border: 1px solid var(--ai-accent);
  border-radius: 50%;
  animation: aiSpin 2s linear infinite reverse;
}

@keyframes aiSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* AI Gradient Text */
.gradient-text {
  background: var(--ai-gradient-neural);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientShift 3s ease-in-out infinite;
  background-size: 200% 200%;
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* AI Buttons */
.ai-btn {
  position: relative;
  overflow: hidden;
  background: var(--ai-gradient-primary);
  border: 1px solid var(--ai-primary);
  color: white;
  text-shadow: 0 0 5px rgba(0, 255, 255, 0.5);
  transition: all 0.3s ease;
}

.ai-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--ai-shadow-glow), var(--shadow-lg);
  background: var(--ai-gradient-neural);
}

.ai-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: var(--ai-gradient-hologram);
  transition: left 0.5s ease;
}

.ai-btn:hover::before {
  left: 100%;
}

/* AI Icons */
.ai-icon {
  position: relative;
  display: inline-block;
}

.ai-icon::after {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: var(--ai-gradient-neural);
  border-radius: 50%;
  opacity: 0;
  animation: iconPulse 2s infinite;
}

@keyframes iconPulse {
  0%, 100% { opacity: 0; transform: scale(1); }
  50% { opacity: 0.3; transform: scale(1.1); }
}

/* AI Badges */
.ai-badge {
  background: var(--ai-gradient-primary);
  color: white;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: var(--ai-shadow-glow);
  animation: badgeGlow 2s infinite alternate;
}

@keyframes badgeGlow {
  0% { box-shadow: var(--ai-shadow-glow); }
  100% { box-shadow: 0 0 25px rgba(0, 255, 255, 0.5); }
}

/* AI Cards Enhanced */
.card.ai-glow {
  background: var(--bg-card);
  border: 1px solid rgba(0, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
}

.card.ai-glow::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 2px;
  background: var(--ai-gradient-neural);
  transition: left 0.5s ease;
}

.card.ai-glow:hover::after {
  left: 100%;
}

.card.ai-glow:hover {
  border-color: var(--ai-primary);
  box-shadow: var(--ai-shadow-glow), var(--shadow-xl);
  transform: translateY(-8px) scale(1.02);
}

/* AI Model Logos */
.model-logo-container {
  position: relative;
  display: inline-block;
}

.model-logo {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.model-logo-container:hover .model-logo {
  transform: scale(1.1);
  filter: brightness(1.2) contrast(1.1);
}

/* AI Loading States */
.ai-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: var(--text-secondary);
}

.ai-loading p {
  margin-top: 20px;
  font-size: 1.1rem;
  animation: aiPulseText 2s infinite;
}

@keyframes aiPulseText {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

/* AI Search Results */
.search-results {
  background: rgba(26, 26, 26, 0.95);
  border: 1px solid var(--ai-primary);
  backdrop-filter: blur(10px);
  box-shadow: var(--ai-shadow-glow);
}

[data-theme="light"] .search-results {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--ai-accent);
}

.search-result-item {
  padding: 16px;
  border-bottom: 1px solid rgba(0, 255, 255, 0.1);
  transition: all 0.3s ease;
}

.search-result-item:hover {
  background: rgba(0, 255, 255, 0.05);
  transform: translateX(8px);
}

/* AI Toast Notifications */
.ai-toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--ai-gradient-cyber);
  border: 1px solid var(--ai-primary);
  border-radius: 12px;
  padding: 16px 20px;
  color: white;
  z-index: 10000;
  opacity: 0;
  transform: translateY(100%);
  transition: all 0.3s ease;
  box-shadow: var(--ai-shadow-glow);
}

.ai-toast.show {
  opacity: 1;
  transform: translateY(0);
}

.ai-toast-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ai-toast-icon {
  font-size: 1.2rem;
  animation: aiPulse 2s infinite;
}

/* Ripple Effect */
.ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(0, 255, 255, 0.4);
  animation: rippleEffect 0.6s linear;
  pointer-events: none;
}

@keyframes rippleEffect {
  0% {
    transform: scale(0);
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 0;
  }
}

/* AI Hero Enhancements */
.hero {
  position: relative;
  background: var(--ai-gradient-cyber);
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(circle at 20% 80%, rgba(0, 255, 255, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(255, 0, 128, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 40% 40%, rgba(124, 58, 237, 0.1) 0%, transparent 50%);
  animation: aiBackground 10s infinite alternate;
}

@keyframes aiBackground {
  0%, 100% { opacity: 0.8; }
  50% { opacity: 1; }
}

/* AI Section Headers */
.section-title {
  position: relative;
  text-align: center;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 2px;
  background: var(--ai-gradient-neural);
  animation: titleGlow 2s infinite alternate;
}

@keyframes titleGlow {
  0% { box-shadow: 0 0 5px var(--ai-primary); }
  100% { box-shadow: 0 0 20px var(--ai-primary); }
}

/* AI Navigation Enhancements */
.header {
  background: rgba(10, 10, 10, 0.9);
  border-bottom: 1px solid rgba(0, 255, 255, 0.3);
  backdrop-filter: blur(10px);
}

[data-theme="light"] .header {
  background: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid rgba(124, 58, 237, 0.3);
}

.nav-link.active::after {
  background: var(--ai-gradient-neural);
  box-shadow: var(--ai-shadow-glow);
}

/* AI Mobile Navigation */
.mobile-nav {
  background: rgba(10, 10, 10, 0.95);
  border-top: 1px solid rgba(0, 255, 255, 0.3);
  backdrop-filter: blur(10px);
}

[data-theme="light"] .mobile-nav {
  background: rgba(255, 255, 255, 0.95);
  border-top: 1px solid rgba(124, 58, 237, 0.3);
}

.mobile-nav-item.active {
  color: var(--ai-primary);
  text-shadow: 0 0 10px var(--ai-primary);
}

/* AI Rating Stars */
.tool-rating {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.tool-rating .rating-number {
  color: var(--ai-primary);
  font-weight: 600;
  font-size: 0.9rem;
}

/* AI News Cards */
.news-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.news-source {
  font-weight: 600;
  font-size: 0.85rem;
}

.news-date {
  color: var(--text-tertiary);
  font-size: 0.8rem;
}

/* AI Animation Entry */
.card {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.card.animate-in {
  opacity: 1;
  transform: translateY(0);
}

/* AI Page Loading */
body.loaded {
  animation: pageReveal 1s ease-out;
}

@keyframes pageReveal {
  0% {
    opacity: 0;
    transform: scale(0.95);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* AI Responsive Enhancements */
@media (max-width: 768px) {
  .ai-particle {
    width: 3px;
    height: 3px;
  }
  
  .ai-pulse {
    width: 15px;
    height: 15px;
  }
  
  .ai-spinner {
    width: 30px;
    height: 30px;
  }
  
  .neural-network {
    opacity: 0.5;
  }
}

/* AI Performance Optimizations */
@media (prefers-reduced-motion: reduce) {
  .ai-particle,
  .ai-pulse,
  .ai-spinner,
  .gradient-text {
    animation: none;
  }
  
  .neural-network {
    display: none;
  }
}

/* AI High DPI Screens */
@media (-webkit-min-device-pixel-ratio: 2) {
  .ai-glow::before,
  .card.ai-glow {
    border-width: 0.5px;
  }
}