/* FAQ Styles */

.faq {
    padding: 80px 0;
}

.faq__title {
    text-align: center;
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 60px;
    color: #fff;
}

.faq__container {
    max-width: 1200px;
    margin: 0 auto;
    overflow: hidden;
    transition: min-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 各FAQアイテム */
.faq__item {
    background: #1a1a1a;
    transition: background 0.3s ease;
    border: 1px solid #333;
    margin-top: -1px; /* 上のボーダーと重ねる */
    position: relative;
    z-index: 1;
}

.faq__item:first-child {
    margin-top: 0; /* 最初の要素は重ねない */
}

/* ホバー時とアクティブ時は前面に */
.faq__item:hover {
    z-index: 2;
}

/* アクティブ状態のFAQアイテム */
.faq__item--active {
    background: linear-gradient(90deg, rgba(0, 255, 136, 0.1) 0%, rgba(0, 255, 136, 0.05) 100%);
    z-index: 3;
}

/* 質問部分 */
.faq__question {
    padding: 30px;
    cursor: pointer;
    display: flex;
    align-items: center;
    position: relative;
}

/* 左端のアクセントライン */
.faq__question::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: transparent;
    transition: background 0.3s ease;
}

.faq__item--active .faq__question::before {
    background: #00ff88;
}

/* 質問テキスト */
.faq__question-text {
    font-size: 1.1rem;
    font-weight: 500;
    flex: 1;
    margin-left: 20px;
}

/* 右側の展開アイコン */
.faq__expand-icon {
    width: 30px;
    height: 30px;
    border: 2px solid #666;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.faq__item--active .faq__expand-icon {
    border-color: #00ff88;
    background: #00ff88;
}

/* アイコン内のプラス記号 */
.faq__expand-icon::before,
.faq__expand-icon::after {
    content: '';
    position: absolute;
    background: #666;
    transition: all 0.3s ease;
}

/* 横線（常に表示） */
.faq__expand-icon::before {
    width: 12px;
    height: 2px;
}

/* 縦線（アクティブ時に非表示） */
.faq__expand-icon::after {
    width: 2px;
    height: 12px;
}

.faq__item--active .faq__expand-icon::before,
.faq__item--active .faq__expand-icon::after {
    background: #000;
}

.faq__item--active .faq__expand-icon::after {
    opacity: 0;
    transform: scale(0);
}

/* 回答部分 */
.faq__answer {
    max-height: 0;
    overflow: hidden;
    transition: all 0.4s ease;
}

.faq__item--active .faq__answer {
    max-height: 300px;
}

/* 回答テキスト */
.faq__answer-text {
    padding: 0 30px 30px 54px;
    color: #ccc;
    line-height: 1.7;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .faq {
        padding: 80px 30px;
    }
    
    .faq__title {
        font-size: 2rem;
        margin-bottom: 30px;
    }

    .faq__question-text {
        font-size: 1rem;
    }

    .faq__answer-text {
        padding-left: 30px;
        font-size: 0.9rem;
    }

    .faq__question {
        padding: 25px 20px;
    }

    .faq__question-text {
        margin-left: 15px;
    }
}

@media (max-width: 480px) {
    .faq {
        padding: 0 15px;
    }
    
    .faq__title {
        font-size: 1.8rem;
    }

    .faq__question {
        padding: 20px 15px;
    }

    .faq__answer-text {
        padding: 0 15px 20px 30px;
    }
}

/* FAQページ専用のインラインスタイル */
/* 既存のfaq.cssに追加するスタイル */

.faq__item {
    animation: fadeIn 0.5s ease-out;
    animation-fill-mode: both;
}

/* 各アイテムに順番にアニメーション適用 */
.faq__item:nth-child(1) { animation-delay: 0.05s; }
.faq__item:nth-child(2) { animation-delay: 0.1s; }
.faq__item:nth-child(3) { animation-delay: 0.15s; }
.faq__item:nth-child(4) { animation-delay: 0.2s; }
.faq__item:nth-child(5) { animation-delay: 0.25s; }
.faq__item:nth-child(6) { animation-delay: 0.3s; }
.faq__item:nth-child(7) { animation-delay: 0.35s; }
.faq__item:nth-child(8) { animation-delay: 0.4s; }
.faq__item:nth-child(9) { animation-delay: 0.45s; }
.faq__item:nth-child(10) { animation-delay: 0.5s; }

