/* ============================================================================
   KI-DAY 2026 - Animations & Interactions
   ============================================================================
   Enhanced animations, scroll effects, and micro-interactions
   ============================================================================ */

/* === SCROLL ANIMATIONS === */
.scroll-reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.scroll-reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

.scroll-reveal--fade {
  opacity: 0;
  transition: opacity 0.6s ease-out;
}

.scroll-reveal--fade.revealed {
  opacity: 1;
}

.scroll-reveal--left {
  opacity: 0;
  transform: translateX(-30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.scroll-reveal--left.revealed {
  opacity: 1;
  transform: translateX(0);
}

.scroll-reveal--right {
  opacity: 0;
  transform: translateX(30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.scroll-reveal--right.revealed {
  opacity: 1;
  transform: translateX(0);
}

.scroll-reveal--scale {
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.scroll-reveal--scale.revealed {
  opacity: 1;
  transform: scale(1);
}

/* Stagger children animations */
.scroll-reveal-container > * {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.scroll-reveal-container.revealed > *:nth-child(1) {
  transition-delay: 0.1s;
}

.scroll-reveal-container.revealed > *:nth-child(2) {
  transition-delay: 0.2s;
}

.scroll-reveal-container.revealed > *:nth-child(3) {
  transition-delay: 0.3s;
}

.scroll-reveal-container.revealed > *:nth-child(4) {
  transition-delay: 0.4s;
}

.scroll-reveal-container.revealed > *:nth-child(5) {
  transition-delay: 0.5s;
}

.scroll-reveal-container.revealed > * {
  opacity: 1;
  transform: translateY(0);
}

/* === COUNTDOWN TIMER === */
.countdown {
  display: flex;
  gap: var(--spacing-lg);
  justify-content: center;
  margin: var(--spacing-xl) 0;
}

.countdown__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 80px;
}

.countdown__number {
  font-size: 3rem;
  font-weight: 700;
  font-family: var(--font-heading);
  background: linear-gradient(135deg, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0.8) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  margin-bottom: var(--spacing-xs);
}

.countdown__label {
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.8);
}

/* === PROGRESS BAR === */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, var(--brand-primary) 0%, var(--brand-secondary) 100%);
  z-index: calc(var(--z-sticky) + 1);
  transition: width 0.1s ease-out;
}

/* === LOADING SPINNER (Enhanced) === */
.spinner {
  display: inline-block;
  position: relative;
  width: 60px;
  height: 60px;
}

.spinner::after {
  content: "";
  display: block;
  width: 48px;
  height: 48px;
  margin: 6px;
  border-radius: 50%;
  border: 6px solid var(--brand-primary);
  border-color: var(--brand-primary) transparent var(--brand-primary) transparent;
  animation: spinner 1.2s linear infinite;
}

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

/* === PULSE ANIMATION === */
@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.05);
    opacity: 0.8;
  }
}

.pulse {
  animation: pulse 2s ease-in-out infinite;
}

/* === GRADIENT ANIMATION === */
@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

.gradient-animated {
  background: linear-gradient(270deg, var(--brand-primary), var(--brand-secondary), var(--brand-accent));
  background-size: 200% 200%;
  animation: gradientShift 8s ease infinite;
}

/* === FLOATING ANIMATION === */
@keyframes float {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
}

.float {
  animation: float 3s ease-in-out infinite;
}

/* === TYPING INDICATOR === */
.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 10px;
}

.typing-indicator span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--brand-primary);
  animation: typing 1.4s infinite;
}

.typing-indicator span:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typing {
  0%, 60%, 100% {
    transform: translateY(0);
    opacity: 0.7;
  }
  30% {
    transform: translateY(-10px);
    opacity: 1;
  }
}

/* === RIPPLE EFFECT === */
.ripple {
  position: relative;
  overflow: hidden;
}

.ripple::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.ripple:active::after {
  width: 300px;
  height: 300px;
}

/* === SHIMMER EFFECT (Loading skeleton) === */
@keyframes shimmer {
  0% {
    background-position: -468px 0;
  }
  100% {
    background-position: 468px 0;
  }
}

.shimmer {
  animation: shimmer 1.2s ease-in-out infinite;
  background: linear-gradient(to right, #f6f6f6 8%, #f0f0f0 18%, #f6f6f6 33%);
  background-size: 800px 104px;
}

.skeleton {
  background-color: #f0f0f0;
  border-radius: var(--radius-sm);
}

.skeleton--text {
  height: 1em;
  margin-bottom: 0.5em;
}

.skeleton--circle {
  border-radius: 50%;
  width: 100px;
  height: 100px;
}

.skeleton--rect {
  width: 100%;
  height: 200px;
}

/* === TOOLTIP === */
.tooltip {
  position: relative;
  cursor: help;
}

.tooltip::before,
.tooltip::after {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-base), transform var(--transition-base);
}

