/* =============================================
   DISPR ANIMATIONS
   Keyframes, Effects, Transitions, Micro-interactions
   ============================================== */

/* =============================================
   Core Animations - Reusable Keyframes
   ============================================== */

/* Fade In */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Fade In Up */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Fade In Down */
@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Scale In */
@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Slide In Right */
@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Slide In Left */
@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* =============================================
   Circular/Orbital Animations (from ia.html)
   ============================================== */

/* Float Animation */
@keyframes float {
  0%, 100% {
    transform: translateY(0px) translateX(0px);
  }
  25% {
    transform: translateY(-15px) translateX(10px);
  }
  50% {
    transform: translateY(-25px) translateX(-5px);
  }
  75% {
    transform: translateY(-15px) translateX(-10px);
  }
}

/* Rotation */
@keyframes rotate {
  from {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

/* Pulse Strong */
@keyframes pulseStrong {
  0%, 100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.9;
  }
  50% {
    transform: translate(-50%, -50%) scale(1.15);
    opacity: 1;
  }
}

/* Inner Pulse */
@keyframes innerPulse {
  0%, 100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.8;
  }
  50% {
    transform: translate(-50%, -50%) scale(1.2);
    opacity: 1;
  }
}

/* Ring Pulse */
@keyframes ringPulse {
  0%, 100% {
    opacity: 0.5;
    border-color: rgba(14, 90, 79, 0.5);
  }
  50% {
    opacity: 1;
    border-color: rgba(14, 90, 79, 0.8);
  }
}

/* Orbiting Icons - 6 variations */
@keyframes orbitIcon1 {
  from {
    transform: translate(-50%, -50%) rotate(0deg) translateX(200px) rotate(0deg);
  }
  to {
    transform: translate(-50%, -50%) rotate(360deg) translateX(200px) rotate(-360deg);
  }
}

@keyframes orbitIcon2 {
  from {
    transform: translate(-50%, -50%) rotate(60deg) translateX(240px) rotate(-60deg);
  }
  to {
    transform: translate(-50%, -50%) rotate(420deg) translateX(240px) rotate(-420deg);
  }
}

@keyframes orbitIcon3 {
  from {
    transform: translate(-50%, -50%) rotate(120deg) translateX(180px) rotate(-120deg);
  }
  to {
    transform: translate(-50%, -50%) rotate(480deg) translateX(180px) rotate(-480deg);
  }
}

@keyframes orbitIcon4 {
  from {
    transform: translate(-50%, -50%) rotate(180deg) translateX(260px) rotate(-180deg);
  }
  to {
    transform: translate(-50%, -50%) rotate(540deg) translateX(260px) rotate(-540deg);
  }
}

@keyframes orbitIcon5 {
  from {
    transform: translate(-50%, -50%) rotate(240deg) translateX(190px) rotate(-240deg);
  }
  to {
    transform: translate(-50%, -50%) rotate(600deg) translateX(190px) rotate(-600deg);
  }
}

@keyframes orbitIcon6 {
  from {
    transform: translate(-50%, -50%) rotate(300deg) translateX(230px) rotate(-300deg);
  }
  to {
    transform: translate(-50%, -50%) rotate(660deg) translateX(230px) rotate(-660deg);
  }
}

/* Floating Dots */
@keyframes floatDot1 {
  0%, 100% {
    transform: translate(-50%, -50%) translate(150px, -80px);
    opacity: 0.4;
  }
  50% {
    transform: translate(-50%, -50%) translate(180px, -120px);
    opacity: 0.8;
  }
}

@keyframes floatDot2 {
  0%, 100% {
    transform: translate(-50%, -50%) translate(-120px, 90px);
    opacity: 0.3;
  }
  50% {
    transform: translate(-50%, -50%) translate(-150px, 130px);
    opacity: 0.7;
  }
}

@keyframes floatDot3 {
  0%, 100% {
    transform: translate(-50%, -50%) translate(100px, 140px);
    opacity: 0.5;
  }
  50% {
    transform: translate(-50%, -50%) translate(130px, 170px);
    opacity: 0.9;
  }
}

@keyframes floatDot4 {
  0%, 100% {
    transform: translate(-50%, -50%) translate(-160px, -70px);
    opacity: 0.4;
  }
  50% {
    transform: translate(-50%, -50%) translate(-190px, -100px);
    opacity: 0.8;
  }
}

/* =============================================
   Glow & Light Effects
   ============================================== */

