/* モダンでライトなテーマ - 基本設定 */
:root {
    --primary-color: #4a6fa5;
    --primary-light: #6b8cbe;
    --primary-dark: #345689;
    --accent-color: #ff6b6b;
    --background-light: #f5f8fa;
    --text-dark: #2d3748;
    --text-medium: #4a5568;
    --text-light: #718096;
    --border-color: #e2e8f0;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --card-bg: #ffffff;
    --success: #48bb78;
    --gray-100: #f7fafc;
    --gray-200: #edf2f7;
    --gray-300: #e2e8f0;
}

/* ページ全体の背景 */
body {
    /*background: var(--background-light);*/
    position: relative;
    overflow-x: hidden;
    min-height: 100vh;
    color: var(--text-dark);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* カード効果（共通クラス） */
.card-effect {
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 4px 16px var(--shadow-color);
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

    .card-effect:hover {
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
        transform: translateY(-2px);
    }

/* お便り箱全体のスタイル */
.board-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
    position: relative;
    color: var(--text-dark);
}

.page-header {
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
}

    .page-header h1 {
        font-size: 2.2rem;
        margin-bottom: 0.5rem;
        color: var(--primary-color);
        position: relative;
        display: inline-block;
    }

        .page-header h1:after {
            content: '';
            position: absolute;
            bottom: -8px;
            left: 10%;
            width: 80%;
            height: 3px;
            background: var(--primary-light);
            border-radius: 3px;
            z-index: 1;
        }

    .page-header p {
        font-size: 1.1rem;
        color: var(--text-medium);
        margin-bottom: 1.5rem;
    }

/* ボヤボックス */
.boya-box {
    padding: 1.5rem;
    display: inline-block;
    max-width: 80%;
    position: relative;
    transition: all 0.3s ease;
    margin: 0 auto;
    color: var(--text-medium);
    background-color: var(--card-bg);
    box-shadow: 0 4px 12px var(--shadow-color);
    border-radius: 12px;
}

    .boya-box i {
        color: var(--primary-color);
        margin-right: 8px;
    }

/* ボードコンテナのレイアウト */
.board-container {
    display: block; /* グリッドから通常のブロック表示に変更 */
    margin-bottom: 2.5rem; /* 下部にマージンを追加 */
    width: 100%; /* 幅を100%に設定 */
    max-width: 1000px; /* 最大幅を制限 */
    margin-left: auto;
    margin-right: auto;
}

/* フォームセクション */
.post-form-section {
    padding: 1.8rem;
    width: 100%; /* 幅を100%に設定 */
    max-width: 1000px; /* 最大幅を制限 */
    min-width: 300px; /* 最小幅を設定 */
    margin: 0 auto; /* 中央寄せ */
    transition: all 0.3s ease;
    z-index: 10;
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 4px 16px var(--shadow-color);
    border: 1px solid var(--border-color);
}

    .post-form-section:hover {
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    }

    .post-form-section h2 {
        font-size: 1.5rem;
        margin-bottom: 1.8rem;
        color: var(--primary-color);
        display: flex;
        align-items: center;
        gap: 0.5rem;
        position: relative;
        z-index: 2;
    }

        .post-form-section h2::after {
            content: '';
            position: absolute;
            bottom: -8px;
            left: 0;
            width: 60%;
            height: 2px;
            background: var(--primary-light);
            border-radius: 2px;
        }

.post-form {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    position: relative;
    z-index: 2;
}

.form-group {
    margin-bottom: 1rem;
    position: relative;
}

    .form-group label {
        display: block;
        margin-bottom: 0.5rem;
        font-weight: 500;
        color: var(--text-medium);
    }

.optional {
    font-size: 0.8rem;
    color: var(--text-light);
    font-weight: normal;
}

.required {
    color: var(--accent-color);
}

.form-control {
    width: 100%;
    padding: 0.85rem;
    background: var(--gray-100);
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    font-size: 1rem;
    color: var(--text-dark);
    transition: all 0.3s ease;
}

    .form-control::placeholder {
        color: var(--text-light);
    }

    .form-control:focus {
        border-color: var(--primary-light);
        box-shadow: 0 0 0 3px rgba(74, 111, 165, 0.2);
        outline: none;
        background: var(--card-bg);
    }

textarea.form-control {
    min-height: 140px;
    resize: vertical;
}

.form-text {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-top: 0.5rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.85rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

    .btn-primary:hover {
        background: var(--primary-dark);
        transform: translateY(-1px);
        box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
    }

.btn-secondary {
    background: var(--gray-200);
    color: var(--text-medium);
    border: 1px solid var(--gray-300);
    padding: 0.85rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

    .btn-secondary:hover {
        background: var(--gray-300);
        transform: translateY(-1px);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    }

/* 投稿一覧エリア */
.posts-section {
    padding: 1.8rem;
    position: relative;
    z-index: 5;
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 4px 16px var(--shadow-color);
    border: 1px solid var(--border-color);
    min-width: 300px; /* 最小幅を設定 */
    width: 100%; /* 幅を100%に設定 */
    margin-bottom: 2rem; /* 下部にマージンを追加 */
}

.posts-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
    position: relative;
    z-index: 2;
}

    .posts-header h2 {
        font-size: 1.5rem;
        color: var(--primary-color);
        display: flex;
        align-items: center;
        gap: 0.5rem;
        margin: 0;
        position: relative;
    }

        .posts-header h2::after {
            content: '';
            position: absolute;
            bottom: -8px;
            left: 0;
            width: 60%;
            height: 2px;
            background: var(--primary-light);
            border-radius: 2px;
        }

/* 投稿アイテム */
.post-item {
    background: var(--card-bg);
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 1.8rem;
    box-shadow: 0 4px 12px var(--shadow-color);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

    .post-item:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
    }

.post-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    gap: 1rem;
    position: relative;
    z-index: 2;
}

.post-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.post-author {
    font-weight: 500;
    color: var(--text-dark);
}

    .post-author i {
        color: var(--primary-color);
    }

.post-date {
    font-size: 0.85rem;
    color: var(--text-light);
}

.post-content {
    line-height: 1.6;
    color: var(--text-dark);
    margin-bottom: 1rem;
    position: relative;
    z-index: 2;
}

    .post-content p {
        margin: 0;
    }

.post-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--gray-200);
    padding-top: 1.2rem;
    margin-top: 1.2rem;
    position: relative;
    z-index: 2;
}