.tooltip::before {
  content: attr(data-tooltip);
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-4px);
  background-color: var(--text-dark);
  color: white;
  padding: var(--spacing-xs) var(--spacing-sm);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  white-space: nowrap;
  margin-bottom: 8px;
  z-index: var(--z-dropdown);
}

.tooltip::after {
  content: "";
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--text-dark);
  margin-bottom: 2px;
}

.tooltip:hover::before,
.tooltip:hover::after {
  opacity: 1;
}

/* === BADGE === */
.badge {
  display: inline-block;
  padding: 0.25em 0.6em;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
  color: white;
  text-align: center;
  white-space: nowrap;
  vertical-align: baseline;
  border-radius: var(--radius-full);
}

.badge--primary {
  background-color: var(--brand-primary);
}

.badge--success {
  background-color: var(--success);
}

.badge--warning {
  background-color: var(--warning);
  color: var(--text-dark);
}

.badge--error {
  background-color: var(--error);
}

.badge--new {
  animation: pulse 2s ease-in-out infinite;
}

/* === NOTIFICATION TOAST === */
.toast {
  position: fixed;
  bottom: var(--spacing-lg);
  right: var(--spacing-lg);
  min-width: 300px;
  max-width: 400px;
  padding: var(--spacing-md);
  background-color: var(--bg-white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: calc(var(--z-modal) + 1);
  animation: toastSlideIn 0.3s ease-out;
}

.toast.hiding {
  animation: toastSlideOut 0.3s ease-in;
}

@keyframes toastSlideIn {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes toastSlideOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(400px);
    opacity: 0;
  }
}

.toast--success {
  border-left: 4px solid var(--success);
}

.toast--error {
  border-left: 4px solid var(--error);
}

.toast--warning {
  border-left: 4px solid var(--warning);
}

.toast--info {
  border-left: 4px solid var(--info);
}

.toast__close {
  position: absolute;
  top: var(--spacing-sm);
  right: var(--spacing-sm);
  background: none;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  color: var(--text-medium);
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: background-color var(--transition-fast);
}

.toast__close:hover {
  background-color: var(--bg-light);
}

/* === ACCORDION ANIMATION === */
.accordion__content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
}

.accordion__item.active .accordion__content {
  max-height: 1000px; /* Large enough for content */
  transition: max-height 0.5s ease-in;
}

.accordion__trigger {
  width: 100%;
  text-align: left;
  padding: var(--spacing-md);
  background-color: var(--bg-card);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background-color var(--transition-fast);
}

.accordion__trigger:hover {
  background-color: var(--bg-light);
}

.accordion__icon {
  transition: transform var(--transition-base);
}

.accordion__item.active .accordion__icon {
  transform: rotate(180deg);
}

/* === SMOOTH SCROLL OFFSET FOR FIXED NAV === */
html {
  scroll-padding-top: 80px; /* Height of navbar */
}

/* === PARALLAX EFFECT === */
.parallax {
  background-attachment: fixed;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

/* === IMAGE ZOOM ON HOVER === */
.zoom-on-hover {
  overflow: hidden;
}

.zoom-on-hover img {
  transition: transform 0.5s ease;
}

.zoom-on-hover:hover img {
  transform: scale(1.1);
}

/* === GLITCH EFFECT (Optional for special events) === */
@keyframes glitch {
  0%, 100% {
    transform: translate(0);
  }
  20% {
    transform: translate(-2px, 2px);
  }
  40% {
    transform: translate(-2px, -2px);
  }
  60% {
    transform: translate(2px, 2px);
  }
  80% {
    transform: translate(2px, -2px);
  }
}

.glitch {
  animation: glitch 0.3s ease-in-out;
}

/* === PERFORMANCE OPTIMIZATIONS === */
.will-animate {
  will-change: transform, opacity;
}

/* Remove will-change after animation */
.animated {
  will-change: auto;
}

/* === ACCESSIBILITY: Respect prefers-reduced-motion === */
@media (prefers-reduced-motion: reduce) {
  .scroll-reveal,
  .scroll-reveal--fade,
  .scroll-reveal--left,
  .scroll-reveal--right,
  .scroll-reveal--scale,
  .scroll-reveal-container > * {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  .pulse,
  .float,
  .gradient-animated,
  .shimmer,
  .glitch {
    animation: none !important;
  }
}
