/* ==============================================
   FAQ専用プレミアムアニメーション
   Version 1.0.0 - 2026-10-19 - Design System v9.0
   スクロールリビール、ホバーエフェクト、アコーディオンアニメーション
   ============================================== */

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

/* フェードイン + 上にスライド */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 左からスライドイン */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* 右からスライドイン */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* スケールアップ */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* パルス効果（アクティブボタン用） */
@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(255, 215, 0, 0.7);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(255, 215, 0, 0);
    }
}

/* ゴールドシマー効果 */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

/* アコーディオン開閉（高さアニメーション） */
@keyframes expandAccordion {
    from {
        max-height: 0;
        opacity: 0;
    }
    to {
        max-height: 2000px;
        opacity: 1;
    }
}

/* カテゴリーバッジのホバーバウンス */
@keyframes badgeBounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-3px);
    }
}

/* ========================================
   スクロールリビール用クラス
======================================== */

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

.slide-in-left {
    animation: slideInLeft 0.8s ease-out forwards;
}

.slide-in-right {
    animation: slideInRight 0.8s ease-out forwards;
}

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

/* 初期状態（非表示） */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
}

/* 表示されたとき */
.animate-on-scroll.visible {
    animation: fadeInUp 0.8s ease-out forwards;
}

/* 段階的表示（stagger delay） */
.animate-on-scroll:nth-child(1) { animation-delay: 0s; }
.animate-on-scroll:nth-child(2) { animation-delay: 0.1s; }
.animate-on-scroll:nth-child(3) { animation-delay: 0.2s; }
.animate-on-scroll:nth-child(4) { animation-delay: 0.3s; }
.animate-on-scroll:nth-child(5) { animation-delay: 0.4s; }

/* ========================================
   FAQ項目のプレミアムホバーエフェクト
======================================== */

.faq-item {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

/* ホバー時の光沢エフェクト */
.faq-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 215, 0, 0.1),
        transparent
    );
    transition: left 0.6s ease;
    pointer-events: none;
}

.faq-item:hover::before {
    left: 100%;
}

/* ホバー時の浮き上がり効果 */
.faq-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(10, 61, 61, 0.15) !important;
    border-left-color: #C9A961 !important;
}

/* アクティブ時のパルスエフェクト */
.faq-item.active {
    border-left-width: 6px !important;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.03) 0%, rgba(10, 61, 61, 0.02) 100%) !important;
}

/* ========================================
   FAQ質問ボタンのエフェクト
======================================== */

.faq-question {
    transition: all 0.3s ease;
}

.faq-question:hover {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.05) 0%, rgba(10, 61, 61, 0.03) 100%);
}

/* アイコンの回転アニメーション */
.faq-icon {
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* ========================================
   FAQ回答のスムーズ展開
======================================== */

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.3s ease,
                padding 0.3s ease;
    opacity: 0;
}

.faq-item.active .faq-answer {
    max-height: 2000px;
    opacity: 1;
}

/* ========================================
   カテゴリータブのプレミアムエフェクト
======================================== */

.category-tab {
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 下線アニメーション */
.category-tab::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, #FFD700, #C9A961);
    transform: translateX(-50%);
    transition: width 0.3s ease;
}

.category-tab:hover::after,
.category-tab.active::after {
    width: 80%;
}

/* ホバー時の浮き上がり */
.category-tab:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.3);
}

/* アクティブ時のパルスエフェクト */
.category-tab.active {
    animation: pulse 2s infinite;
}

/* カテゴリーバッジのアニメーション */
.category-badge {
    display: inline-block;
    transition: transform 0.3s ease;
}

.faq-question:hover .category-badge {
    animation: badgeBounce 0.6s ease;
}

/* ========================================
   統計ボックス・警告ボックスのアニメーション
======================================== */

.faq-stats,
.medical-disclaimer {
    position: relative;
    overflow: hidden;
}

/* 左ボーダーのグラデーションアニメーション */
.faq-stats::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, #FFD700, #C9A961, #FFD700);
    background-size: 100% 200%;
    animation: shimmer 3s linear infinite;
}

.medical-disclaimer::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 5px;
    height: 100%;
    background: linear-gradient(180deg, #F56565, #C53030, #F56565);
    background-size: 100% 200%;
    animation: shimmer 3s linear infinite;
}

/* ========================================
   クイックアクセスボタンのエフェクト
======================================== */

.quick-access-btn {
    position: relative;
    overflow: hidden;
}

/* ホバー時の光沢スライド */
.quick-access-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    transition: left 0.5s ease;
}

.quick-access-btn:hover::before {
    left: 100%;
}

.quick-access-btn:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 8px 24px rgba(10, 61, 61, 0.4);
}

.quick-access-btn:active {
    transform: translateY(0) scale(0.98);
}

/* ========================================
   スクロールプログレスバー
======================================== */

.scroll-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 4px;
    background: linear-gradient(90deg, #0A3D3D 0%, #FFD700 50%, #4A6B5B 100%);
    z-index: 9999;
    transition: width 0.1s linear;
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.5);
}

/* ========================================
   カテゴリーフィルター数カウンター
======================================== */

.category-count {
    display: inline-block;
    padding: 2px 8px;
    background: rgba(255, 215, 0, 0.2);
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: 700;
    color: #0A3D3D;
    margin-left: 4px;
    transition: all 0.3s ease;
}

.category-tab.active .category-count {
    background: #FFD700;
    color: #0A3D3D;
    transform: scale(1.1);
}

/* ========================================
   レスポンシブ調整
======================================== */

@media (max-width: 768px) {
    .faq-item:hover {
        transform: translateY(-2px);
    }
    
    .category-tab:hover {
        transform: translateY(-1px);
    }
    
    .quick-access-btn:hover {
        transform: translateY(-1px) scale(1.02);
    }
}

@media (max-width: 480px) {
    @keyframes fadeInUp {
        from {
            opacity: 0;
            transform: translateY(20px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
    
    .faq-item:hover {
        transform: translateY(0);
        box-shadow: 0 8px 20px rgba(10, 61, 61, 0.1) !important;
    }
}

/* ========================================
   アクセシビリティ：アニメーション無効化対応
======================================== */

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