/* ===================================
   アニメーション定義
   =================================== */

/* キーフレーム定義 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    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);
    }
}

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

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes float {
    0% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
    100% {
        transform: translateY(0);
    }
}

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

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

/* ローディングアニメーション */
.loading {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 3px solid var(--color-secondary);
    border-top: 3px solid var(--color-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* フェードイン効果 */
.fade-in {
    opacity: 0;
    animation: fadeIn 0.8s ease-out forwards;
}

.fade-in-up {
    opacity: 0;
    animation: fadeInUp 0.8s ease-out forwards;
}

.fade-in-left {
    opacity: 0;
    animation: fadeInLeft 0.8s ease-out forwards;
}

.fade-in-right {
    opacity: 0;
    animation: fadeInRight 0.8s ease-out forwards;
}

.scale-in {
    opacity: 0;
    animation: scaleIn 0.8s ease-out forwards;
}

/* アニメーション遅延クラス */
.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;
}

/* スクロールトリガーアニメーション */
.scroll-fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.scroll-fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* パララックス効果 */
.parallax {
    position: relative;
    overflow: hidden;
}

.parallax::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background-image: url('../images/hero/pattern.svg');
    background-size: 100px 100px;
    opacity: 0.05;
    transform: translate3d(0, 0, 0);
    will-change: transform;
}

/* ホバーアニメーション */
.hover-lift {
    transition: transform 0.3s ease-out, box-shadow 0.3s ease-out;
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

.hover-scale {
    transition: transform 0.3s ease-out;
}

.hover-scale:hover {
    transform: scale(1.05);
}

/* ボタンアニメーション */
.button-hover {
    position: relative;
    overflow: hidden;
    transition: color 0.3s ease-out;
}

.button-hover::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.5s ease-out, height 0.5s ease-out;
}

.button-hover:hover::before {
    width: 300px;
    height: 300px;
}

/* 波紋エフェクト */
.ripple {
    position: relative;
    overflow: hidden;
}

.ripple-effect {
    position: absolute;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.6);
    transform: scale(0);
    animation: ripple-animation 0.6s ease-out;
}

@keyframes ripple-animation {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* テキストアニメーション */
.text-reveal {
    position: relative;
    overflow: hidden;
}

.text-reveal::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent 0%, var(--color-primary) 50%, transparent 100%);
    animation: text-reveal-animation 2s ease-out forwards;
}

@keyframes text-reveal-animation {
    to {
        left: 100%;
    }
}

/* グラデーションアニメーション */
.gradient-animate {
    background: linear-gradient(270deg, #007AFF, #34C759, #FF3B30, #FF9500);
    background-size: 800% 800%;
    animation: gradient-animation 15s ease infinite;
}

@keyframes gradient-animation {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* パルスアニメーション（CTAボタン用） */
.pulse-animation {
    animation: pulse 2s ease-in-out infinite;
}

/* フローティングアニメーション */
.float-animation {
    animation: float 3s ease-in-out infinite;
}

/* スケルトンローディング */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
}

/* トランジション設定 */
.smooth-transition {
    transition: all 0.3s ease-out;
}

/* アクセシビリティ：動きを減らす */
@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;
    }
    
    .parallax::before {
        display: none;
    }
}