/* 10個以降は同じ遅延 */
.faq__item:nth-child(n+11) { animation-delay: 0.5s; }

/* 検索・フィルター用の追加スタイル */
.faq-controls {
    max-width: 1200px;
    margin: 0 auto 40px;
    padding: 0 20px;
}

/* 検索ボックス */
.faq-search {
    max-width: 600px;
    margin: 0 auto 30px;
    position: relative;
}

.faq-search__input {
    width: 100%;
    padding: 15px 50px 15px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.faq-search__input:focus {
    outline: none;
    border-color: #00ff88;
    background: rgba(255, 255, 255, 0.08);
}

.faq-search__icon {
    position: absolute;
    right: 25px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    width: 20px;
    height: 20px;
}

/* 虫眼鏡のレンズ部分 */
.faq-search__icon::before {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    border: 3px solid #999;
    border-radius: 50%;
    top: 0;
    left: 0;
}

/* 虫眼鏡の持ち手部分 */
.faq-search__icon::after {
    content: '';
    position: absolute;
    width: 3px;
    height: 8px;
    background: #999;
    transform: rotate(-45deg);
    bottom: 2px;
    right: 4px;
}

/* カテゴリーフィルター */
.faq-categories {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.faq-category {
    padding: 10px 24px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #aaa;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.faq-category:hover {
    border-color: #00ff88;
    color: #00ff88;
}

.faq-category--active {
    background: #00ff88;
    border-color: #00ff88;
    color: #000;
}

/* アクティブ時のホバーは黒文字を維持 */
.faq-category--active:hover {
    color: #000;
    background: #00cc6a;
}

/* 検索結果なし */
.faq-no-results {
    display: none;
    text-align: center;
    padding: 60px 20px;
    max-width: 600px;
    margin: 0 auto;
}

.faq-no-results--show {
    display: block;
}

.faq-no-results__title {
    font-size: 1.5rem;
    margin-bottom: 15px;
}

.faq-no-results__text {
    color: #aaa;
    margin-bottom: 30px;
}

.faq-no-results__button {
    padding: 12px 30px;
    background: rgba(0, 255, 136, 0.1);
    border: 2px solid rgba(0, 255, 136, 0.3);
    color: #00ff88;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.faq-no-results__button:hover {
    background: rgba(0, 255, 136, 0.2);
    border-color: #00ff88;
    transform: translateY(-2px);
}

/* FAQタグ */
.faq__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 0 30px 30px 54px;  /* .faq__answer-textと同じpadding */
}

.faq__tag {
    display: inline-block;
    padding: 8px 16px;
    background: transparent;
    border: 1px solid #00ff88;
    color: #00ff88;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 0;
}

.faq__tag:hover {
    background: #00ff88;
    color: #000;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 255, 136, 0.2);
}

/* 人気の検索キーワード */
.popular-search {
    margin: 30px 0;
    text-align: center;
}

.popular-search__label {
    font-size: 0.9rem;
    color: #aaa;
    margin-bottom: 12px;
}

.popular-search__keywords {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.popular-search__keyword {
    padding: 8px 16px;
    background: transparent;
    border: 1px solid #333;
    color: #888;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 0;
}

.popular-search__keyword:hover {
    background: rgba(0, 255, 136, 0.1);
    border-color: #00ff88;
    color: #00ff88;
}

/* もっと見るボタン */
.faq__load-more {
    text-align: center;
    margin: 40px 0;
}

.faq__load-more-button {
    padding: 15px 40px;
    background: transparent;
    border: 2px solid #00ff88;
    color: #00ff88;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.faq__load-more-button:hover {
    background: rgba(0, 255, 136, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 255, 136, 0.2);
}

/* お問い合わせ誘導セクション */
.faq__contact {
    margin-top: 80px;
    margin-left: auto;
    margin-right: auto;
    max-width: 1200px;
    padding: 50px;
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.05), rgba(0, 204, 112, 0.05));
    border: 2px solid rgba(0, 255, 136, 0.2);
    text-align: center;
}

