/*
 * bbPress Forum Custom Styles
 * モダンでスタイリッシュなフォーラムデザイン
 */

/* ========================================
   フォーラムリスト全体
   ======================================== */
#bbpress-forums {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

/* ========================================
   トピックの開始者 非表示
   ======================================== */
li.bbp-topic-title > p > span.bbp-topic-started-by {
    display: none;
}
/* ========================================
   トピックの開始日時 フォーラム名 目立つようにする
   文字サイズを大きくする
   ======================================== */
li.bbp-topic-title > p > span.bbp-topic-started-in > a {
    font-weight: 700;
    color: #667eea;
    font-size: 2em;
}

/* ========================================
   検索フォーム
   ======================================== */
/* ========================================
   検索フォーム
   ======================================== */
.bbp-search-form {
    margin-bottom: 2em;
    padding: 2em;
    background-color: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 4px;
    text-align: center;
}

.bbp-search-form #bbp_search {
    width: 100%;
    max-width: 400px;
    padding: 10px 15px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    box-shadow: none;
    transition: border-color 0.3s;
}

.bbp-search-form #bbp_search:focus {
    outline: none;
    border-color: #333;
    box-shadow: none;
}

.bbp-search-form #bbp_search_submit {
    padding: 10px 25px;
    margin-left: 10px;
    background: #333;
    color: #fff;
    border: 1px solid #333;
    border-radius: 4px;
    font-weight: normal;
    cursor: pointer;
    transition: opacity 0.3s;
    box-shadow: none;
}

.bbp-search-form #bbp_search_submit:hover {
    background: #555;
    opacity: 0.9;
}

/* ========================================
   パンくずリスト
   ======================================== */
.bbp-breadcrumb {
    padding: 1em 1.5em;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 1.5em;
    font-size: 14px;
}

.bbp-breadcrumb p {
    margin: 0;
    color: #6c757d;
}

.bbp-breadcrumb a {
    color: #667eea;
    text-decoration: none;
    transition: color 0.3s ease;
}

.bbp-breadcrumb a:hover {
    color: #764ba2;
}

.bbp-breadcrumb-sep {
    margin: 0 8px;
    opacity: 0.5;
}

/* ========================================
   フォーラムヘッダー
   ======================================== */
.bbp-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 0;
    border-radius: 12px 12px 0 0;
}

.bbp-header .forum-titles {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 1.2em 1.5em;
}

.bbp-header .forum-titles li {
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.bbp-forum-info {
    flex: 1;
    min-width: 0;
}

.bbp-forum-topic-count,
.bbp-forum-reply-count,
.bbp-topic-voice-count,
.bbp-topic-reply-count {
    width: 100px;
    text-align: center;
}

.bbp-forum-freshness,
.bbp-topic-freshness {
    width: 200px;
    text-align: right;
}

/* ========================================
   フォーラムアイテム
   ======================================== */
.bbp-body ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.bbp-body > ul {
    border-bottom: 1px solid #e9ecef;
    transition: all 0.3s ease;
}

.bbp-body > ul:hover {
    background: #f8f9fa;
    transform: translateX(5px);
}

.bbp-body > ul:last-child {
    border-bottom: none;
}

.bbp-body li {
    display: flex;
    align-items: center;
    padding: 1.5em;
    border-bottom: none;
}

/* ========================================
   フォーラム情報セクション
   ======================================== */
#bbpress-forums .bbp-forum-info {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.5em;
}

#bbpress-forums .bbp-forum-title {
    font-size: 18px;
    font-weight: 700;
    color: #2d3748;
    text-decoration: none;
    transition: all 0.3s ease;
    display: block;
    width: 100%;
    position: relative;
}

.bbp-forum-title::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    transition: width 0.3s ease;
}

.bbp-forum-title:hover {
    color: #667eea;
}

.bbp-forum-title:hover::after {
    width: 100%;
}

.bbp-forum-content {
    font-size: 14px;
    color: #6c757d;
    line-height: 1.6;
    margin-top: 0.5em;
}

