/**
 * AdQuecto Animations CSS
 * 洗練されたアニメーション効果
 */

/* ===========================================
   Scroll Animations
=========================================== */

.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity var(--duration-slower) var(--ease-out),
                transform var(--duration-slower) var(--ease-out);
}

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

/* Animation Delays */
.animate-delay-1 { transition-delay: 100ms; }
.animate-delay-2 { transition-delay: 200ms; }
.animate-delay-3 { transition-delay: 300ms; }
.animate-delay-4 { transition-delay: 400ms; }
.animate-delay-5 { transition-delay: 500ms; }
.animate-delay-6 { transition-delay: 600ms; }

/* ===========================================
   Fade Animations
=========================================== */

.fade-in {
    animation: fadeIn var(--duration-slow) var(--ease-out) forwards;
}

.fade-in-up {
    animation: fadeInUp var(--duration-slow) var(--ease-out) forwards;
}

.fade-in-down {
    animation: fadeInDown var(--duration-slow) var(--ease-out) forwards;
}

.fade-in-left {
    animation: fadeInLeft var(--duration-slow) var(--ease-out) forwards;
}

.fade-in-right {
    animation: fadeInRight var(--duration-slow) var(--ease-out) forwards;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

/* ===========================================
   Scale Animations
=========================================== */

.scale-in {
    animation: scaleIn var(--duration-slow) var(--ease-spring) forwards;
}

.scale-in-center {
    animation: scaleInCenter var(--duration-slow) var(--ease-spring) forwards;
}

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

@keyframes scaleInCenter {
    from {
        opacity: 0;
        transform: scale(0.5);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ===========================================
   Slide Animations
=========================================== */

.slide-in-up {
    animation: slideInUp var(--duration-slow) var(--ease-out) forwards;
}

.slide-in-down {
    animation: slideInDown var(--duration-slow) var(--ease-out) forwards;
}

@keyframes slideInUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

@keyframes slideInDown {
    from { transform: translateY(-100%); }
    to { transform: translateY(0); }
}

/* ===========================================
   Bounce & Pulse Animations
=========================================== */

.bounce {
    animation: bounce 2s infinite;
}

.pulse {
    animation: pulse 2s infinite;
}

.pulse-gold {
    animation: pulseGold 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-15px);
    }
    60% {
        transform: translateY(-8px);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.02);
    }
}

@keyframes pulseGold {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(201, 162, 39, 0.4);
    }
    50% {
        box-shadow: 0 0 0 15px rgba(201, 162, 39, 0);
    }
}

/* ===========================================
   Hero Animations
=========================================== */

.hero-fade-in {
    opacity: 0;
    animation: heroFadeIn var(--duration-slower) var(--ease-out) forwards;
}

.hero-fade-in-delay-1 { animation-delay: 200ms; }
.hero-fade-in-delay-2 { animation-delay: 400ms; }
.hero-fade-in-delay-3 { animation-delay: 600ms; }
.hero-fade-in-delay-4 { animation-delay: 800ms; }

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

/* ===========================================
   Scroll Indicator Animation
=========================================== */

.scroll-indicator {
    animation: scrollBounce 2s ease-in-out infinite;
}

@keyframes scrollBounce {
    0%, 100% {
        transform: translateY(0);
        opacity: 1;
    }
    50% {
        transform: translateY(8px);
        opacity: 0.5;
    }
}

/* ===========================================
   CTA Pulse Animation
=========================================== */

.cta-pulse {
    animation: ctaPulse 3s ease-in-out infinite;
}

@keyframes ctaPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: var(--shadow-gold);
    }
    50% {
        transform: scale(1.02);
        box-shadow: var(--shadow-gold-hover);
    }
}

/* ===========================================
   Counter Animation
=========================================== */

.counter-animate {
    animation: counterPop var(--duration-slow) var(--ease-spring) forwards;
}