/* Glow Pulse */
@keyframes glowPulse {
  0%, 100% {
    filter: drop-shadow(0 0 5px rgba(14, 90, 79, 0.5));
  }
  50% {
    filter: drop-shadow(0 0 20px rgba(14, 90, 79, 0.8));
  }
}

/* Border Glow */
@keyframes borderGlow {
  0%, 100% {
    box-shadow: 0 0 5px rgba(14, 90, 79, 0.2);
  }
  50% {
    box-shadow: 0 0 20px rgba(14, 90, 79, 0.4);
  }
}

/* Shimmer Effect */
@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

/* =============================================
   Gradient & Color Animations
   ============================================== */

/* Gradient Shift */
@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* =============================================
   Particle & Background Effects
   ============================================== */

/* Floating Particles */
@keyframes floatParticles {
  0%, 100% {
    transform: translateY(0) translateX(0);
    opacity: 0.2;
  }
  25% {
    transform: translateY(-50px) translateX(30px);
    opacity: 0.4;
  }
  50% {
    transform: translateY(-100px) translateX(-20px);
    opacity: 0.3;
  }
  75% {
    transform: translateY(-70px) translateX(40px);
    opacity: 0.35;
  }
}

/* =============================================
   UI Micro-interactions
   ============================================== */

/* Bounce Animation */
@keyframes bounce {
  0%, 80%, 100% {
    transform: scale(0);
    opacity: 0.5;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Breathe Animation */
@keyframes breathe {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

/* Pulse */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

/* Arrow Slide (for buttons) */
@keyframes arrowSlide {
  0%, 100% {
    transform: translateX(0);
  }
  50% {
    transform: translateX(5px);
  }
}

/* Blink (for cursor) */
@keyframes blink {
  50% {
    opacity: 0;
  }
}

/* Spin */
@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* =============================================
   Scroll-based Animations (IntersectionObserver ready)
   ============================================== */

.animate-on-scroll {
  opacity: 0;
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}

.animate-fade-in {
  animation: fadeIn 0.8s ease forwards;
}

.animate-fade-in-up {
  animation: fadeInUp 0.8s ease forwards;
}

.animate-slide-in-right {
  animation: slideInRight 0.8s ease forwards;
}

.animate-slide-in-left {
  animation: slideInLeft 0.8s ease forwards;
}

.animate-scale-in {
  animation: scaleIn 0.8s ease forwards;
}

/* Animation Delays */
.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }
.delay-400 { animation-delay: 0.4s; }
.delay-500 { animation-delay: 0.5s; }

/* =============================================
   AI Circle Animation System (IA page specific)
   ============================================== */

/* Animated Circle Container - Centered within hero */
.ai-circle-container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 700px;
  height: 700px;
  z-index: var(--z-base);
  pointer-events: none;
}

.ai-circle-orbit {
  position: relative;
  width: 100%;
  height: 100%;
  animation: float 6s ease-in-out infinite;
}

/* Main Circle - Glowing Core */
.ai-circle-main {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 220px;
  height: 220px;
  background: radial-gradient(
    circle,
    rgba(14, 90, 79, 0.8) 0%,
    rgba(14, 90, 79, 0.4) 30%,
    rgba(14, 90, 79, 0.2) 60%,
    transparent 100%
  );
  border-radius: 50%;
  animation: pulseStrong 2.5s ease-in-out infinite;
  box-shadow: 
    0 0 40px rgba(14, 90, 79, 0.6),
    0 0 80px rgba(14, 90, 79, 0.4),
    0 0 120px rgba(14, 90, 79, 0.2);
  will-change: transform;
  backface-visibility: hidden;
}

/* Inner glow effect */
.ai-circle-main::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 140px;
  height: 140px;
  background: radial-gradient(
    circle,
    rgba(14, 90, 79, 1) 0%,
    rgba(14, 90, 79, 0.6) 50%,
    transparent 100%
  );
  border-radius: 50%;
  animation: innerPulse 2s ease-in-out infinite;
}

/* Orbiting Rings */
.ai-circle-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 1.5px solid rgba(14, 90, 79, 0.4);
  box-shadow: 
    0 0 15px rgba(14, 90, 79, 0.2),
    inset 0 0 15px rgba(14, 90, 79, 0.1);
}

.ai-ring-1 {
  width: 320px;
  height: 320px;
  animation: rotate 20s linear infinite, ringPulse 3s ease-in-out infinite;
}

.ai-ring-2 {
  width: 480px;
  height: 480px;
  animation: rotate 30s linear infinite reverse, ringPulse 3s ease-in-out infinite 0.5s;
  border-style: dashed;
  border-width: 1.5px;
}