/* ========================================
   トピックタイトル（シングルフォーラム）
   ======================================== */
.bbp-topic-title {
    flex: 1;
    min-width: 0;
}

.bbp-topic-permalink {
    font-size: 16px;
    font-weight: 700;
    color: #2d3748;
    text-decoration: none;
    transition: color 0.3s ease;
}

.bbp-topic-permalink:hover {
    color: #667eea;
}

.bbp-topic-meta {
    display: none;
}

/* ========================================
   カウント表示
   ======================================== */
.bbp-forum-topic-count,
.bbp-forum-reply-count,
.bbp-topic-voice-count,
.bbp-topic-reply-count {
    font-size: 20px;
    font-weight: 700;
    color: #667eea;
    text-align: center;
}

/* ========================================
   最新投稿情報
   ======================================== */
.bbp-forum-freshness,
.bbp-topic-freshness {
    text-align: right;
    font-size: 13px;
}

.bbp-forum-freshness a,
.bbp-topic-freshness a {
    color: #2d3748;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.bbp-forum-freshness a:hover,
.bbp-topic-freshness a:hover {
    color: #667eea;
}

.bbp-author-link {
    color: #667eea;
    text-decoration: none;
    transition: color 0.3s ease;
}

.bbp-author-link:hover {
    color: #764ba2;
}

.bbp-author-avatar {
    display: inline-block;
    vertical-align: middle;
    margin-right: 6px;
    border-radius: 50%;
    overflow: hidden;
}

.bbp-author-avatar img {
    display: block;
    border-radius: 50%;
}

/* ========================================
   フッター
   ======================================== */
.bbp-footer {
    padding: 1em 1.5em;
    background: #f8f9fa;
    border-radius: 0 0 12px 12px;
}

/* ========================================
   ページネーション
   ======================================== */
.bbp-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5em;
    font-size: 14px;
    padding: 0 0.5em;
}

.bbp-pagination-links a,
.bbp-pagination-links span.current {
    display: inline-block;
    padding: 6px 12px;
    margin-left: 5px;
    border-radius: 4px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.bbp-pagination-links a {
    background: #fff;
    color: #667eea;
    border: 1px solid #e9ecef;
}

.bbp-pagination-links a:hover {
    background: #667eea;
    color: #fff;
    border-color: #667eea;
}

.bbp-pagination-links span.current {
    background: #667eea;
    color: #fff;
    font-weight: bold;
    border: 1px solid #667eea;
}

/* ========================================
   通知・アラート
   ======================================== */
.bbp-template-notice {
    padding: 1em 1.5em;
    margin-bottom: 1.5em;
    border-radius: 8px;
    border-left: 4px solid #667eea;
    background-color: #f8f9fa;
    color: #495057;
    font-size: 14px;
}

.bbp-template-notice.info {
    border-color: #17a2b8;
    background-color: #e2f6fc;
    color: #0c5460;
}

.bbp-template-notice ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

/* ========================================
   購読トグル
   ======================================== */
#subscription-toggle {
    float: right;
    margin-bottom: 1em;
}

#subscription-toggle a {
    display: inline-block;
    padding: 6px 15px;
    background: #fff;
    color: #667eea;
    border: 1px solid #667eea;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
}

#subscription-toggle a:hover {
    background: #667eea;
    color: #fff;
}

/* ========================================
   新規トピック作成フォーム
   ======================================== */
#new-topic-0 {
    margin-top: 3em;
    background: #fff;
    padding: 2.5em;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.bbp-topic-form fieldset.bbp-form {
    border: none;
    padding: 0;
    margin: 0;
}

.bbp-topic-form legend {
    font-size: 22px;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 1.5em;
    padding-bottom: 0.8em;
    border-bottom: 2px solid #f1f3f5;
    width: 100%;
    display: block;
}

.bbp-topic-form label {
    display: block;
    margin-bottom: 0.5em;
    font-weight: 600;
    color: #495057;
    font-size: 14px;
}