@keyframes counterPop {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }
    70% {
        transform: scale(1.1);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* ===========================================
   Stagger Animation
=========================================== */

.stagger-item {
    opacity: 0;
    transform: translateY(20px);
}

.stagger-item.is-visible {
    animation: staggerIn var(--duration-slow) var(--ease-out) forwards;
}

.stagger-item:nth-child(1) { animation-delay: 0ms; }
.stagger-item:nth-child(2) { animation-delay: 100ms; }
.stagger-item:nth-child(3) { animation-delay: 200ms; }
.stagger-item:nth-child(4) { animation-delay: 300ms; }
.stagger-item:nth-child(5) { animation-delay: 400ms; }
.stagger-item:nth-child(6) { animation-delay: 500ms; }

@keyframes staggerIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===========================================
   Float Animation
=========================================== */

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

.float-delay-1 { animation-delay: 0.5s; }
.float-delay-2 { animation-delay: 1s; }
.float-delay-3 { animation-delay: 1.5s; }

@keyframes float {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    33% {
        transform: translateY(-10px) rotate(1deg);
    }
    66% {
        transform: translateY(-5px) rotate(-1deg);
    }
}

/* ===========================================
   Shimmer Animation
=========================================== */

.shimmer {
    position: relative;
    overflow: hidden;
}

.shimmer::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    100% {
        left: 100%;
    }
}

/* ===========================================
   Glow Animation
=========================================== */

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

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(201, 162, 39, 0.3),
                    0 0 10px rgba(201, 162, 39, 0.2),
                    0 0 15px rgba(201, 162, 39, 0.1);
    }
    50% {
        box-shadow: 0 0 10px rgba(201, 162, 39, 0.4),
                    0 0 20px rgba(201, 162, 39, 0.3),
                    0 0 30px rgba(201, 162, 39, 0.2);
    }
}

/* ===========================================
   Typewriter Animation
=========================================== */

.typewriter {
    overflow: hidden;
    border-right: 3px solid var(--color-accent-gold);
    white-space: nowrap;
    animation: 
        typing 3.5s steps(40, end),
        blink-caret 0.75s step-end infinite;
}

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

@keyframes blink-caret {
    from, to { border-color: transparent; }
    50% { border-color: var(--color-accent-gold); }
}

/* ===========================================
   Reveal Animation
=========================================== */

.reveal {
    position: relative;
    overflow: hidden;
}

.reveal::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--color-bg-primary);
    transform: scaleX(1);
    transform-origin: right;
    z-index: 1;
}

.reveal.is-visible::before {
    animation: revealSlide var(--duration-slow) var(--ease-out) forwards;
}

@keyframes revealSlide {
    to {
        transform: scaleX(0);
    }
}

/* ===========================================
   Attention Seekers
=========================================== */

.shake {
    animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes shake {
    10%, 90% { transform: translateX(-1px); }
    20%, 80% { transform: translateX(2px); }
    30%, 50%, 70% { transform: translateX(-4px); }
    40%, 60% { transform: translateX(4px); }
}

.wobble {
    animation: wobble 1s ease-in-out;
}

@keyframes wobble {
    0% { transform: translateX(0%); }
    15% { transform: translateX(-15px) rotate(-5deg); }
    30% { transform: translateX(10px) rotate(3deg); }
    45% { transform: translateX(-10px) rotate(-3deg); }
    60% { transform: translateX(5px) rotate(2deg); }
    75% { transform: translateX(-5px) rotate(-1deg); }
    100% { transform: translateX(0%); }
}

/* ===========================================
   Loading Dots Animation
=========================================== */

.loading-dots {
    display: inline-flex;
    gap: var(--space-1);
}

.loading-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-primary-blue);
    animation: loadingDots 1.4s ease-in-out infinite both;
}

.loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.loading-dots span:nth-child(2) { animation-delay: -0.16s; }
.loading-dots span:nth-child(3) { animation-delay: 0s; }

@keyframes loadingDots {
    0%, 80%, 100% {
        transform: scale(0);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ===========================================
   Reduced Motion
=========================================== */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .animate-on-scroll {
        opacity: 1;
        transform: none;
    }
}