/* Orbiting Icons */
.ai-orbit-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(14, 90, 79, 0.15);
  border: 1px solid rgba(14, 90, 79, 0.3);
  border-radius: 50%;
  color: rgba(14, 90, 79, 0.7);
  font-size: 18px;
  backdrop-filter: blur(5px);
  box-shadow: 0 0 20px rgba(14, 90, 79, 0.2);
}

.ai-icon-1 { animation: orbitIcon1 12s linear infinite; }
.ai-icon-2 { animation: orbitIcon2 14s linear infinite; }
.ai-icon-3 { animation: orbitIcon3 16s linear infinite; }
.ai-icon-4 { animation: orbitIcon4 13s linear infinite; }
.ai-icon-5 { animation: orbitIcon5 15s linear infinite; }
.ai-icon-6 { animation: orbitIcon6 17s linear infinite; }

/* Small floating dots */
.ai-floating-dot {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 6px;
  height: 6px;
  background: rgba(14, 90, 79, 0.6);
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(14, 90, 79, 0.5);
}

.ai-dot-1 { animation: floatDot1 8s ease-in-out infinite; }
.ai-dot-2 { animation: floatDot2 10s ease-in-out infinite; }
.ai-dot-3 { animation: floatDot3 9s ease-in-out infinite; }
.ai-dot-4 { animation: floatDot4 11s ease-in-out infinite; }

/* =============================================
   AI Chat Animation (IA page specific)
   ============================================== */

.ai-chat-demo {
  position: relative;
  min-height: 550px;
  height: auto;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 40px;
}

.ai-chat-demo::before {
  content: '\f27a';
  font-family: 'FontAwesome';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 120px;
  color: rgba(14, 90, 79, 0.05);
  z-index: var(--z-background);
  pointer-events: none;
}

.ai-messages-container {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 25px;
  z-index: var(--z-content);
}

