/* ==========================================================================
   アニメーション - 動きとトランジション
   ========================================================================== */

/* ============================================
   基本トランジション
   ============================================ */

/* ホバー効果 */
.card-hover {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-hover:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(246, 167, 193, 0.3);
}

/* 保証バッジのホバー効果 */
.guarantee-badge {
    transition: transform 0.3s ease,
                box-shadow 0.3s ease;
}

.guarantee-badge:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(16, 185, 129, 0.2);
}

/* ボタンのホバー効果 */
button,
a[role="button"],
.btn {
    transition: all 0.2s ease;
}

/* ============================================
   キーフレームアニメーション
   ============================================ */


/* パルス効果（注目を集める要素用） */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.9;
    }
}

/* 輝き効果（バッジ用） */
@keyframes shine {
    0% {
        background-position: -100% center;
    }
    100% {
        background-position: 200% center;
    }
}

/* 上からフェードイン */
@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 fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* スライドダウン */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-100%);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 回転 */
@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* バウンス */
@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* ============================================
   アニメーションクラス
   ============================================ */

/* Intersection Observerで使用 */
.animate-in {
    animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* フェードイン効果（main.jsで使用） */
.fade-in {
    animation: fadeIn 0.3s ease-in forwards;
}

/* パルスアニメーション（人気バッジ用） */
.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* 輝きアニメーション（人気バッジ用） */
.popular-badge {
    background: linear-gradient(
        90deg,
        #f59e0b 0%,
        #fbbf24 50%,
        #f59e0b 100%
    );
    background-size: 200% auto;
    animation: shine 3s linear infinite;
}


/* ローディングアニメーション */
.loading {
    animation: rotate 1s linear infinite;
}

/* バウンスアニメーション（スクロール促進用） */
.bounce {
    animation: bounce 2s ease-in-out infinite;
}

/* ============================================
   遅延クラス
   ============================================ */

.delay-100 { animation-delay: 100ms; }
.delay-200 { animation-delay: 200ms; }
.delay-300 { animation-delay: 300ms; }
.delay-400 { animation-delay: 400ms; }
.delay-500 { animation-delay: 500ms; }

/* ============================================
   速度クラス
   ============================================ */

.duration-200 { animation-duration: 200ms; }
.duration-300 { animation-duration: 300ms; }
.duration-500 { animation-duration: 500ms; }
.duration-700 { animation-duration: 700ms; }
.duration-1000 { animation-duration: 1000ms; }

/* ============================================
   スムーススクロール
   ============================================ */

html {
    scroll-behavior: smooth;
}

/* スクロールスナップ（必要に応じて） */
.snap-container {
    scroll-snap-type: y mandatory;
}

.snap-item {
    scroll-snap-align: start;
}

/* ============================================
   パフォーマンス最適化
   ============================================ */

/* will-changeは必要な時だけ適用 */
.will-change-transform {
    will-change: transform;
}

.will-change-opacity {
    will-change: opacity;
}

/* アニメーション開始前に適用、終了後に削除 */
.preparing-animation {
    will-change: transform, opacity;
}

/* ============================================
   アクセシビリティ
   ============================================ */

/* アニメーション無効化（ユーザー設定優先） */
@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;
    }
    
    /* スムーススクロールも無効化 */
    html {
        scroll-behavior: auto;
    }
}

/* ============================================
   レスポンシブ対応
   ============================================ */

/* タッチデバイスでホバー効果を調整 */
@media (hover: none) and (pointer: coarse) {
    .card-hover:hover {
        transform: none;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    }
    
    .guarantee-badge:hover {
        transform: none;
    }
    
    /* タップ時のフィードバック */
    .card-hover:active,
    .guarantee-badge:active {
        transform: scale(0.98);
        transition: transform 0.1s ease;
    }
}

/* モバイルでアニメーションを軽量化 */
@media (max-width: 768px) {
    .animate-in {
        animation-duration: 0.4s;
    }
    
    .card-hover {
        transition-duration: 0.2s;
    }
}

/* ============================================
   ダークモード対応（将来の実装用）
   ============================================ */

@media (prefers-color-scheme: dark) {
    .card-hover:hover {
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    }
    
    .guarantee-badge:hover {
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
    }
}

/* ============================================
   カスタムスクロールバー
   ============================================ */

/* Webkit browsers */
::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 6px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #F6A7C1 0%, #E85C88 100%);
    border-radius: 6px;
    transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #E85C88 0%, #F6A7C1 100%);
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: #F6A7C1 #f1f1f1;
}

/* ============================================
   特殊効果
   ============================================ */

/* グラデーションアニメーション */
.gradient-animation {
    background: linear-gradient(
        -45deg,
        #F6A7C1,
        #E85C88,
        #FFE5EC,
        #FFF6F9
    );
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}

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

/* テキストのグラデーション */
.text-gradient {
    background: linear-gradient(135deg, #F6A7C1 0%, #E85C88 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ぼかし効果のトランジション */
.blur-transition {
    transition: filter 0.3s ease;
}

.blur-transition:hover {
    filter: blur(0);
}