/* ============================================
   QUEATHER - Additional Animation Styles
   ============================================ */

/* ---------- Smooth Page Transitions ---------- */
.page-transition {
  animation: pageIn 0.6s ease-out;
}

@keyframes pageIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
  
}

#unitSelector {
  transition: opacity 0.3s ease;
}
.unit-toggle {
  transition: opacity 0.3s ease;
}

/* ---------- Glow Effects ---------- */
.glow-border {
  position: relative;
}

.glow-border::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-warm), var(--accent-primary));
  background-size: 300% 300%;
  animation: glowRotate 4s ease-in-out infinite;
  opacity: 0;
  transition: opacity var(--transition-smooth);
  z-index: -1;
}

.glow-border:hover::before {
  opacity: 1;
}

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

/* ---------- Ripple Effect ---------- */
.ripple {
  position: relative;
  overflow: hidden;
}

.ripple::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  pointer-events: none;
  background-image: radial-gradient(circle, rgba(108, 92, 231, 0.15) 10%, transparent 10.01%);
  background-repeat: no-repeat;
  background-position: 50%;
  transform: scale(10);
  opacity: 0;
  transition: transform 0.5s, opacity 0.8s;
}

.ripple:active::after {
  transform: scale(0);
  opacity: 1;
  transition: 0s;
}

/* ---------- Typewriter Effect ---------- */
.typewriter {
  overflow: hidden;
  border-right: 2px solid var(--accent-primary);
  white-space: nowrap;
  animation: 
    typing 3s steps(30) 1s 1 normal both,
    blink 0.7s step-end infinite;
}

@keyframes typing {
  from { width: 0; }
  to { width: 100%; }
}

@keyframes blink {
  50% { border-color: transparent; }
}

/* ---------- Shimmer Loading ---------- */
.shimmer {
  background: linear-gradient(
    90deg,
    var(--bg-card) 0%,
    var(--bg-card-hover) 40%,
    var(--bg-card) 80%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
}

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

/* ---------- Floating Elements ---------- */
.float-element {
  animation: floatUpDown 6s ease-in-out infinite;
}

.float-element:nth-child(2) { animation-delay: -2s; }
.float-element:nth-child(3) { animation-delay: -4s; }

@keyframes floatUpDown {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  25% { transform: translateY(-15px) rotate(2deg); }
  75% { transform: translateY(8px) rotate(-1deg); }
}

/* ---------- Card Tilt on Hover ---------- */
.tilt-card {
  transition: transform var(--transition-smooth);
  transform-style: preserve-3d;
  perspective: 1000px;
}

.tilt-card:hover {
  transform: perspective(1000px) rotateX(2deg) rotateY(-2deg) scale(1.02);
}

/* ---------- Stagger children animation ---------- */
.stagger-children > * {
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.5s ease-out;
}

.stagger-children.visible > * {
  opacity: 1;
  transform: translateY(0);
}

.stagger-children.visible > *:nth-child(1) { transition-delay: 0.1s; }
.stagger-children.visible > *:nth-child(2) { transition-delay: 0.2s; }
.stagger-children.visible > *:nth-child(3) { transition-delay: 0.3s; }
.stagger-children.visible > *:nth-child(4) { transition-delay: 0.4s; }
.stagger-children.visible > *:nth-child(5) { transition-delay: 0.5s; }
.stagger-children.visible > *:nth-child(6) { transition-delay: 0.6s; }
.stagger-children.visible > *:nth-child(7) { transition-delay: 0.7s; }
.stagger-children.visible > *:nth-child(8) { transition-delay: 0.8s; }
.stagger-children.visible > *:nth-child(n+9) { transition-delay: 0.9s; }

/* ---------- Hover Shine Effect ---------- */
.shine-effect {
  position: relative;
  overflow: hidden;
}

.shine-effect::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    to right,
    transparent 0%,
    rgba(255, 255, 255, 0.03) 45%,
    rgba(255, 255, 255, 0.08) 50%,
    rgba(255, 255, 255, 0.03) 55%,
    transparent 100%
  );
  transform: rotate(30deg) translateX(-100%);
  transition: transform 0.7s ease;
}

.shine-effect:hover::after {
  transform: rotate(30deg) translateX(100%);
}

/* ---------- Morphing Background Blob ---------- */
.morph-blob {
  border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
  animation: morphBlob 8s ease-in-out infinite;
}

@keyframes morphBlob {
  0%, 100% { border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; }
  25% { border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%; }
  50% { border-radius: 50% 60% 40% 70% / 40% 50% 60% 50%; }
  75% { border-radius: 40% 60% 50% 30% / 60% 40% 50% 70%; }
}

/* ---------- Text Reveal ---------- */
.text-reveal {
  clip-path: inset(0 100% 0 0);
  animation: textReveal 0.8s ease-out forwards;
}

@keyframes textReveal {
  to { clip-path: inset(0 0 0 0); }
}

/* ---------- Magnetic Hover (used with JS) ---------- */
.magnetic {
  transition: transform 0.3s cubic-bezier(0.2, 0, 0.2, 1);
}

/* ---------- Gradient Text Animations ---------- */
.animated-gradient {
  background: linear-gradient(
    270deg,
    var(--accent-primary),
    var(--accent-warm),
    var(--accent-secondary),
    #00cec9,
    var(--accent-primary)
  );
  background-size: 400% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientFlow 6s ease-in-out infinite;
}

@keyframes gradientFlow {
  0% { background-position: 0% center; }
  50% { background-position: 100% center; }
  100% { background-position: 0% center; }
}

/* ---------- Noise Texture Overlay ---------- */
.noise-overlay::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9999;
  opacity: 0.4;
}

/* ---------- Scroll Progress Bar ---------- */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-warm));
  z-index: 10000;
  transition: width 0.1s linear;
  border-radius: 0 2px 2px 0;
}

/* ---------- Cursor Glow (desktop only) ---------- */
.cursor-glow {
  position: fixed;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(108, 92, 231, 0.06) 0%, transparent 70%);
  pointer-events: none;
  z-index: 9998;
  transition: transform 0.1s ease-out;
  transform: translate(-50%, -50%);
}

@media (max-width: 768px) {
  .cursor-glow { display: none; }
}