/* Chat Bubbles */
.chat-bubble {
  max-width: 85%;
  padding: 18px 25px;
  border-radius: 20px;
  font-size: 16px;
  line-height: 1.6;
  position: relative;
  box-shadow: var(--shadow-sm);
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.chat-bubble.visible {
  opacity: 1;
  transform: translateY(0);
}

.chat-bubble.user {
  align-self: flex-end;
  background: linear-gradient(135deg, rgba(14, 90, 79, 0.8) 0%, rgba(14, 90, 72, 0.9) 100%);
  border: 1px solid rgba(135, 213, 195, 0.3);
  border-bottom-right-radius: 4px;
  color: #fff;
}

.chat-bubble.ai {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom-left-radius: 4px;
  color: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
}

.chat-bubble .avatar {
  position: absolute;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

.chat-bubble.user .avatar {
  right: -10px;
  bottom: -10px;
  background: var(--accent-dark);
  border: 2px solid var(--bg-dark);
}

.chat-bubble.ai .avatar {
  left: -10px;
  bottom: -10px;
  background: var(--bg-dark);
  border: 2px solid var(--accent-border);
  color: var(--accent-text);
  font-size: 14px;
}

/* Thinking Indicator */
.thinking-indicator {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.03);
  padding: 15px 25px;
  border-radius: 20px;
  border-bottom-left-radius: 4px;
  display: none;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.thinking-indicator.visible {
  display: flex;
  animation: fadeIn 0.3s ease forwards;
}

.dot {
  width: 8px;
  height: 8px;
  background: rgba(135, 213, 195, 0.6);
  border-radius: 50%;
  animation: bounce 1.4s infinite ease-in-out both;
}

.dot:nth-child(1) { animation-delay: -0.32s; }
.dot:nth-child(2) { animation-delay: -0.16s; }

/* Typing Cursor */
.cursor::after {
  content: '|';
  animation: blink 1s step-end infinite;
  color: var(--accent-text);
  margin-left: 2px;
}

/* Chat Table Style */
.chat-table {
  width: 100%;
  margin: 12px 0;
  border-collapse: collapse;
  font-size: 14px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  overflow: hidden;
}

.chat-table tr {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.chat-table tr:last-child {
  border-bottom: none;
}

.chat-table td {
  padding: 8px 12px;
  color: rgba(255, 255, 255, 0.8);
}

/* =============================================
   Responsive Animation Adjustments
   ============================================== */

@media (max-width: 991px) {
  .ai-circle-container {
    width: 450px;
    height: 450px;
  }
  
  .ai-circle-main {
    width: 170px;
    height: 170px;
  }
  
  .ai-ring-1 {
    width: 250px;
    height: 250px;
  }
  
  .ai-ring-2 {
    width: 370px;
    height: 370px;
  }
  
  .ai-orbit-icon {
    width: 32px;
    height: 32px;
    font-size: 14px;
  }
  
  /* Adjust orbit radius for tablets */
  @keyframes orbitIcon1 { 
    from { transform: translate(-50%, -50%) rotate(0deg) translateX(150px) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg) translateX(150px) rotate(-360deg); }
  }
  @keyframes orbitIcon2 { 
    from { transform: translate(-50%, -50%) rotate(60deg) translateX(185px) rotate(-60deg); }
    to { transform: translate(-50%, -50%) rotate(420deg) translateX(185px) rotate(-420deg); }
  }
  @keyframes orbitIcon3 { 
    from { transform: translate(-50%, -50%) rotate(120deg) translateX(130px) rotate(-120deg); }
    to { transform: translate(-50%, -50%) rotate(480deg) translateX(130px) rotate(-480deg); }
  }
  @keyframes orbitIcon4 { 
    from { transform: translate(-50%, -50%) rotate(180deg) translateX(200px) rotate(-180deg); }
    to { transform: translate(-50%, -50%) rotate(540deg) translateX(200px) rotate(-540deg); }
  }
  @keyframes orbitIcon5 { 
    from { transform: translate(-50%, -50%) rotate(240deg) translateX(140px) rotate(-240deg); }
    to { transform: translate(-50%, -50%) rotate(600deg) translateX(140px) rotate(-600deg); }
  }
  @keyframes orbitIcon6 { 
    from { transform: translate(-50%, -50%) rotate(300deg) translateX(170px) rotate(-300deg); }
    to { transform: translate(-50%, -50%) rotate(660deg) translateX(170px) rotate(-660deg); }
  }
}

@media (max-width: 767px) {
  .ai-circle-container {
    width: 320px;
    height: 320px;
  }
  
  .ai-circle-main {
    width: 120px;
    height: 120px;
  }
  
  .ai-ring-1 {
    width: 180px;
    height: 180px;
  }
  
  .ai-ring-2 {
    width: 260px;
    height: 260px;
  }
  
  .ai-orbit-icon {
    width: 28px;
    height: 28px;
    font-size: 12px;
  }
  
  .ai-floating-dot {
    width: 4px;
    height: 4px;
  }
  
  /* Adjust orbit radius for mobile */
  @keyframes orbitIcon1 { 
    from { transform: translate(-50%, -50%) rotate(0deg) translateX(100px) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg) translateX(100px) rotate(-360deg); }
  }
  @keyframes orbitIcon2 { 
    from { transform: translate(-50%, -50%) rotate(60deg) translateX(130px) rotate(-60deg); }
    to { transform: translate(-50%, -50%) rotate(420deg) translateX(130px) rotate(-420deg); }
  }
  @keyframes orbitIcon3 { 
    from { transform: translate(-50%, -50%) rotate(120deg) translateX(90px) rotate(-120deg); }
    to { transform: translate(-50%, -50%) rotate(480deg) translateX(90px) rotate(-480deg); }
  }
  @keyframes orbitIcon4 { 
    from { transform: translate(-50%, -50%) rotate(180deg) translateX(140px) rotate(-180deg); }
    to { transform: translate(-50%, -50%) rotate(540deg) translateX(140px) rotate(-540deg); }
  }
  @keyframes orbitIcon5 { 
    from { transform: translate(-50%, -50%) rotate(240deg) translateX(95px) rotate(-240deg); }
    to { transform: translate(-50%, -50%) rotate(600deg) translateX(95px) rotate(-600deg); }
  }
  @keyframes orbitIcon6 { 
    from { transform: translate(-50%, -50%) rotate(300deg) translateX(120px) rotate(-300deg); }
    to { transform: translate(-50%, -50%) rotate(660deg) translateX(120px) rotate(-660deg); }
  }
  
  .ai-chat-demo {
    padding: 30px 20px;
    min-height: 450px;
  }
}

/* =============================================
   Performance Optimizations
   ============================================== */

/* GPU Acceleration for animated elements */
.ai-circle-main,
.ai-circle-ring,
.ai-orbit-icon,
.theme-btn-fifteen,
.card-hover {
  will-change: transform;
  transform: translateZ(0);
  backface-visibility: hidden;
}

/* NOTE: .feature-card removed from this list - no animation wanted */

/* Reduce motion for accessibility */
@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;
  }
  
  .ai-circle-orbit,
  .ai-circle-main,
  .ai-circle-ring,
  .ai-orbit-icon,
  .ai-floating-dot {
    animation: none !important;
  }
}
