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

/* 基本的なフェードインアニメーション */
@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.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* アニメーション前の初期状態 */
.problem-card,
.solution-point,
.service-tabs,
.voice-card-large,
.price-card,
.process-step {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease-out;
}

/* アニメーション後の状態 */
.problem-card.animate-in,
.solution-point.animate-in,
.service-tabs.animate-in,
.voice-card-large.animate-in,
.price-card.animate-in,
.process-step.animate-in {
    opacity: 1;
    transform: translateY(0);
}

/* 個別のアニメーション遅延 */
.problem-card:nth-child(1) { transition-delay: 0.1s; }
.problem-card:nth-child(2) { transition-delay: 0.2s; }
.problem-card:nth-child(3) { transition-delay: 0.3s; }
.problem-card:nth-child(4) { transition-delay: 0.4s; }

.solution-point:nth-child(1) { transition-delay: 0.1s; }
.solution-point:nth-child(2) { transition-delay: 0.2s; }
.solution-point:nth-child(3) { transition-delay: 0.3s; }
.solution-point:nth-child(4) { transition-delay: 0.4s; }

.price-card:nth-child(1) { transition-delay: 0.1s; }
.price-card:nth-child(2) { transition-delay: 0.2s; }
.price-card:nth-child(3) { transition-delay: 0.3s; }

.process-step:nth-child(1) { transition-delay: 0.1s; }
.process-step:nth-child(2) { transition-delay: 0.2s; }
.process-step:nth-child(3) { transition-delay: 0.3s; }
.process-step:nth-child(4) { transition-delay: 0.4s; }

/* ホバーアニメーション */
.problem-card:hover,
.price-card:hover,
.voice-card-large:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.solution-point:hover {
    transform: translateX(5px);
}

/* ボタンのホバーアニメーション */
.header-button:hover,
.hero-primary-button:hover,
.price-button:hover,
.submit-button:hover,
.download-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(37, 99, 235, 0.3);
}

/* クリックアニメーション */
.header-button:active,
.hero-primary-button:active,
.price-button:active,
.submit-button:active,
.download-button:active {
    transform: translateY(0);
}

/* タブボタンのアニメーション */
.tab-button {
    transition: all 0.3s ease;
}

.tab-button.active {
    animation: scaleIn 0.3s ease;
}

/* FAQアニメーション */
.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.faq-item.active .faq-answer {
    transition: max-height 0.5s ease;
}

.faq-icon {
    transition: transform 0.3s ease;
}

.faq-item.active .faq-icon {
    transform: rotate(45deg);
}

/* モバイルメニューアニメーション */
.mobile-menu {
    transition: right 0.3s ease;
}

.mobile-menu-overlay {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-menu-overlay.active {
    opacity: 1;
}

/* スクロールアニメーション用のユーティリティクラス */
.animate-fade-in {
    animation: fadeIn 0.6s ease-out;
}

.animate-fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

.animate-fade-in-left {
    animation: fadeInLeft 0.6s ease-out;
}

.animate-fade-in-right {
    animation: fadeInRight 0.6s ease-out;
}

.animate-scale-in {
    animation: scaleIn 0.6s ease-out;
}

/* 遅延読み込み画像のアニメーション */
.lazy {
    opacity: 0;
    transition: opacity 0.3s;
}

.lazy.loaded {
    opacity: 1;
}

/* ヘッダーのスクロール時アニメーション */
header {
    transition: transform 0.3s ease, background-color 0.3s ease;
}

header.scrolled {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(15px);
}

/* 24時間クロックアニメーション */
.speed-clock {
    animation: fadeIn 0.5s ease-out;
}

.progress-line {
    transition: stroke-dashoffset 0.1s ease;
}

.arrow-tip {
    transition: opacity 0.5s ease, transform 0.1s ease;
}

/* ローディングアニメーション */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.loading {
    animation: spin 1s linear infinite;
}

/* パルスアニメーション */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

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

/* バウンスアニメーション */
@keyframes bounce {
    0%, 20%, 53%, 80%, 100% {
        transform: translateY(0);
    }
    40%, 43% {
        transform: translateY(-10px);
    }
    70% {
        transform: translateY(-5px);
    }
    90% {
        transform: translateY(-2px);
    }
}

.bounce {
    animation: bounce 1s ease infinite;
}

/* レスポンシブ対応：モバイルでアニメーションを軽量化 */
@media (max-width: 768px) {
    .problem-card,
    .solution-point,
    .service-tabs,
    .voice-card-large,
    .price-card,
    .process-step {
        transition-duration: 0.3s;
    }
    
    /* モバイルではホバーアニメーションを無効化 */
    .problem-card:hover,
    .price-card:hover,
    .voice-card-large:hover,
    .solution-point:hover {
        transform: none;
        box-shadow: none;
    }
}

/* アクセシビリティ：motion-reduce設定への対応 */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
