:root {
    --newthread-color: #000000;
    --primary-color: #000000;
    --primary-light: #d1d1d1;
    --primary-dark: #545454;
    --accent-color: #d1d1d1;
    --text-primary: #000000;
    --text-secondary: #b8b8b8;
    --background-light: #ffffff;
    --background-white: #ffffff;
    --border-color: #e0e0e0;
    --shadow-small: 0 0px 0px rgba(0, 0, 0, 0.1);
    --shadow-medium: 0 0px 0px rgba(0, 0, 0, 0.12);
    --shadow-large: 0 0px 0px rgba(0, 0, 0, 0.1);
    --transition-fast: 0.2s;
    --transition-normal: 0.3s;
    --border-radius: 8px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Hiragino Sans', 'Noto Sans CJK JP', sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--background-light);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}


header {
    justify-content: center;
    align-items: center;
    padding: 16px;
    background-color: var(--background-white);
    color: white;
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid #ddd;
    box-shadow: none;
}

header h1 {
    font-size: 1.2rem;
    font-weight: 500;
    text-align: center;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}


.header-search-form {
    display: flex; 
    align-items: center;
    background-color: #f0f0f0;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: none;
}

.header-search-form input[type="text"] {
    padding: 10px 15px;
    border: none;
    background-color: transparent;  /* 背景色を透明にして親の色を使用 */
    border-radius: 0;               /* 内側の角丸を削除 */
    font-size: 1rem;
    flex: 1;
    min-width: 0;
    outline: none;                  /* フォーカス時のアウトラインを削除 */
}

.header-search-form button {
    padding: 10px 15px;
    border: none;
    background-color: transparent;  /* 背景色を透明にして親の色を使用 */
    border-radius: 0;               /* 内側の角丸を削除 */
    cursor: pointer;
    font-size: 1rem;
    flex-shrink: 0;
}

/* ホバー効果を追加（オプション） */
.header-search-form button:hover {
    background-color: rgba(0, 0, 0, 0.1);
}



/* スマホなどの小さい画面（767px以下）では両端のボタンから余白を開ける */
@media (max-width: 500px) {
    .header-search-form {
        width: calc(100% - 140px);  /* 左右のボタン分を考慮した幅 */
        margin-left: 60px;          /* 左側の余白 */
        margin-right: 40px;         /* 右側の余白 */
        margin-top: 0;
        margin-bottom: 0;
        max-width: none;            /* max-widthを無効化 */
    }
}

/* タブレット・デスクトップなど大きい画面（768px以上）では元の設定 */
@media (min-width: 501px) {
    .header-search-form {
        width: 45%;
        max-width: 600px;
        margin: 0 auto;
    }
}








.back-button {
    position: absolute; /* 追加: ヘッダー内で位置固定 */
    left: 16px;          /* 追加: 左端に配置 */
    top: 50%;            /* 追加: 垂直方向中央 */
    transform: translateY(-50%); /* 追加: 完全に中央揃え */

    font-size: 1.5rem;
    cursor: pointer;
    z-index: 100;
    min-width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color var(--transition-fast);
}


.back-button2 {
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 100;
    min-width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    transition: background-color var(--transition-fast);
}




.square-button {
    color: black;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 100;
    min-width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color var(--transition-fast);
}

/* スマホなどの小さい画面（768px未満）では右端に配置 */
@media (max-width: 500px) {
    .square-button {
        right: 20px;  /* 右端から20px */
    }
}

/* タブレット・デスクトップなど大きい画面（768px以上）では左端に配置 */
@media (min-width: 501px) {
    .square-button {
        left: 60px;   /* 元のコードと同じ左端配置 */
    }
}




.menu-button {
    color: black;
    position: absolute; /* 追加: ヘッダー内で位置固定 */
    left: 16px;          /* 追加: 左端に配置 */
    top: 50%;            /* 追加: 垂直方向中央 */
    transform: translateY(-50%); /* 追加: 完全に中央揃え */

    font-size: 1.5rem;
    cursor: pointer;
    z-index: 100;
    min-width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color var(--transition-fast);
}


.menu-button:hover, .search-button:hover, .back-button:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.back-button a {
    color:black;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}




main {
    max-width: 800px;
    margin: 0 auto;
    padding: 0;
}

/* サイドメニュー */
.side-menu {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100%;
    background-color: var(--background-white);
    box-shadow: var(--shadow-large);
    z-index: 1001;
    padding-top: 70px;
    transition: transform var(--transition-normal) ease;
    transform: translateX(0);
    overflow-y: auto;
}

.side-menu.active {
    transform: translateX(280px);
}

.side-menu h2 {
    padding: 16px 24px;
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--primary-color);
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 8px;
}

.side-menu ul {
    list-style: none;
}

.side-menu li a {
    display: block;
    padding: 14px 24px;
    color: var(--text-primary);
    text-decoration: none;
    transition: background-color var(--transition-fast);
    border-radius: 0 24px 24px 0;
    margin: 2px 0;
}

.side-menu li a:hover {
    background-color: rgba(63, 81, 181, 0.08);
    color: var(--primary-color);
}







/* スレッドリスト */
.thread-list {
    background-color: var(--background-white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-small);
    overflow: hidden;
}

.thread-item-link {
    text-decoration: none;
    color: inherit; /* 必要に応じてリンクの色を親要素に合わせる */
    display: block; /* ブロックにして全体をクリック可能に */
}