.post-id {
    font-size: 0.85rem;
    color: var(--text-light);
}

.post-actions {
    display: flex;
    gap: 1rem;
}

.like-btn, .reply-btn {
    background: var(--gray-100);
    border: 1px solid var(--gray-300);
    border-radius: 20px;
    padding: 0.35rem 0.75rem;
    cursor: pointer;
    color: var(--text-medium);
    display: flex;
    align-items: center;
    gap: 0.25rem;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

    .like-btn:hover, .reply-btn:hover {
        color: var(--primary-color);
        background: var(--gray-200);
        transform: translateY(-1px);
    }

    .like-btn.active {
        color: var(--accent-color);
        background: rgba(255, 107, 107, 0.1);
    }

        .like-btn.active i {
            font-weight: 900;
        }

/* 返信エリア */
.replies {
    margin-top: 1rem;
    padding-left: 1.5rem;
    border-left: 2px solid var(--gray-200);
}

.reply-item {
    padding: 1rem;
    background: var(--gray-100);
    border-radius: 8px;
    margin-bottom: 0.5rem;
    border: 1px solid var(--gray-200);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    color: var(--text-dark);
}

    .reply-item:hover {
        background: var(--card-bg);
        transform: translateY(-1px);
    }

.reply-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.reply-author {
    font-weight: 500;
    color: var(--text-dark);
    font-size: 0.9rem;
}

.reply-date {
    font-size: 0.8rem;
    color: var(--text-light);
}

.reply-content p {
    margin: 0;
    font-size: 0.95rem;
    color: var(--text-dark);
}

/* 投稿なしメッセージ */
.no-posts {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-medium);
    background: var(--gray-100);
    border-radius: 12px;
    border: 1px solid var(--gray-200);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
}

    .no-posts i {
        font-size: 3rem;
        margin-bottom: 1rem;
        color: var(--text-light);
    }

    .no-posts h3 {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
        color: var(--text-medium);
    }

/* ページネーション */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 2.5rem;
    gap: 1rem;
}

.page-btn {
    background: var(--gray-100);
    border: 1px solid var(--gray-300);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-medium);
}

    .page-btn:hover:not(:disabled) {
        background: var(--gray-200);
        transform: translateY(-1px);
        color: var(--primary-color);
    }

    .page-btn:disabled {
        opacity: 0.5;
        cursor: not-allowed;
    }

.page-info {
    font-size: 0.9rem;
    color: var(--text-medium);
    background: var(--gray-100);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--gray-300);
}

/* レスポンシブデザイン */
@media (max-width: 992px) {
    .board-container {
        padding: 0 1rem;
    }

    .post-form-section {
        position: static;
        margin-bottom: 0; /* 下マージン削除 */
        margin-top: 2rem; /* 上マージン追加 */
        width: 100%; /* モバイル表示時も幅を100%に */
    }
}

@media (max-width: 768px) {
    .page-header h1 {
        font-size: 1.8rem;
    }

    .posts-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .post-header {
        flex-direction: column;
    }

    .post-info {
        width: 100%;
    }

    .form-actions {
        flex-direction: column;
    }

    .btn-primary, .btn-secondary {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 576px) {
    .board-page {
        padding: 1rem 0.5rem;
    }

    .posts-section, 
    .post-form-section {
        padding: 1.2rem;
        border-radius: 8px;
    }
}

/* メッセージタイプのセレクトボックス用スタイル追加 */
.form-control.select-message-type {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%234a5568' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.85rem center;
    background-size: 1rem;
    padding-right: 2.5rem;
}

.message-type-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    margin-right: 8px;
    font-size: 0.9rem;
}

.type-opinion {
    background-color: rgba(74, 111, 165, 0.1);
    color: var(--primary-color);
}

.type-bug {
    background-color: rgba(255, 107, 107, 0.1);
    color: var(--accent-color);
}

.type-feature {
    background-color: rgba(72, 187, 120, 0.1);
    color: var(--success);
}

.type-question {
    background-color: rgba(237, 137, 54, 0.1);
    color: #ed8936;
}

.type-other {
    background-color: rgba(113, 128, 150, 0.1);
    color: var(--text-medium);
}

/* 投稿一覧でメッセージタイプを表示するためのスタイル */
.post-type {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

/* レスポンシブデザインの調整 */
@media (max-width: 992px) {
    .post-form-section {
        position: static;
        margin: 2rem auto 0; /* 上マージン追加 */
    }
}