/* 掲示板全体のスレッドコンテナのスタイル */
/* 最大幅を800pxに制限し、中央に配置 */
.simple-forum-thread {
    max-width: 800px;
    margin: 0 auto;
}

/* 個別の投稿のスタイル */
/* シンプルな四角デザイン */
.simple-forum-post {
    background: #ffffff;
    border: none;
    border-radius: 0;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: none;
    position: relative;
}

.simple-forum-post:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    transform: translateY(-1px);
}

/* 投稿ヘッダー（投稿者名と日時）のスタイル */
/* モダンなヘッダーデザイン */
.post-header {
    margin-bottom: 0.3em;
    padding-bottom: 3px;
    font-size: 12px;
    color: #666;
}

.post-header strong {
    font-size: 16px;
    color: #333;
    font-weight: 600;
}

.post-date {
    font-size: 12px;
    color: #555;
}

/* 投稿画像のスタイル */
.post-image {
    margin-top: 12px;
}

.post-image img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* 投稿番号のスタイル */
/* 薄い色で控えめに表示、左に余白 */
.post-count {
    color: #666;
    font-size: 0.9em;
    margin-left: 5px;
}

/* 投稿本文のスタイル */
/* 読みやすいフォントと余白 */
.post-content {
    margin-bottom: 16px;
    line-height: 1.6;
    color: #555;
    font-size: 15px;

}

/* 投稿アクション（いいねボタンなど）のスタイル */
/* モダンなボタンレイアウト */
.post-actions {
    display: flex;
    gap: 4px;
    justify-content: flex-end;
    align-items: center;
}

