/* board-modern.css */
:root {
    --theme-blue: #1d9bf0;
    --theme-black: #000000;
    --theme-dark-gray: #0f1419;
    --theme-medium-gray: #536471;
    --theme-light-gray: #eff3f4;
    --theme-extra-light-gray: #f7f9f9;
    --theme-border: #cfd9de;
    --theme-hover: rgba(15, 20, 25, 0.1);
    --theme-white: #ffffff;

    /* アクションカラー */
    --vote-agree: #f91880;
    --vote-neutral: #00ba7c;
    --vote-disagree: #1d9bf0;
}

body {
    /* background-color: var(--theme-white) !important; */
    color: var(--theme-dark-gray);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 0;
}

/* レイアウト構造 - 中央寄せ */
.board-layout {
    display: flex;
    justify-content: center;
    min-height: 100vh;
    max-width: 100%;
    margin: 0 auto;
    padding-top: 0;
}

/* メインフィード */
.main-feed {
    flex: 1;
    max-width: 600px;
    border-right: 1px solid var(--theme-border);
    border-left: 1px solid var(--theme-border);
    min-height: 100vh;
    position: relative;
    padding-bottom: 80px;
    margin-top: 0;
    background-color: var(--theme-white);
}

/* フィードヘッダー (サブヘッダー) */
.feed-header {
    position: sticky;
    top: 70px;
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    z-index: 90;
    border-bottom: 1px solid var(--theme-border);
    padding: 0 16px;
    height: 53px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

@media (max-width: 768px) {
    .feed-header {
        top: 60px;
    }

    /* モバイル向けの調整 */
    .main-feed {
        max-width: 100%;
        border-left: none;
        border-right: none;
        width: 100%;
    }

    .board-layout {
        display: block;
    }
}

.feed-title {
    font-size: 20px;
    font-weight: 700;
    margin: 0;
}

.feed-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 情報メニューボタン & ソートボタン */
.info-menu-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--theme-dark-gray);
}

.info-menu-btn:hover {
    background-color: var(--theme-hover);
}

/* 投稿カード */
.post-card {
    padding: 12px 16px;
    display: flex;
    gap: 12px;
    cursor: pointer;
}

.post-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--theme-light-gray);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: var(--theme-medium-gray);
}

.post-body {
    flex: 1;
    min-width: 0;
}

.post-header {
    display: flex;
    align-items: baseline;
    gap: 4px;
    margin-bottom: 2px;
    font-size: 15px;
}

.post-author-name {
    font-weight: 700;
    word-wrap: break-word;
    white-space: pre-wrap;
}

.post-title {
    font-size: 18px;
    font-weight: 700;
    margin-top: 4px;
    margin-bottom: 8px;
    line-height: 1.4;
    word-wrap: break-word;
    white-space: pre-wrap;
}

.post-content {
    font-size: 15px;
    line-height: 1.6;
    word-wrap: break-word;
    white-space: pre-wrap;
    color: var(--theme-dark-gray);
}

.post-meta {
    color: var(--theme-medium-gray);
    white-space: nowrap;
}


/* アクションバー (投票ボタン) */
.post-actions {
    display: flex;
    justify-content: space-between;
    max-width: 425px;
    margin-top: 12px;
}

.action-item {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--theme-medium-gray);
    font-size: 13px;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    /* パディングは内部のSVGで調整 */
    transition: color 0.2s;
    position: relative;
    /* クリック判定用 */
    z-index: 1;
}

/* クリック領域を広げるための擬似要素 */
.action-item::after {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
}

.action-item svg {
    width: 20px;
    height: 20px;
    fill: none;
    /* デフォルトは塗りつぶしなし */
    stroke: currentColor;
    /* ストローク色を使用 */
    padding: 8px;
    border-radius: 50%;
    transition: background-color 0.2s, stroke 0.2s;
    box-sizing: content-box;
}

/* 賛成 (Agree) - ピンク/ハート系 */
.action-item.agree:hover {
    color: var(--vote-agree);
}

.action-item.agree:hover svg {
    background-color: rgba(249, 24, 128, 0.1);
    stroke: var(--vote-agree);
}

.action-item.agree.active {
    color: var(--vote-agree);
}

.action-item.agree.active svg {
    stroke: var(--vote-agree);
    /* 塗りつぶさず、色を変える */
    stroke-width: 3px;
    /* 太くして強調 */
    fill: none;
}

/* 中立 (Neutral) - 緑/リツイート系 */
.action-item.neutral:hover {
    color: var(--vote-neutral);
}

.action-item.neutral:hover svg {
    background-color: rgba(0, 186, 124, 0.1);
    stroke: var(--vote-neutral);
}

.action-item.neutral.active {
    color: var(--vote-neutral);
}

.action-item.neutral.active svg {
    stroke: var(--vote-neutral);
    stroke-width: 3px;
    fill: none;
}

.action-item.neutral.active svg circle {
    stroke: var(--vote-neutral);
    fill: none;
}

/* 反対 (Disagree) - 青/リプライ系 */
.action-item.disagree:hover {
    color: var(--vote-disagree);
}

.action-item.disagree:hover svg {
    background-color: rgba(29, 155, 240, 0.1);
    stroke: var(--vote-disagree);
}

.action-item.disagree.active {
    color: var(--vote-disagree);
}

.action-item.disagree.active svg {
    stroke: var(--vote-disagree);
    stroke-width: 3px;
    fill: none;
}