.bbp-topic-form input[type="text"],
.bbp-topic-form select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ced4da;
    border-radius: 8px;
    margin-bottom: 1.5em;
    font-size: 15px;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.bbp-topic-form input[type="text"]:focus,
.bbp-topic-form select:focus {
    background: #fff;
    border-color: #667eea;
    outline: none;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.bbp-submit-wrapper {
    margin-top: 2em;
    text-align: right;
}

.bbp-submit-wrapper button {
    padding: 12px 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.bbp-submit-wrapper button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

/* TinyMCE Editor adjustments */
.wp-editor-wrap {
    border: 1px solid #ced4da;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 1.5em;
}

/* ========================================
   レスポンシブデザイン
   ======================================== */
@media (max-width: 768px) {
    .bbp-header .forum-titles {
        display: none;
    }
    
    /* 行全体のレイアウト調整 */
    .bbp-body > ul {
        display: flex;
        flex-wrap: wrap;
        padding: 1em;
        gap: 0.5em;
        position: relative;
    }

    /* 各セルのスタイルリセットと調整 */
    .bbp-body li {
        width: auto;
        padding: 0;
        border: none;
        flex-direction: row;
        align-items: center;
        display: flex;
    }
    
    /* タイトル部分は全幅 */
    .bbp-forum-info,
    .bbp-topic-title {
        width: 100%;
        margin-bottom: 0.2em;
    }
    
    /* カウント情報をコンパクトに横並び */
    .bbp-forum-topic-count,
    .bbp-forum-reply-count,
    .bbp-topic-voice-count,
    .bbp-topic-reply-count {
        width: auto;
        font-size: 12px;
        color: #667eea;
        background: #f1f3f5;
        padding: 4px 10px;
        border-radius: 20px;
        margin-right: 0.5em;
        justify-content: center;
    }
    
    /* ラベルの表示 */
    .bbp-forum-topic-count::before {
        content: 'トピック: ';
        font-weight: 400;
        color: #6c757d;
        margin-right: 4px;
        font-size: 11px;
    }
    
    .bbp-forum-reply-count::before,
    .bbp-topic-reply-count::before {
        content: '投稿: ';
        font-weight: 400;
        color: #6c757d;
        margin-right: 4px;
        font-size: 11px;
    }

    .bbp-topic-voice-count::before {
        content: '参加者: ';
        font-weight: 400;
        color: #6c757d;
        margin-right: 4px;
        font-size: 11px;
    }
    
    /* 更新日時をコンパクトに */
    .bbp-forum-freshness,
    .bbp-topic-freshness {
        width: 100%;
        margin-top: 0.5em;
        padding-top: 0.5em;
        border-top: 1px dashed #e9ecef;
        font-size: 11px;
        flex-wrap: wrap;
        gap: 5px;
    }

    .bbp-topic-freshness a {
        display: inline-block;
    }
    
    /* 検索フォームなどの調整 */
    .bbp-search-form #bbp_search {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .bbp-search-form #bbp_search_submit {
        width: 100%;
        margin-left: 0;
    }

    #new-topic-0 {
        padding: 1.5em;
    }
    
    .bbp-pagination {
        flex-direction: column;
        gap: 1em;
        align-items: center;
    }
}

/* ========================================
   アニメーション
   ======================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.bbp-body > ul {
    animation: fadeIn 0.5s ease;
}

/* ========================================
   アクセシビリティ
   ======================================== */
.bbp-forum-title:focus,
.bbp-topic-permalink:focus,
.bbp-search-form #bbp_search:focus,
.bbp-search-form #bbp_search_submit:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* ========================================
   追加のスタイリング
   ======================================== */
.bbp-body > ul:nth-child(odd) {
    background: rgba(102, 126, 234, 0.02);
}

.bbp-body > ul:nth-child(even):hover,
.bbp-body > ul:nth-child(odd):hover {
    background: rgba(102, 126, 234, 0.05);
}