/* いいねボタンのスタイル */
/* 明るいグレー系のデザイン */
.like-button {
    background: #f5f5f5;
    color: #333;
    border: 1px solid #cc4a1a;
    padding: 6px 12px;
    cursor: pointer;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 500;
    text-decoration: none;
    display: inline-block;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* いいねボタンのホバー時のスタイル */
/* グレー系のホバー効果 */
.like-button:hover {
    background: #f5f5f5;
    border-color: #cc4a1a;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

/* いいね済みボタンのスタイル */
/* オレンジ系の無効状態 */
.like-button.liked {
    background: #ffe5d9;
    color: #cc4a1a;
    border-color: #cc4a1a;
    cursor: not-allowed;
    opacity: 0.8;
    box-shadow: none;
}

.like-button.liked:hover {
    background: #ffe5d9;
    border-color: #cc4a1a;
    box-shadow: none;
}

/* 投稿フォーム全体のスタイル */
/* モダンなフォームデザイン */
.simple-forum-form {
    background: #ffffff;
    border: 1px solid #e1e8ed;
    border-radius: 12px;
    padding: 24px;
    margin-top: 24px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.simple-forum-form h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #333;
    font-size: 18px;
    font-weight: 600;
}

/* フォーム内のラベルのスタイル */
/* ブロック要素で縦並び、下に余白 */
.simple-forum-form label {
    display: block;
    margin-bottom: 5px;
    font-size: 12px; /* ニックネーム、WEB、本文のラベル */
}

/* フォーム内の入力フィールドとテキストエリアのスタイル */
/* 幅を100%にして親要素いっぱいに、下に余白、内側に余白を追加 */
.simple-forum-form input,
.simple-forum-form textarea {
    width: 100%;
    margin-bottom: 10px;
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 3px;
    padding-top: 5px !important; /* テーマのCSSを上書き */
}

/* ファイル入力フィールドのフォントサイズ */
.simple-forum-form input[type="file"] {
    font-size: 12px;
}

/* テキストエリアの特別なスタイル */
/* 最小高さを設定し、垂直リサイズを許可 */
.simple-forum-form textarea {
    min-height: 100px;
    resize: vertical;
}

/* 投稿フォームの送信ボタンスタイル */
.simple-forum-form input[type="submit"] {
    background: #007cba;
    color: white;
    border: none;
    padding: 12px 24px;
    cursor: pointer;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.2s ease;
    min-height: 44px; /* モバイルのタッチターゲットサイズ */
}

.simple-forum-form input[type="submit"]:hover {
    background: #005a87;
    transform: translateY(-1px);
}

/* 返信フォームの送信ボタンスタイル */
.simple-forum-reply-form input[type="submit"] {
    background: #28a745;
    color: white;
    border: none;
    padding: 8px 16px;
    cursor: pointer;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    min-height: 36px;
}

.simple-forum-reply-form input[type="submit"]:hover {
    background: #218838;
    transform: translateY(-1px);
}

/* 返信投稿のスタイル */
/* シンプルな四角デザイン */
.simple-forum-reply {
    margin-left: 24px;
    padding-left: 16px;
    position: relative;
}

/* 返信ボタンのスタイル */
/* 明るいグレー背景、グレー文字とグリーンボーダー */
.reply-button {
    background: #f5f5f5;
    color: #666;
    border: 1px solid #28a745;
    padding: 6px 12px;
    cursor: pointer;
    margin-left: 10px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    display: inline-block;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.reply-button:hover {
    background: #f5f5f5;
    border-color: #28a745;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

/* 返信フォームのスタイル */
.simple-forum-reply-form {
    border: 1px solid #e1e8ed;
    border-radius: 8px;
    padding: 16px;
    margin: 12px 0;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* 返信フォーム内のファイル入力フィールドのフォントサイズ */
.simple-forum-reply-form input[type="file"] {
    font-size: 12px;
}

.simple-forum-reply-form h4 {
    margin-top: 0;
    margin-bottom: 12px;
    color: #007cba;
    font-size: 14px;
    font-weight: 600;
}

.simple-forum-reply-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    font-size: 12px; /* 返信フォームのニックネーム、WEB、本文のラベル */
}

.simple-forum-reply-form input,
.simple-forum-reply-form textarea {
    width: 100%;
    margin-bottom: 10px;
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 3px;
}

.simple-forum-reply-form textarea {
    height: 80px;
    resize: vertical;
}

/* キャンセルボタンのスタイル */
.cancel-reply {
    background: #6c757d;
    color: white;
    border: none;
    padding: 5px 10px;
    cursor: pointer;
    margin-left: 10px;
}



/* フォーム説明文のスタイル */
.form-description {
    margin: 5px 0 10px 0;
    color: #666;
    font-size: 11px;
    line-height: 1.3;
}

.cancel-reply:hover {
    background: #5a6268;
}

/* ページネーションのスタイル */
/* モバイル対応のシンプルなデザイン */
.simple-forum-pagination {
    background: #ffffff;
    border: 1px solid #e1e8ed;
    border-radius: 8px;
    padding: 16px;
    margin: 20px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.pagination-info {
    text-align: center;
    color: #666;
    font-size: 14px;
    margin-bottom: 12px;
}

.pagination-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.pagination-btn {
    display: inline-block;
    padding: 10px 16px;
    background: #007cba;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    min-height: 44px; /* モバイルのタッチターゲットサイズ */
    min-width: 80px;
    text-align: center;
    line-height: 24px;
}

.pagination-btn:hover:not(.disabled) {
    background: #005a87;
    transform: translateY(-1px);
}

.pagination-btn.disabled {
    background: #e1e8ed;
    color: #999;
    cursor: not-allowed;
    transform: none;
}

.pagination-current {
    font-weight: 600;
    color: #333;
    font-size: 14px;
    min-width: 60px;
    text-align: center;
}

/* モバイル対応 */
@media (max-width: 768px) {
    .simple-forum-pagination {
        padding: 12px;
        margin: 16px 0;
    }

    .pagination-controls {
        gap: 8px;
    }

    .pagination-btn {
        padding: 12px 14px;
        font-size: 13px;
        min-width: 70px;
    }

    .pagination-info {
        font-size: 13px;
        margin-bottom: 10px;
    }
}

@media (max-width: 480px) {
    .pagination-btn {
        padding: 14px 12px;
        min-width: 60px;
        font-size: 12px;
    }

    .pagination-current {
        font-size: 13px;
        min-width: 50px;
    }
}

/* ウィジェットのスタイル */
.simple-forum-widget-threads {
    margin: 0;
    padding: 0;
}

.simple-forum-widget-thread {
    margin-bottom: 4px;
    padding-bottom: 3px;
    border-bottom: 1px solid #eee;
}

.simple-forum-widget-thread:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.simple-forum-widget-thread-title {
    margin: 0 0 4px 0;
    padding: 0;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
}

.simple-forum-widget-thread-title a {
    text-decoration: none;
    color: #007cba;
}

.simple-forum-widget-thread-title a:hover {
    color: #005a87;
    text-decoration: underline;
}

.simple-forum-widget-posts {
    margin: 0;
    padding: 0;
    list-style: none;
}

.simple-forum-widget-post-item {
    margin-bottom: 1px;
    padding-bottom: 1px;
}

.simple-forum-widget-post-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
}

.simple-forum-widget-meta {
    color: #666;
    font-size: 12px;
    line-height: 1.1;
    font-family: 'Zen Kurenaido', cursive;
}

.simple-forum-widget-meta b {
    font-weight: 600;
    color: #333;
}

.simple-forum-widget-excerpt {
    color: #777;
    font-size: 12px;
    line-height: 1.1;
    margin-left: 4px;
}

/* 成功メッセージのスタイル */
.simple-forum-success-message {
    background: #d4edda;
    color: #155724;
    border: 3px solid #28a745;
    border-radius: 12px;
    padding: 20px 24px;
    margin: 20px 0 30px 0;
    font-weight: 600;
    font-size: 18px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
    opacity: 1;
    transition: opacity 0.5s ease-out;
}

.simple-forum-success-message.fade-out {
    opacity: 0;
}

.simple-forum-success-message p {
    margin: 0;
    font-size: 20px;
    line-height: 1.4;
}

/* スレッド背景色のランダム適用用クラス */
.simple-forum-post.bg-blue {
    background: linear-gradient(135deg, #c8e1ff 0%, #e1f0ff 100%);
}

.simple-forum-post.bg-green {
    background: linear-gradient(135deg, #d4edcc 0%, #e8f8e0 100%);
}

.simple-forum-post.bg-yellow {
    background: linear-gradient(135deg, #fff3c4 0%, #fff9e6 100%);
}

.simple-forum-post.bg-pink {
    background: linear-gradient(135deg, #f8c8d4 0%, #fce4ec 100%);
}

.simple-forum-post.bg-purple {
    background: linear-gradient(135deg, #e6ccff 0%, #f2e6ff 100%);
}

/* ===== ダークスキン ===== */
.simple-forum-thread.skin-dark {
    /* background-color: #222; */
    color: #eee;
}

.simple-forum-thread.skin-dark h3 {
    color: #333;
}

.simple-forum-thread.skin-dark .simple-forum-post {
    background: hsl(0, 0%, calc(20% + var(--depth, 0) * 4%)); /* ネストに応じて明るく */
    color: #ddd;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.simple-forum-thread.skin-dark .simple-forum-post:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.simple-forum-thread.skin-dark .post-header {
    color: #bbb;
}

.simple-forum-thread.skin-dark .post-header strong {
    color: #fff;
}

.simple-forum-thread.skin-dark .post-date {
    color: #aaa;
}

.simple-forum-thread.skin-dark .post-content {
    color: #ccc;
}

.simple-forum-thread.skin-dark .like-button {
    background: #444;
    color: #eee;
    border-color: #cc4a1a;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.simple-forum-thread.skin-dark .like-button:hover {
    background: #555;
    border-color: #cc4a1a;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.simple-forum-thread.skin-dark .like-button.liked {
    background: #553a2e;
    color: #cc4a1a;
    border-color: #cc4a1a;
}

.simple-forum-thread.skin-dark .simple-forum-form {
    background: #333;
    border: 1px solid #444;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

.simple-forum-thread.skin-dark .simple-forum-form h3 {
    color: #fff;
}

.simple-forum-thread.skin-dark .simple-forum-form label {
    color: #ddd;
}

.simple-forum-thread.skin-dark .simple-forum-form input,
.simple-forum-thread.skin-dark .simple-forum-form textarea {
    background: #444;
    color: #eee;
    border: 1px solid #555;
}

.simple-forum-thread.skin-dark .simple-forum-form input[type="submit"] {
    background: #007cba;
    color: white;
}

.simple-forum-thread.skin-dark .simple-forum-form input[type="submit"]:hover {
    background: #005a87;
}

.simple-forum-thread.skin-dark .simple-forum-reply {
    border-left: 2px solid #555;
}

.simple-forum-thread.skin-dark .reply-button {
    background: #444;
    color: #eee;
    border-color: #28a745;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.simple-forum-thread.skin-dark .reply-button:hover {
    background: #555;
    border-color: #28a745;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.simple-forum-thread.skin-dark .simple-forum-reply-form {
    background: hsl(0, 0%, calc(25% + var(--depth, 0) * 4%)); /* ネストに応じて明るく */
    border: 1px solid #555;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.simple-forum-thread.skin-dark .simple-forum-reply-form h4 {
    color: #00aaff;
}

.simple-forum-thread.skin-dark .simple-forum-reply-form label {
    color: #ddd;
}

.simple-forum-thread.skin-dark .simple-forum-reply-form input,
.simple-forum-thread.skin-dark .simple-forum-reply-form textarea {
    background: #555;
    color: #eee;
    border: 1px solid #666;
}

.simple-forum-thread.skin-dark .simple-forum-reply-form input[type="submit"] {
    background: #28a745;
    color: white;
}

.simple-forum-thread.skin-dark .simple-forum-reply-form input[type="submit"]:hover {
    background: #218838;
}

.simple-forum-thread.skin-dark .cancel-reply {
    background: #6c757d;
    color: white;
}

.simple-forum-thread.skin-dark .cancel-reply:hover {
    background: #5a6268;
}

/* ダークスキン用のフォーム説明文スタイル */
.simple-forum-thread.skin-dark .form-description {
    color: #aaa;
}

.simple-forum-thread.skin-dark .simple-forum-pagination {
    background: #333;
    border: 1px solid #444;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.simple-forum-thread.skin-dark .pagination-info {
    color: #bbb;
}

.simple-forum-thread.skin-dark .pagination-btn {
    background: #007cba;
    color: white;
}

.simple-forum-thread.skin-dark .pagination-btn:hover:not(.disabled) {
    background: #005a87;
}

.simple-forum-thread.skin-dark .pagination-btn.disabled {
    background: #444;
    color: #777;
}

.simple-forum-thread.skin-dark .pagination-current {
    color: #fff;
}

/* 成功メッセージのスタイル (ダークスキン用) */
.simple-forum-thread.skin-dark .simple-forum-success-message {
    background: #2e4a33;
    color: #a8d8b3;
    border: 3px solid #4CAF50;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

/* ブロック投稿の間隔調整 */
.simple-forum-block-meta {
    margin-bottom: 1em;
}

.simple-forum-block-excerpt {
    margin-top: 1em;
}

.simple-forum-block-post {
    margin-bottom: 0.8em;
}

.simple-forum-block-posts {
    line-height: 1.2em;
}

/* ブロックh3見出しのフォントサイズ調整 */
.simple-forum-block-thread-title {
    font-size: 16px !important;
}

/* ===== 画像拡大モーダル ===== */
/* モーダルオーバーレイ */
.simple-forum-image-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease-out;
}

.simple-forum-image-modal .modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(2px);
}

.simple-forum-image-modal .modal-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    animation: scaleIn 0.2s ease-out;
}

.simple-forum-image-modal .modal-header {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.05);
    border-bottom: 1px solid #eee;
}

.simple-forum-image-modal .modal-close {
    background: none;
    border: none;
    font-size: 24px;
    line-height: 1;
    color: #666;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.simple-forum-image-modal .modal-close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #333;
}

.simple-forum-image-modal .modal-body {
    padding: 16px;
    text-align: center;
    background: #f8f9fa;
}

.simple-forum-image-modal .modal-body img {
    max-width: 100%;
    max-height: calc(90vh - 100px);
    height: auto;
    border-radius: 4px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    cursor: grab;
}

.simple-forum-image-modal .modal-body img:active {
    cursor: grabbing;
}

/* モーダル表示中のボディスタイル */
body.modal-open {
    overflow: hidden;
}

/* フェードインアニメーション */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* スケールインアニメーション */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* モバイル対応 */
@media (max-width: 768px) {
    .simple-forum-image-modal .modal-content {
        max-width: 95vw;
        max-height: 95vh;
    }

    .simple-forum-image-modal .modal-body {
        padding: 12px;
    }

    .simple-forum-image-modal .modal-body img {
        max-height: calc(95vh - 80px);
    }

    .simple-forum-image-modal .modal-close {
        font-size: 20px;
        padding: 6px 10px;
    }
}

@media (max-width: 480px) {
    .simple-forum-image-modal .modal-content {
        max-width: 100vw;
        max-height: 100vh;
        border-radius: 0;
    }

    .simple-forum-image-modal .modal-body {
        padding: 8px;
    }

    .simple-forum-image-modal .modal-body img {
        max-height: calc(100vh - 60px);
    }
}

/* ダークスキン対応 */
.simple-forum-thread.skin-dark .simple-forum-image-modal .modal-content {
    background: #333;
    border: 1px solid #555;
}

.simple-forum-thread.skin-dark .simple-forum-image-modal .modal-header {
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid #555;
}

.simple-forum-thread.skin-dark .simple-forum-image-modal .modal-close {
    color: #ccc;
}

.simple-forum-thread.skin-dark .simple-forum-image-modal .modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.simple-forum-thread.skin-dark .simple-forum-image-modal .modal-body {
    background: #2a2a2a;
}