.thread-item {
    padding: 16px;
    transition: background-color var(--transition-fast);
    border-bottom: 1px solid var(--border-color);
}

.thread-item:hover {
    background-color: rgba(0, 0, 0, 0.06);
}



.thread-item h3 {
    margin-bottom: 8px;
    font-weight: 500;
}

.thread-item h3 a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.thread-item h3 a:hover {
    color: var(--primary-dark);
}

/* 閲覧数の表示スタイル */
.thread-info .views {
    margin-left: 12px;
    font-size: 0.9em;
    color: #666;
}

.thread-info .views i {
    margin-right: 3px;
}

.thread-meta {
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
}

.genre {
    background-color: var(--primary-color);
    color: var(--background-light);
    padding: 4px 8px;
    border-radius: 16px;
    margin-right: 10px;
    font-size: 0.75rem;
    font-weight: 500;
}

.date {
    color: var(--text-secondary);
}

.new-thread-button {
    margin-bottom: 20px;
    text-align: right;
}

.button {
    display: inline-block;
    padding: 10px 20px;
    background-color: var(--newthread-color);
    color: white;
    text-decoration: none;
    border-radius: 24px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: var(--shadow-small);
    transition: all var(--transition-fast);
}

.button:hover {
    background-color: var(--primary-dark);
    box-shadow: var(--shadow-medium);
    transform: translateY(-1px);
}

.no-threads, .no-comments {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 1rem;
}

/* スレッド詳細ページ */
.thread-page {
    background-color: var(--background-white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-small);
    padding: 20px;
}

.thread-info {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
}

/* コメントフォーム */
.comment-form, .reply-form {
    margin-bottom: 30px;
}

.comment-form h3, .replies h3 {
    margin-bottom: 12px;
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-primary);
}

.comment-form textarea, .reply-form textarea {
    width: 100%;
    height: 50px;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    resize: vertical;
    margin-bottom: 12px;
    font-family: inherit;
    font-size: 1rem;
    transition: border-color var(--transition-fast);
}

.comment-form textarea:focus, .reply-form textarea:focus {
    border-color: var(--primary-color);
    outline: none;
}

/* コメント一覧 */
.comments {
    margin-top: 30px;
}

.comments h3 {
    margin-bottom: 16px;
    font-weight: 500;
}

.comment {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: none;
}

.comment:last-child {
    border-bottom: none;
}

.comment-content {
    margin-bottom: 12px;
    font-size: 1.2rem;
    line-height: 1.6;
}

.comment-meta {
    display: flex;
    align-items: center;
    font-size: 0.7rem;
    color: var(--text-secondary);
}

.like-button, .reply-button {
    margin-left: 15px;
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    font-size: 0.85rem;
    padding: 4px 10px;
    border-radius: 16px;
    transition: background-color var(--transition-fast);
}

.like-button:hover, .reply-button:hover {
    background-color: rgba(63, 81, 181, 0.08);
}

.like-button {
    display: flex;
    align-items: center;
}

.like-count {
    margin-left: 4px;
}

/* 返信 */
.replies {
    margin-top: 16px;
    margin-left: 24px;
    padding-left: 16px;
    border-left: 2px solid var(--border-color);
}

.reply {
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.reply:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.cancel-reply {
    margin-left: 10px;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px 10px;
    border-radius: 16px;
    transition: background-color var(--transition-fast);
}

.cancel-reply:hover {
    background-color: rgba(0, 0, 0, 0.05);
}


/* 返信表示/非表示ボタンのスタイル */
.toggle-replies-button {
    margin-left: 10px;
    background-color: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 0.8em;
    cursor: pointer;
    transition: background-color 0.2s;
    -webkit-appearance: none; /* Safari用 */
    appearance: none;
}

.toggle-replies-button:hover {
    background-color: #e4e4e4;
}

/* 新規スレッド作成フォーム */
.new-thread-form {
    background-color: var(--background-white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-small);
    padding: 24px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-primary);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-family: inherit;
    font-size: 1rem;
    transition: border-color var(--transition-fast);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary-color);
    outline: none;
}

.form-group textarea {
    height: 150px;
    resize: vertical;
}

.error-message {
    background-color: #fff0f0;
    color: #d32f2f;
    padding: 12px;
    margin-bottom: 20px;
    border-radius: var(--border-radius);
    border-left: 4px solid #d32f2f;
}

/* オーバーレイ */
.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.4);
    z-index: 1000;
}

.overlay.active {
    display: block;
}


    


/* アニメーション効果 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.thread-item, .comment, .reply {
    animation: fadeIn 0.3s ease-in-out;
}

/* スクロールバーのスタイリング */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}


/* Add these styles to your existing CSS file */

.comment-count {
    display: inline-flex;
    align-items: center;
    margin-left: 10px;
    color: #666;
    font-size: 0.9em;
}

.comment-count i {
    margin-right: 3px;
}

/* For better visibility on thread items */
.thread-item .comment-count {
    background-color: #f0f0f0;
    padding: 2px 8px;
    border-radius: 12px;
}

/* For thread page */
.thread-info .comment-count {
    font-weight: bold;
    color: #444;
}


.report-button {
    color: red;
    background: none;
    border: none;
    cursor: pointer;
    margin-left: 8px;
}
.report-button:hover {
    text-decoration: underline;
}

.report-thread-button {
    color: red;
    background: none;
    border: none;
    cursor: pointer;
    margin-left: 8px;
}
.report-thread-button:hover {
    background-color: #ffcccc;
}










