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

/* ローディングアニメーション */
@keyframes loading {
    0% {
        transform: translateX(-100%);
    }
    50% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(100%);
    }
}

/* パルスアニメーション */
@keyframes pulse {
    0% {
        opacity: 0.6;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    100% {
        opacity: 0.6;
        transform: scale(1);
    }
}

/* グリッド移動アニメーション */
@keyframes grid-move {
    0% {
        transform: translate(0, 0);
    }
    100% {
        transform: translate(50px, 50px);
    }
}

/* 浮遊アニメーション */
@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

/* フェードインアニメーション */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* スライドインアニメーション */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

/* 回転アニメーション */
@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* グローアニメーション */
@keyframes glow {
    0% {
        box-shadow: 0 0 5px rgba(0, 255, 204, 0.5);
    }
    50% {
        box-shadow: 0 0 20px rgba(0, 255, 204, 0.8), 0 0 30px rgba(0, 255, 204, 0.6);
    }
    100% {
        box-shadow: 0 0 5px rgba(0, 255, 204, 0.5);
    }
}

/* タイピングアニメーション */
@keyframes typing {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

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

/* ========================================
   要素への適用
======================================== */

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

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

/* パララックス効果 */
.parallax {
    transition: transform 0.5s ease-out;
}

/* ホバーエフェクト */
.hover-lift {
    transition: transform 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-5px);
}

/* ネオンテキストエフェクト */
.neon-text {
    text-shadow: 
        0 0 10px rgba(0, 255, 204, 0.8),
        0 0 20px rgba(0, 255, 204, 0.6),
        0 0 30px rgba(0, 255, 204, 0.4),
        0 0 40px rgba(0, 255, 204, 0.2);
}

/* グリッチエフェクト */
@keyframes glitch {
    0%, 100% {
        text-shadow: 
            2px 0 var(--primary-color),
            -2px 0 var(--secondary-color);
    }
    25% {
        text-shadow: 
            -2px 0 var(--primary-color),
            2px 0 var(--secondary-color);
    }
    50% {
        text-shadow: 
            2px 0 var(--secondary-color),
            -2px 0 var(--primary-color);
    }
    75% {
        text-shadow: 
            -2px 0 var(--secondary-color),
            2px 0 var(--primary-color);
    }
}

.glitch {
    position: relative;
    animation: glitch 2s infinite;
}

/* カウントアップアニメーション */
.count-up {
    display: inline-block;
    animation: fadeIn 0.5s ease;
}

/* パーティクルアニメーション */
@keyframes particle-up {
    0% {
        opacity: 0;
        transform: translateY(0) scale(0);
    }
    10% {
        opacity: 1;
        transform: translateY(-10px) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-100px) scale(0.5);
    }
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--primary-color);
    border-radius: 50%;
    animation: particle-up 3s ease-out infinite;
}

/* ウェーブアニメーション */
@keyframes wave {
    0%, 100% {
        transform: translateY(0);
    }
    25% {
        transform: translateY(-10px);
    }
    75% {
        transform: translateY(10px);
    }
}

.wave-animation {
    display: inline-block;
    animation: wave 2s ease-in-out infinite;
}

/* シマーエフェクト */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.shimmer {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.2) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
}

/* ========================================
   インタラクティブアニメーション
======================================== */

/* マウス追従エフェクト */
.mouse-follow {
    transition: transform 0.1s ease-out;
}

/* クリックリップルエフェクト */
@keyframes ripple {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(4);
        opacity: 0;
    }
}

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

/* ========================================
   特殊エフェクト
======================================== */

/* ホログラムエフェクト */
@keyframes hologram {
    0% {
        opacity: 0.8;
        transform: translateZ(0) rotateY(0);
    }
    50% {
        opacity: 1;
        transform: translateZ(10px) rotateY(180deg);
    }
    100% {
        opacity: 0.8;
        transform: translateZ(0) rotateY(360deg);
    }
}

.hologram {
    transform-style: preserve-3d;
    animation: hologram 4s ease-in-out infinite;
}

/* サイバーグリッドアニメーション */
@keyframes cyber-grid {
    0% {
        background-position: 0 0;
    }
    100% {
        background-position: 50px 50px;
    }
}

.cyber-grid {
    background-image: 
        linear-gradient(rgba(0, 255, 204, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 255, 204, 0.1) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: cyber-grid 20s linear infinite;
}

/* レーザービームエフェクト */
@keyframes laser {
    0% {
        transform: translateX(-100%) scaleX(0);
        opacity: 0;
    }
    50% {
        transform: translateX(0) scaleX(1);
        opacity: 1;
    }
    100% {
        transform: translateX(100%) scaleX(0);
        opacity: 0;
    }
}

.laser-beam {
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
    animation: laser 2s ease-in-out infinite;
}

/* データストリームエフェクト */
@keyframes data-stream {
    0% {
        transform: translateY(-100%);
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        transform: translateY(100vh);
        opacity: 0;
    }
}

.data-stream {
    position: fixed;
    width: 2px;
    height: 50px;
    background: linear-gradient(180deg, transparent, var(--primary-color), transparent);
    animation: data-stream 3s linear infinite;
}

/* ========================================
   モバイル最適化
======================================== */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}