/* AI Studio — premium animations & polish layer */

.ai-hero {
  background: linear-gradient(135deg, #3d2a6e 0%, #5b3f9e 25%, #8868c9 50%, #6542a9 75%, #2d1b69 100%);
  background-size: 200% 200%;
  animation: aiHeroGradient 12s ease infinite;
}

@keyframes aiHeroGradient {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.ai-hero::after {
  content: '';
  position: absolute;
  width: 300px;
  height: 300px;
  top: -80px;
  right: 10%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 215, 0, 0.15) 0%, transparent 70%);
  animation: aiHeroOrb 10s ease-in-out infinite alternate;
  pointer-events: none;
}

@keyframes aiHeroOrb {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(-30px, 20px) scale(1.15); }
}

.ai-badge {
  animation: aiBadgeFloat 4s ease-in-out infinite;
}

.ai-badge:nth-child(2) { animation-delay: -1.3s; }
.ai-badge:nth-child(3) { animation-delay: -2.6s; }

@keyframes aiBadgeFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.ai-tab {
  position: relative;
  overflow: hidden;
}

.ai-tab.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 20%;
  right: 20%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--ai-primary), transparent);
  animation: aiTabGlow 2s ease-in-out infinite;
}

@keyframes aiTabGlow {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

.ai-panel {
  position: relative;
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.ai-panel::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 19px;
  padding: 1px;
  background: linear-gradient(135deg, rgba(136,104,201,.35), transparent 40%, rgba(255,215,0,.2));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.ai-panel:hover::before { opacity: 1; }

.ai-btn-primary {
  position: relative;
  overflow: hidden;
}

.ai-btn-primary::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.2), transparent);
  animation: aiBtnShine 3.5s ease-in-out infinite;
}

@keyframes aiBtnShine {
  0% { left: -100%; }
  35%, 100% { left: 150%; }
}

.ai-preview {
  background: linear-gradient(145deg, #0d0d12 0%, #1a1a24 100%);
}

.ai-preview-placeholder i {
  animation: aiPreviewPulse 2.5s ease-in-out infinite;
}

@keyframes aiPreviewPulse {
  0%, 100% { transform: scale(1); opacity: 0.4; }
  50% { transform: scale(1.08); opacity: 0.65; }
}

.ai-spinner {
  border-top-color: #ffd700;
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
}

.ai-loading.active {
  backdrop-filter: blur(4px);
}

.ai-design-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ai-design-card:hover {
  transform: translateY(-2px);
}

.ai-design-card.selected {
  animation: aiCardSelect 0.4s ease;
}

@keyframes aiCardSelect {
  0% { transform: scale(1); }
  50% { transform: scale(1.03); }
  100% { transform: scale(1); }
}

.ai-fab {
  animation: aiFabPulse 3s ease-in-out infinite;
}

@keyframes aiFabPulse {
  0%, 100% { box-shadow: 0 6px 24px rgba(101, 66, 169, 0.4); }
  50% { box-shadow: 0 8px 32px rgba(136, 104, 201, 0.55); }
}

body.dark-mode .ai-section {
  background: linear-gradient(180deg, var(--dark-bg, #121212) 0%, #0e0e14 100%);
}

body.dark-mode .ai-panel {
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

body.dark-mode .ai-preview {
  background: linear-gradient(145deg, #08080c 0%, #12121a 100%);
  border: 1px solid rgba(136, 104, 201, 0.15);
}

@media (max-width: 768px) {
  .ai-hero { padding: 40px 0 36px; }
  .ai-workspace { gap: 16px; }
  .ai-panel { padding: 18px 16px; }
  .ai-preview { min-height: 280px; }
}

@media (prefers-reduced-motion: reduce) {
  .ai-hero,
  .ai-badge,
  .ai-tab.active::after,
  .ai-btn-primary::after,
  .ai-preview-placeholder i,
  .ai-fab {
    animation: none !important;
  }
}