/* フローティング投稿ボタン (FAB) */
.fab-post {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background-color: var(--theme-blue);
    color: white;
    border: none;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2000;
    transition: transform 0.2s, background-color 0.2s, opacity 0.2s, visibility 0.2s;
}

/* メニュー展開時は非表示 */
body.menu-open .fab-post {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: scale(0.8);
}

.fab-post:hover {
    background-color: #1a8cd8;
    transform: scale(1.05);
}

.fab-post svg {
    width: 24px;
    height: 24px;
    fill: white;
}

/* モーダル共通 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    z-index: 3000;
    display: none;
    align-items: center;
    justify-content: center;
}

.modal-overlay.open {
    display: flex;
}

.modal-content {
    background-color: white;
    width: 100%;
    max-width: 700px;
    border-radius: 16px;
    padding: 16px;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

@media (max-width: 600px) {
    .modal-content {
        width: 95%;
        height: auto;
        max-height: 95vh;
        border-radius: 16px;
        padding: 16px;
    }

    .post-form-textarea {
        min-height: 50vh;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

/* バツボタンのみの場合は右寄せ */
.modal-header.only-close-btn {
    justify-content: flex-end;
}

.modal-close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    margin-left: auto;
}

.modal-close-btn:hover {
    background-color: var(--theme-hover);
}

/* 投稿フォーム */
.post-form-textarea {
    width: 100%;
    border: none;
    resize: none;
    font-size: 18px;
    font-family: inherit;
    outline: none;
    min-height: 400px;
    padding: 8px 0;
}

.post-form-actions {
    display: flex;
    justify-content: flex-end;
    padding-top: 12px;
    border-top: 1px solid var(--theme-border);
}

.btn-tweet {
    background-color: var(--theme-blue);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 9999px;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-tweet:hover {
    background-color: #1a8cd8;
}

/* 独自確認ダイアログ */
.confirm-dialog-content {
    max-width: 320px;
    padding: 32px;
    text-align: center;
    border-radius: 16px;
}

.confirm-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--theme-dark-gray);
}

.confirm-message {
    font-size: 15px;
    color: var(--theme-medium-gray);
    margin-bottom: 24px;
}

.confirm-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn-confirm-primary {
    background-color: var(--theme-black);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 9999px;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    width: 100%;
}

.btn-confirm-secondary {
    background-color: white;
    color: var(--theme-black);
    border: 1px solid var(--theme-border);
    padding: 12px;
    border-radius: 9999px;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    width: 100%;
}

/* ソートメニュー */
.sort-menu-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--theme-border);
    width: 200px;
    display: none;
    z-index: 2000;
    overflow: hidden;
}

.sort-menu-dropdown.show {
    display: block;
}

.sort-option {
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 15px;
    color: var(--theme-dark-gray);
}

.sort-option:hover {
    background-color: var(--theme-extra-light-gray);
}

.sort-option.selected {
    font-weight: 700;
    color: var(--theme-blue);
}

.sort-option svg {
    width: 18px;
    height: 18px;
}

/* さらに表示ボタン */
.show-more-btn {
    color: var(--theme-blue);
    background: none;
    border: none;
    padding: 0;
    font-size: 15px;
    cursor: pointer;
    margin-top: 4px;
    display: inline-block;
}

.show-more-btn:hover {
    text-decoration: underline;
}

/* 投稿詳細モーダル内のスタイル調整 */
#post-detail-container .post-card {
    border: none;
    padding: 0 16px 0 0;
    cursor: default;
    transition: none;
    background-color: transparent;
    /* 背景は子要素で制御 */
    outline: none;
    box-shadow: none;
}

#post-detail-container .post-body {
    background-color: var(--theme-white);
    outline: none;
    box-shadow: none;
}

#post-detail-container .post-title {
    font-size: 21px;
    font-weight: 700;
    margin-bottom: 12px;
}

#post-detail-container .post-content {
    font-size: 16px;
    /* 詳細表示時は少し大きく */
    line-height: 1.7;
}

/* Twitter風ローディングスピナー */


/* 匿名投稿トグルスイッチ */
.anonymous-toggle-container {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-right: auto;
    /* 左側に配置 */
}

/* トグルスイッチ本体 (Hidden Input) */
.toggle-checkbox {
    display: none;
}

/* スイッチのラベル (外枠) */
.toggle-label {
    width: 50px;
    height: 30px;
    background-color: #e9e9ea;
    border-radius: 9999px;
    position: relative;
    cursor: pointer;
    transition: background-color 0.2s;
}

/* チェック時の背景色 (緑) */
.toggle-checkbox:checked+.toggle-label {
    background-color: #34c759;
    /* iOS green */
}

/* スイッチのノブ (白い丸) */
.toggle-label::after {
    content: '';
    width: 26px;
    height: 26px;
    background-color: white;
    border-radius: 50%;
    position: absolute;
    top: 2px;
    left: 2px;
    transition: transform 0.2s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* チェック時のノブ移動 */
.toggle-checkbox:checked+.toggle-label::after {
    transform: translateX(20px);
}

/* 匿名/実名アイコン表示 */
.mode-icon {
    width: 32px;
    height: 32px;
    object-fit: cover;
    /* containからcoverに変更して大きく表示 */
    border-radius: 50%;
    /* border: 1px solid var(--theme-border); */
    transition: transform 0.2s;
}

/* 実名アイコンは画像自体の余白で小さく見えるため拡大 */
.mode-icon.real-name-active {
    transform: scale(1.3);
}