/**
 * FAQ表示用スタイル
 *
 * @package Greenheart_Send_Texts
 */

/* FAQコンテナ */
.faq-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

/* カテゴリタブ */
.faq-category-tabs {
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 8px;
}

.faq-category-tab {
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
    background: #fff;
    color: #333;
    border: 2px solid #ddd;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.faq-category-tab:hover {
    background: #f0f0f0;
    transform: translateY(-2px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.faq-category-tab.active {
    background: #0073aa;
    color: #fff;
    border-color: #0073aa;
}

.faq-category-tab .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.faq-category-count {
    font-size: 12px;
    opacity: 0.8;
}

/* カテゴリバッジ */
.faq-categories {
    padding: 0 20px;
    padding-top: 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.faq-category-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border-radius: 15px;
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    text-decoration: none;
}

.faq-category-badge .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
}

/* 検索ボックス */
.faq-search-box {
    margin-bottom: 30px;
    padding: 20px;
    background: #f5f5f5;
    border-radius: 8px;
    display: flex;
    gap: 10px;
    align-items: center;
}

.faq-search-input {
    flex: 1;
    padding: 12px 16px;
    font-size: 16px;
    border: 2px solid #ddd;
    border-radius: 4px;
    transition: border-color 0.3s ease;
}

.faq-search-input:focus {
    outline: none;
    border-color: #0073aa;
}

.faq-search-button {
    padding: 12px 24px;
    font-size: 16px;
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.faq-search-button:hover {
    background: #005a87;
}

.faq-search-button:active {
    transform: translateY(1px);
}

/* FAQリスト */
.faq-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* FAQアイテム */
.faq-item {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

.faq-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* FAQ質問部分 */
.faq-question {
    padding: 20px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
    transition: background-color 0.3s ease;
    user-select: none;
}

.faq-question:hover {
    background: #f9f9f9;
}

.faq-question h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
    flex: 1;
    padding-right: 20px;
}

.faq-toggle {
    font-size: 24px;
    font-weight: bold;
    color: #0073aa;
    min-width: 30px;
    text-align: center;
    transition: transform 0.3s ease;
}

/* アクティブ状態 */
.faq-item.active .faq-question {
    background: #f0f0f0;
}

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

/* FAQ回答部分 */
.faq-answer {
    padding: 0 20px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.faq-item.active .faq-answer {
    padding: 20px;
    max-height: 1000px;
}

.faq-answer p:first-child {
    margin-top: 0;
}

.faq-answer p:last-child {
    margin-bottom: 0;
}

.faq-answer ul,
.faq-answer ol {
    margin: 10px 0;
    padding-left: 25px;
}

.faq-answer li {
    margin: 5px 0;
}

/* 検索結果なし */
.faq-no-results {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-size: 16px;
}

/* ローディング表示 */
.faq-loading {
    text-align: center;
    padding: 20px;
    color: #666;
}

.faq-loading::after {
    content: "...";
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% {
        content: ".";
    }
    40% {
        content: "..";
    }
    60%, 100% {
        content: "...";
    }
}

/* サイドバーウィジェット */
.faq-category-widget {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.faq-category-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    background: #fff;
    border: 2px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
}

.faq-category-item:hover {
    background: #f9f9f9;
    border-color: #0073aa;
    transform: translateX(4px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.faq-category-item.active {
    background: #0073aa;
    color: #fff;
    border-color: #0073aa;
}

.faq-category-item.faq-category-all {
    background: #f5f5f5;
    border-color: #aaa;
}

.faq-category-item.faq-category-all:hover {
    background: #e0e0e0;
    border-color: #888;
}

.faq-category-item.faq-category-all.active {
    background: #555;
    color: #fff;
    border-color: #555;
}

.faq-category-item .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.faq-category-item.active .dashicons {
    color: #fff;
}

.faq-category-name {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
}

.faq-category-count {
    font-size: 12px;
    opacity: 0.8;
    font-weight: normal;
}

/* ウィジェットタイトル */
.widget_greenheart_faq_category_widget .widget-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #0073aa;
}

/* ページネーション非表示クラス */
.faq-pagination-hidden {
    display: none !important;
}

/* ページネーション */
.faq-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 30px;
    padding: 20px;
    flex-wrap: wrap;
}

.faq-page-btn,
.faq-page-number {
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
    background: #fff;
    color: #333;
    border: 2px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
    min-width: 40px;
    text-align: center;
}

.faq-page-btn:hover:not(:disabled),
.faq-page-number:hover:not(.active) {
    background: #f0f0f0;
    border-color: #0073aa;
    transform: translateY(-2px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.faq-page-number.active {
    background: #0073aa;
    color: #fff;
    border-color: #0073aa;
    font-weight: 600;
}

.faq-page-btn:disabled {
    background: #f5f5f5;
    color: #999;
    border-color: #e0e0e0;
    cursor: not-allowed;
    opacity: 0.6;
}

.faq-page-ellipsis {
    padding: 10px 8px;
    color: #999;
    font-size: 14px;
    font-weight: 500;
    user-select: none;
}

.faq-page-prev,
.faq-page-next {
    font-weight: 600;
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
    .faq-container {
        padding: 15px;
    }

    .faq-category-tabs {
        padding: 10px;
        gap: 8px;
    }

    .faq-category-tab {
        padding: 8px 14px;
        font-size: 13px;
    }

    .faq-category-tab .dashicons {
        font-size: 14px;
        width: 14px;
        height: 14px;
    }

    .faq-categories {
        padding: 0 15px;
        padding-top: 12px;
    }

    .faq-category-badge {
        padding: 5px 10px;
        font-size: 12px;
    }

    .faq-search-box {
        flex-direction: column;
        padding: 15px;
    }

    .faq-search-input,
    .faq-search-button {
        width: 100%;
    }

    .faq-question h3 {
        font-size: 16px;
    }

    .faq-question {
        padding: 15px;
    }

    .faq-answer {
        padding: 0 15px;
    }

    .faq-item.active .faq-answer {
        padding: 15px;
    }

    .faq-pagination {
        gap: 6px;
        padding: 15px;
    }

    .faq-page-btn,
    .faq-page-number {
        padding: 8px 12px;
        font-size: 13px;
        min-width: 36px;
    }
}

@media (max-width: 480px) {
    .faq-category-tab {
        padding: 6px 12px;
        font-size: 12px;
    }

    .faq-category-count {
        display: none;
    }

    .faq-category-badge {
        padding: 4px 8px;
        font-size: 11px;
    }

    .faq-question h3 {
        font-size: 14px;
    }

    .faq-toggle {
        font-size: 20px;
    }

    .faq-pagination {
        gap: 4px;
        padding: 10px;
    }

    .faq-page-btn,
    .faq-page-number {
        padding: 6px 10px;
        font-size: 12px;
        min-width: 32px;
    }

    .faq-page-ellipsis {
        padding: 6px 4px;
        font-size: 12px;
    }
}

/* カテゴリアーカイブページ用スタイル */
.faq-category-archive-wrapper {
    padding: 20px 0;
}

.faq-category-archive-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* パンくずリスト */
.faq-breadcrumb {
    margin-bottom: 30px;
}

.faq-breadcrumb ul {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 8px;
}

.faq-breadcrumb li {
    display: flex;
    align-items: center;
    font-size: 14px;
}

.faq-breadcrumb li::after {
    content: "›";
    margin-left: 8px;
    color: #999;
}

.faq-breadcrumb li:last-child::after {
    content: "";
}

.faq-breadcrumb a {
    color: #0073aa;
    text-decoration: none;
    transition: color 0.2s;
}

.faq-breadcrumb a:hover {
    color: #005a87;
    text-decoration: underline;
}

.faq-breadcrumb-category .faq-category-badge {
    font-size: 12px;
    padding: 4px 10px;
}

/* カテゴリヘッダー */
.faq-category-header {
    margin-bottom: 40px;
    text-align: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, #f5f5f5 0%, #e9e9e9 100%);
    border-radius: 12px;
}

.faq-category-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin: 0 0 15px 0;
    font-size: 32px;
    font-weight: 700;
    color: #333;
}

.faq-category-badge-large {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    color: #fff;
}

.faq-category-badge-large .dashicons {
    font-size: 32px;
    width: 32px;
    height: 32px;
}

.faq-category-description {
    font-size: 16px;
    color: #666;
    line-height: 1.6;
}

/* 親カテゴリへ戻るリンク */
.faq-parent-category-link {
    margin-bottom: 30px;
}

.faq-back-to-parent {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 8px;
    color: #333;
    text-decoration: none;
    transition: all 0.3s ease;
}

.faq-back-to-parent:hover {
    background: #fff;
    border-color: #0073aa;
    transform: translateX(-4px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.faq-back-to-parent .faq-category-badge {
    font-size: 13px;
    padding: 4px 10px;
}

/* サブカテゴリセクション */
.faq-child-categories {
    margin-bottom: 50px;
}

.faq-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 20px 0;
    padding-bottom: 12px;
    border-bottom: 3px solid #0073aa;
    font-size: 24px;
    font-weight: 600;
    color: #333;
}

.faq-section-title .dashicons {
    font-size: 28px;
    width: 28px;
    height: 28px;
    color: #0073aa;
}

.faq-child-category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.faq-child-category-card {
    position: relative;
    display: block;
    padding: 20px;
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.3s ease;
    overflow: hidden;
}

.faq-child-category-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, transparent 0%, #0073aa 50%, transparent 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.faq-child-category-card:hover {
    border-color: #0073aa;
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.faq-child-category-card:hover::before {
    opacity: 1;
}

.faq-child-category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.faq-child-category-header .faq-category-badge {
    font-size: 14px;
    padding: 6px 12px;
}

.faq-child-category-header .faq-category-count {
    font-size: 13px;
    color: #666;
    font-weight: 600;
}

.faq-child-category-desc {
    font-size: 14px;
    color: #666;
    line-height: 1.5;
    margin-bottom: 10px;
}

.faq-child-category-arrow {
    display: flex;
    justify-content: flex-end;
    color: #0073aa;
    transition: transform 0.3s ease;
}

.faq-child-category-card:hover .faq-child-category-arrow {
    transform: translateX(4px);
}

.faq-child-category-arrow .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

/* FAQリストセクション */
.faq-list-section {
    margin-bottom: 50px;
}

/* カテゴリページ内検索ボックス */
.faq-category-search-box {
    position: relative;
    margin-bottom: 25px;
    max-width: 600px;
}

.faq-category-search-input {
    width: 100%;
    padding: 14px 50px 14px 20px;
    font-size: 16px;
    border: 2px solid #ddd;
    border-radius: 8px;
    transition: all 0.3s ease;
    background: #fff;
}

.faq-category-search-input:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

.faq-category-search-input::placeholder {
    color: #999;
}

.faq-search-icon {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    font-size: 20px;
    width: 20px;
    height: 20px;
    pointer-events: none;
}

/* 検索ハイライト */
.faq-search-highlight {
    background-color: #fff176;
    color: #000;
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: 600;
}

/* 検索結果なしメッセージ */
.faq-no-search-results {
    text-align: center;
    padding: 60px 20px;
    background: #f9f9f9;
    border-radius: 8px;
    margin-top: 20px;
}

.faq-no-search-results p {
    font-size: 16px;
    color: #666;
    margin: 10px 0;
}

.faq-search-hint {
    font-size: 14px;
    color: #999;
}

.faq-count-badge {
    display: inline-block;
    margin-left: 10px;
    padding: 4px 12px;
    background: #0073aa;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    border-radius: 12px;
}

.faq-items-wrapper {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* カテゴリアーカイブページのFAQ質問アイコン */
.faq-category-archive-wrapper .faq-question {
    position: relative;
    padding-left: 60px;
}

.faq-question-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: #0073aa;
    color: #fff;
    font-weight: 700;
    font-size: 18px;
    border-radius: 50%;
}

.faq-question-text {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
    flex: 1;
    padding-right: 20px;
}

/* FAQアーカイブページの回答アイコン */
.faq-category-archive-wrapper .faq-answer {
    position: relative;
    padding-left: 60px;
}

.faq-answer-icon {
    position: absolute;
    left: 20px;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: #28a745;
    color: #fff;
    font-weight: 700;
    font-size: 18px;
    border-radius: 50%;
}

.faq-answer-content {
    line-height: 1.7;
    color: #555;
}

/* カテゴリバッジフッター */
.faq-categories-footer {
    margin-top: 15px;
    padding: 15px 20px 15px 60px;
    border-top: 1px solid #e0e0e0;
    background: #fafafa;
}

.faq-category-badge-link {
    transition: all 0.2s ease;
}

.faq-category-badge-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    opacity: 0.9;
}

/* すべてのFAQへ戻るボタン */
.faq-back-to-all {
    text-align: center;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid #e0e0e0;
}

.faq-back-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: #0073aa;
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.faq-back-button:hover {
    background: #005a87;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.faq-back-button .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

/* カテゴリタブのリンクスタイル */
.faq-category-tab-link {
    text-decoration: none;
}

.faq-category-tab-link:hover {
    text-decoration: none;
}

/* ウィジェットのリンクスタイル */
.faq-category-widget a.faq-category-item {
    text-decoration: none;
    color: inherit;
}

.faq-category-widget a.faq-category-item:hover {
    text-decoration: none;
}

/* レスポンシブ - カテゴリアーカイブページ */
@media (max-width: 768px) {
    .faq-category-archive-container {
        padding: 0 15px;
    }

    .faq-category-header {
        padding: 30px 15px;
    }

    .faq-category-title {
        font-size: 24px;
        flex-direction: column;
        gap: 10px;
    }

    .faq-category-badge-large {
        width: 50px;
        height: 50px;
    }

    .faq-category-badge-large .dashicons {
        font-size: 26px;
        width: 26px;
        height: 26px;
    }

    .faq-child-category-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .faq-section-title {
        font-size: 20px;
    }

    .faq-category-archive-wrapper .faq-question {
        padding-left: 50px;
    }

    .faq-category-archive-wrapper .faq-answer {
        padding-left: 50px;
    }

    .faq-question-icon,
    .faq-answer-icon {
        left: 15px;
        width: 28px;
        height: 28px;
        font-size: 16px;
    }

    .faq-categories-footer {
        padding-left: 50px;
    }

    .faq-category-search-box {
        max-width: 100%;
    }

    .faq-category-search-input {
        font-size: 14px;
        padding: 12px 45px 12px 16px;
    }
}

@media (max-width: 480px) {
    .faq-breadcrumb ul {
        font-size: 12px;
    }

    .faq-category-title {
        font-size: 20px;
    }

    .faq-section-title {
        font-size: 18px;
    }

    .faq-child-category-card {
        padding: 15px;
    }
}