.faq__contact-title {
    font-size: 1.8rem;
    margin-bottom: 15px;
    color: #00ff88;
}

.faq__contact-text {
    color: #ccc;
    margin-bottom: 30px;
    font-size: 1.1rem;
}

.faq__contact-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.faq__button {
    padding: 15px 35px;
    background: rgba(0, 255, 136, 0.1);
    border: 2px solid rgba(0, 255, 136, 0.3);
    color: #00ff88;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 1px;
    min-width: 200px;
    text-align: center;
}

.faq__button:hover {
    background: rgba(0, 255, 136, 0.2);
    border-color: #00ff88;
    color: #00ff88;
}

/* モバイル用タブナビゲーション */
.mobile-tab-nav {
    display: none; /* デフォルトでは非表示 */
}

.mobile-tab {
    flex: 1;
    padding: 12px;
    background: transparent;
    border: 2px solid #333;
    color: #999;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mobile-tab:first-child {
    border-right: none;
}

.mobile-tab:last-child {
    /* 角丸なし */
}

.mobile-tab--active {
    background: rgba(0, 255, 136, 0.1);
    border-color: #00ff88;
    color: #00ff88;
}

/* タブコンテンツのラッパー */
.tab-content-wrapper {
    position: relative;
}

/* デフォルト（481px以上）では両方表示 - 元のスタイルを維持 */
.tab-pane {
    transition: opacity 0.3s ease;
}

/* 各要素の元のdisplayを保持 */
.popular-search.tab-pane {
    display: block;
}

.faq-categories.tab-pane {
    display: flex;
}

/* レスポンシブ */
@media (max-width: 768px) {
    .faq-search {
        margin-bottom: 20px;
    }

    .faq-categories {
        gap: 10px;
    }

    .faq-category {
        padding: 8px 16px;
        font-size: 0.9rem;
    }

    .faq__tags {
        padding: 0 20px 25px 30px;  /* .faq__answer-textと同じ左padding */
        margin-top: -5px;
        gap: 8px;
    }

    .faq__tag {
        padding: 6px 12px;
        font-size: 0.8rem;
    }

    .faq__contact {
        padding: 30px 20px;
    }
}

@media (max-width: 480px) {
    .faq__tags {
        padding: 0 15px 20px 30px;  /* .faq__answer-textと同じ左padding */
        margin-top: -5px;
        gap: 6px;
    }

    .faq__tag {
        padding: 5px 10px;
        font-size: 0.75rem;
    }

    /* モバイルでタブナビゲーションを表示 */
    .mobile-tab-nav {
        display: flex;
        gap: 0;
        margin: 20px 0;
    }

    /* タブコンテンツのアニメーション */
    .tab-content-wrapper {
        min-height: 150px; /* 切り替え時のジャンプを防ぐ */
    }

    /* 480px以下でのみタブ機能を有効化 */
    .tab-pane:not(.tab-pane--active) {
        display: none;
    }

    /* 人気キーワードのスタイル調整 */
    .popular-search {
        margin: 0;
    }

    .popular-search__label {
        font-size: 0.9rem;
        margin-bottom: 10px;
    }

    .popular-search__keywords {
        gap: 8px;
    }

    .popular-search__keyword {
        padding: 6px 12px;
        font-size: 0.85rem;
    }

    /* カテゴリーのスタイル調整 */
    .faq-categories {
        margin: 0;
        gap: 8px;
    }

    .faq-category {
        padding: 10px 15px;
        font-size: 0.9rem;
        flex: 1 1 calc(50% - 4px);
    }

    .faq__contact-buttons {
        flex-direction: column;
    }

    .faq__button {
        width: 100%;
    }
}