﻿/* チャットページのレイアウト */
.post-chat-page {
  max-width: 1400px;
  margin: 10px auto 0; /* 上部マージンを70pxから100pxに増やす */
  padding: 0 1rem;
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 1.5rem;
  position: relative;
  z-index: 1;
}

/* 投稿内容エリア */
.post-content-area {
  animation: fadeIn 0.5s ease-out;
}

.post-content-display {
  /*background-color: white;*/
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
  overflow: hidden;
}

.post-content-card {
  padding: 1.5rem;
}

.post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: #666;
    justify-content: flex-end;
}

.post-meta span {
  display: flex;
  align-items: center;
}

.post-meta i {
  margin-right: 6px;
  color: var(--primary-color);
}

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.tag {
  background-color: #e9f3ff;
  color: var(--primary-color);
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.875rem;
}

.post-content-text {
    line-height: 1.7;
    padding-bottom: 1rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-bottom: 1px solid #eee;
    margin-bottom: 1rem;
    border-top: 1px solid #eee;
}

.post-summary-section {
  background-color: #f8f9fa;
  padding: 1rem;
  border-radius: var(--btn-radius);
  margin-top: 1rem;
}

.post-summary-section h4 {
  color: var(--secondary-color);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
}

.post-summary-section h4 i {
  margin-right: 8px;
}

/* チャットエリア */
.chat-area {
  position: sticky;
  top: 20px;
  height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
  animation: fadeIn 0.5s ease-out;
  animation-delay: 0.2s;
  opacity: 0;
  animation-fill-mode: forwards;
}

.chat-header {
  background-color: white;
  padding: 1rem;
  border-radius: var(--card-radius) var(--card-radius) 0 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #eee;
}

.chat-header h2 {
  font-size: 1.25rem;
  color: var(--secondary-color);
}

.chat-status {
  font-size: 0.875rem;
  color: #666;
}

.chat-main {
  flex: 1;
  background-color: white;
  overflow-y: auto;
  padding: 1rem;
}

.chat-messages {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.chat-message {
  max-width: 85%;
  padding: 0.75rem 1rem;
  border-radius: 16px;
  background-color: #f0f2f5;
  align-self: flex-start;
  animation: fadeIn 0.3s;
}

.message-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
}

.username {
  font-weight: 500;
  color: var(--primary-color);
}

.message-time {
  color: #666;
}

.message-content {
    line-height: 1.5;
    white-space: pre-wrap; /* 改行を保持し、必要に応じて折り返す */
    word-break: break-word; /* 長い単語も適切に折り返す */
}

.system-message {
  max-width: 90%;
  background-color: rgba(0, 0, 0, 0.05);
  color: #666;
  text-align: center;
  align-self: center;
  font-size: 0.875rem;
  padding: 0.5rem 1rem;
  border-radius: 20px;
}

.system-content {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
}

.chat-input-form {
  background-color: white;
  padding: 1rem;
  border-radius: 0 0 var(--card-radius) var(--card-radius);
  box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.05);
  border-top: 1px solid #eee;
}

.input-group {
  display: flex;
  gap: 0.5rem;
}

.input-group input {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 1px solid #ddd;
  border-radius: var(--btn-radius);
  font-size: 0.95rem;
}

textarea#desktopMessageInput,
textarea#mobileMessageInput {
    resize: none;
    min-height: 60px;
    max-height: 100px;
    padding: 8px 12px;
    line-height: 1.4;
    border-radius: 20px;
    overflow-y: auto;
    width: 100%;
    border: solid 1px;
}

.chat-input-form .input-group {
    align-items: flex-end;
}

.input-group input:focus {
  outline: none;
  border-color: var(--primary-color);
}

.send-btn {
  background-color: var(--primary-color);
  color: white;
  border: none;
  padding: 0 1rem;
  border-radius: var(--btn-radius);
  cursor: pointer;
  transition: background-color 0.2s;
}

.send-btn:hover {
  background-color: var(--secondary-color);
}

/* モバイル用スタイル */
/* デフォルト: PCビュー表示 */
.post-content-area,
.chat-area {
  display: block;
}

/* モバイル用要素をデフォルトで非表示 */
.post-summary, 
.chat-container {
  display: none;
}

.message-star-btn,.message-report-btn {
    border: none;
}
/* レスポンシブ設定 - モバイル表示 */
@media (max-width: 768px) {
    .post-chat-page {
    grid-template-columns: 1fr;
    margin-top: 10px;
    padding: 0 8px;
  }
  
  /* PC版要素を非表示 */
  .post-content-area,
  .chat-area {
    display: none !important;
  }

    
    /* モバイル用要素を表示 */
    .post-summary,
    .chat-container {
        display: block;
    }

  /* モバイル投稿内容のスタイル改善 */
  .post-summary {
    padding: 15px;
    margin: 10px 0;
    /*background-color: white;*/
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  }
  
  .post-summary h3 {
    font-size: 1.1rem;
    margin-bottom: 10px;
    color: var(--secondary-color);
    display: flex;
    align-items: center;
    gap: 5px;
  }

    .post-meta-mobile {
        display: flex;
        flex-direction: column;
        gap: 8px;
        margin-bottom: 12px;
        font-size: 0.85rem;
        color: #666;
        flex-direction: row;
        justify-content:flex-end;
    }
  
  .post-meta-mobile span {
    display: flex;
    align-items: center;
    gap: 5px;
  }
  
  .post-meta-mobile i {
    color: var(--primary-color);
  }
  
  .post-tags-mobile {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 10px 0;
  }
  
  .post-tags-mobile .tag {
    background-color: #e9f3ff;
    color: var(--primary-color);
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
  }
  
  /* モバイル全文表示エリア */
    .full-content-mobile {
        width: 100%;
        padding: 5px 2px;
        border-bottom: 1px solid #eee;
    }
  
  .full-content-title {
    font-size: 1rem;
    margin: 15px 0 8px;
    padding-bottom: 5px;
    border-bottom: 1px solid #eee;
    color: var(--primary-color);
  }
  
  .full-content-text {
    margin: 10px 0;
    line-height: 1.6;
    font-size: 0.95rem;
    word-break: break-word;
  }
  
  .full-content-summary {
    margin-top: 15px;
    padding: 12px;
    background-color: #f8f9fa;
    border-radius: 8px;
  }
  
  .full-content-summary h4 {
    font-size: 0.95rem;
    margin-bottom: 8px;
    color: var(--secondary-color);
  }
  
  /* モバイルチャットエリアの改善 */
  .chat-container {
    margin: 10px 0;
    border-radius: 10px;
    background-color: white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    overflow: hidden;
  }
  
  .chat-container .chat-header {
    padding: 12px;
    background-color: #f8f9fa;
  }
  
  .chat-container .chat-header h2 {
    font-size: 1.1rem;
  }
  
  #mobileChatMessages {
    padding: 10px 5px;
    overflow-y: auto;
    max-height: 60vh;
  }
  
  /* チャットメッセージのスタイル改善 */
  #mobileChatMessages .chat-message {
    max-width: 95%;
    margin: 8px 2%;
    padding: 10px;
    border-radius: 12px;
    word-wrap: break-word;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  }
  
  #mobileChatMessages .own-message {
    margin-left: auto;
    margin-right: 5px;
    background-color: #e3f2fd;
    border-left: 4px solid #2196f3;
  }
  
  #mobileChatMessages .system-message {
    max-width: 90%;
    margin: 8px auto;
    padding: 8px 15px;
    font-size: 0.85rem;
  }
  
  /* チャット入力フォームの改善 */
  .chat-container .chat-input-form {
    padding: 8px;
    border-top: 1px solid #eee;
  }
  
  .chat-container .input-group {
    background-color: #f5f5f5;
    padding: 5px;
    border-radius: 20px;
  }
  
  .chat-container .input-group input {
    padding: 8px 12px;
    font-size: 0.9rem;
  }

    .chat-container .send-btn {
        padding: 0 15px;
        width: 15%;
        min-height: 65px;
    }
}

/* デスクトップヘッダーのレスポンシブ対応 */
@media (min-width: 1024px) {
    .chat-main {
        max-height: none; /* 高さ制限を解除 */
    }

    .post-categories-container.mobile {
        display: none !important;
    }
}

/* タブレット専用のレスポンシブ対応 */
@media (min-width: 769px) and (max-width: 1024px) {
    .chat-main {
        max-height: none; /* 高さ制限を解除 */
    }
    
    .chat-area {
        max-height: none; /* 高さ制限を解除 */
    }

    .post-categories-container.mobile {
        display: none !important;
    }
}

/* タブレット横向き用の微調整 */
@media (min-width: 1025px) and (max-width: 1200px) {
    .chat-main {
        max-height: none; /* 高さ制限を解除 */
    }
}

@media (max-width: 768px) {
    .chat-main {
        overflow-y: hidden !important;
    }

    #mobileChatMessages {
        overflow-y: hidden !important;
    }

    #mobileChatMessages {
        max-height: none;
    }
    .chat-container {
        position: relative;
        z-index: 10;
    }

    #mobileChatForm {
        position: sticky;
        bottom: 0;
        background-color: #fff;
        padding: 10px 0;
        margin: 0;
        z-index: 20;
    }

    /* キーボード表示時に隠れないよう余白を確保 */
    #mobileChatMessages {
        padding-bottom: 80px;
    }
}

/* モバイルキーボード表示時の画面ジャンプ防止 - 修正版 */
.chat-page-fullscreen {
    /* position: fixed を削除 - これがスクロール不可の原因 */
    height: auto;
    width: 100%;
    overflow-y: auto; /* autoからvisibleに変更 */
}

/* PC・タブレット版でのページスクロール防止設定 */
@media (min-width: 769px) {
  /* メインコンテナを固定高さにし、ページスクロールを防止 */
  .post-chat-page {
    height: calc(100vh - 200px); /* ページヘッダー(60px) + マージン等(100px) */
    margin-bottom: 0;
    overflow: hidden;
  }

  /* 左側コンテンツエリアをスクロール可能に */
  .post-content-area {
    height: 100%;
    overflow-y: auto;
  }

  /* チャットエリアの設定変更 */
    .chat-area {
        display: flex;
        flex-direction: column;
        height: 100%;
    }

    .chat-main {
        flex: 1;
        overflow: hidden; /* 重要：これがないとスクロールが機能しません */
        position: relative;
    }

    .chat-messages {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        overflow-y: auto !important;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        height: 100% !important;
        max-height: 100% !important;
    }
}

/* Indexページと同様の.post-cardスタイルを修正 */
.post-card {
    background-color: #1e3346;
    position: relative;
    border-radius: 12px;
    /*margin-bottom: 16px;*/
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    color: #ffffff;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 220px; /* 固定heightをmin-heightに変更 */
    height: auto; /* 内容に合わせて自動調整 */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    z-index: 1;
    padding: 10px;
    background-size: 100% 100%;
    background-position: center;
    background-repeat: no-repeat;
}

    /* オーバーレイエフェクト */
    .post-card.with-overlay::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: linear-gradient(to bottom, rgba(0,0,0,0.4) 0%, rgba(0,0,0,0.7) 100%);
        z-index: -1;
    }

    /* アクションボタンエリアのスタイル調整 */
    .post-card .post-actions {
        margin-top: auto;
        background-color: rgba(0, 0, 0, 0.6);
        backdrop-filter: blur(2px);
        padding: 8px;
        border-radius: 0 0 12px 12px;
        margin: 0 -10px -10px -10px;
        position: relative;
    }

    /* アクションボタン全体のレイアウト修正 */
.post-card .action-buttons {
  display: flex;
  align-items: center;
  justify-content: space-between; /* 左右に分ける */
  width: 100%;
  position: relative; /* 相対位置指定を追加 */
}

/* 左側のボタングループを中央配置に変更 */
.action-buttons-left {
  display: flex;
  gap: 20px; /* ボタン間の間隔を調整 */
  align-items: center;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  justify-content: center;
}

/* 三点リーダーボタンを右端に配置（変更なし） */
.more-options-btn {
  margin-left: auto; /* 右寄せ */
  background: transparent;
  border: none;
  color: white;
  font-size: 1.3rem;
  cursor: pointer;
  padding: 5px 10px;
}

        .post-card .action-btn {
        background: transparent;
        border: none;
        display: flex;
        align-items: center;
        gap: 6px;
        cursor: pointer;
        padding: 5px;
    }

        .post-card .action-btn i {
            font-size: 1.3rem; /* アイコンサイズを大きく */
        }

        .post-card .action-btn span {
            font-size: 1.2rem; /* テキストサイズを大きく */
            font-weight: 600;
        }

    /* テキストコンテンツの調整 - 省略をなくす */
.post-card .post-text {
    font-size: 18px;
    line-height: 1.6;
    margin: 0;
    padding: 15px 5px;
    color: #ffffff;
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.5);
    white-space: pre-line;
    /* 省略関連のプロパティを削除 */
    /* display: -webkit-box; */
    /* -webkit-line-clamp: 4; */
    /* -webkit-box-orient: vertical; */
    /* overflow: hidden; */
    /* text-overflow: ellipsis; */
    overflow: visible; /* テキストが切れないように */
    font-weight: 500;
}


/* チャット画面のカテゴリ表示強化 */
.post-categories-container {
    margin-top: 0.8rem;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 8px;
    padding: 0.6rem;
    backdrop-filter: blur(3px);
}

.categories-title {
    color: white;
    font-size: 0.85rem;
    margin-bottom: 0.4rem;
    opacity: 0.9;
}

.categories-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.category-tag {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 0.2rem 0.6rem;
    border-radius: 16px;
    font-size: 0.8rem;
    text-decoration: none;
    transition: all 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

    .category-tag:hover {
        background: rgba(255, 255, 255, 0.3);
        transform: translateY(-1px);
    }

/* モバイル最適化 */
.post-categories-container.mobile {
    margin-top: 0.5rem;
    padding: 0.5rem;
}

@media (max-width: 768px) {
    .category-tag {
        font-size: 0.75rem;
        padding: 0.15rem 0.5rem;
    }
}

/* 投稿カードのタイトルスタイル - 更新 */
.post-card .post-title {
    text-align: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 10px;
    margin-top: 5px;
    color: #ffffff;
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.7);
    padding: 8px;
    background-color: rgba(0, 0, 0, 0.4);
    border-radius: 6px;
    border-radius: 12px 12px 0 0;
    margin: -10px -10px -10px;
    position: relative; /* 相対位置を設定 */
}

/* タグ関連のスタイル */
.post-categories-header {
    position: absolute;
    top: 5px;
    left: 5px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    z-index: 2;
}

/* 日付表示のスタイル - 更新 */
.post-card .post-date {
    position: absolute;
    top: 5px;
    right: 5px;
    font-size: 0.8rem;
    color: #ffffff;
    opacity: 0.9;
    /*background-color: rgba(0, 0, 0, 0.3);*/
    padding: 2px 6px;
    border-radius: 4px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

/* ログインモーダル用スタイル */
.login-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    align-items: center;
    justify-content: center;
}

.login-modal-content {
    background-color: #fff;
    margin: 0 auto;
    padding: 20px;
    border-radius: 8px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.login-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

    .login-modal-header h3 {
        margin: 0;
        color: #333;
    }

.close-modal {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.login-modal-body {
    margin-bottom: 20px;
}

.login-modal-footer {
    display: flex;
    justify-content: space-between;
}

.login-btn {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
}

.cancel-btn {
    background-color: #f1f1f1;
    color: black;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
}
/* ログイン誘導 */
.chat-login-prompt {
    padding: 8px 12px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: center;
    background:white;
}

    .chat-login-prompt .login-btn {
        background-color: #007bff;
        color: #fff;
        border: none;
        padding: 10px 14px;
        border-radius: 6px;
        cursor: pointer;
        display: inline-flex;
        align-items: center;
        gap: 8px;
        font-weight: 600;
    }

        .chat-login-prompt .login-btn:hover {
            background-color: #0069d9;
        }

/* 左側のボタングループ */
.action-buttons-left {
  display: flex;
  gap: 20px; /* ボタン間の間隔を調整 */
  align-items: center;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  justify-content: center;
}

/* 三点リーダーボタンの改良スタイル - position:relativeを追加 */
.more-options-btn {
    position: relative; /* これを追加 */
    background: rgba(255, 255, 255, 0.1); /* 半透明の背景 */
    border: none;
    color: white;
    font-size: 1.3rem;
    cursor: pointer;
    padding: 8px 10px; /* パディングを増やす */
    border-radius: 50%; /* 完全な円形に */
    width: 36px; /* 固定幅 */
    height: 36px; /* 固定高さ */
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    margin-right: 5px; /* 右側の余白 */
}

.more-options-btn:hover {
        background: rgba(255, 255, 255, 0.25); /* ホバー時は少し明るく */
        transform: scale(1.1);
    }

    .more-options-btn i {
        position: relative;
        top: 1px; /* 微調整：縦方向の配置 */
    }

/* ケバブメニューのスタイル - デザイン修正のみ */
.options-menu {
    position: absolute;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    right: 0;
    top: 100%;
    min-width: 160px;
    z-index: 200;
    overflow: hidden;
    display: none;
    margin-top: 5px; /* メニューとボタンの間に余白を追加 */
}

.options-menu-item:hover {
    background-color: #f5f5f5;
}

.options-menu-item i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
    color: #555; /* アイコンの色を設定 */
}

.options-menu-item.danger {
    color: #dc3545;
}

    .options-menu-item.danger i {
        color: #dc3545;
    }

.options-menu-item {
    padding: 12px 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: background-color 0.2s;
    white-space: nowrap; /* テキストの折り返しを防止 */
    color: #333; /* テキスト色を明示的に設定 */
    font-size: 14px; /* フォントサイズ指定 */
}

/* モバイル用にメニューの位置を調整 */
@media (max-width: 768px) {
    .options-menu {
        right: 0;
        top: 100%; /* ボタンの下に表示 */
    }
    
    /* モバイルでのメニュー表示を調整 */
    .more-options-btn {
        position: relative !important; /* 基準点を維持 */
    }
}

/* ページヘッダー */
/*.page-header {
    background: var(--c-bg-base);
    color: white;
    padding: 20px 0;
    box-shadow: 0 4px 20px rgba(107, 124, 147, 0.2);
    position: relative;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    position: relative;
}

.page-header h1 {
    text-align: center;
    width: 100%;
    margin: 0 auto;
}

.back-btn {
    position: absolute;
    left: 20px;
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.1);
}

    .back-btn:hover {
        background: rgba(255, 255, 255, 0.2);
        color: white;
        text-decoration: none;
    }*/

/* 画像アップロードボタンのスタイル */
.image-upload-btn {
    background: none;
    border: none;
    color: #007bff;
    font-size: 1.2rem;
    padding: 0 10px;
    cursor: pointer;
    transition: color 0.3s;
}

    .image-upload-btn:hover {
        color: #0056b3;
    }

/* 画像プレビューエリアのスタイル */
.image-preview {
    margin-top: 10px;
    max-height: 150px;
    text-align: left;
    position: relative;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 5px;
}

    .image-preview img {
        max-height: 120px;
        max-width: 100%;
        border-radius: 4px;
    }


/* 新しいチャット入力欄のデザイン */
.message-input-container {
    background-color: #ffffff;
    border-radius: 20px;
    padding: 5px;
    margin-top: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow: visible;
    border: 1px solid #e0e0e0;
}

/* フレックスレイアウトで横並びに */
.message-input-area {
    display: flex;
    align-items: center;
    min-height: 40px;
}

/* テキストエリアを伸縮可能に */
    .message-input-area textarea {
        flex: 1;
        background-color: transparent;
        border: none;
        color: #333;
        font-size: 16px;
        resize: none;
        padding: 10px;
        min-height: 24px;
        max-height: 120px; /* 約5行分の高さ */
        line-height: 1.5; /* 適切な行間隔を設定 */
        overflow-y: auto;
        white-space: pre-wrap;
        word-wrap: break-word;
        transition: height 0.2s ease; /* 高さの変更をスムーズに */
        /* Firefox向けスクロールバースタイル */
        scrollbar-width: thin;
        scrollbar-color: rgba(0,0,0,0.15) rgba(0,0,0,0.02);
    }

        /* WebKitベースのブラウザ向けスクロールバースタイル */
        .message-input-area textarea::-webkit-scrollbar {
            width: 6px; /* スクロールバーの幅 */
        }

        .message-input-area textarea::-webkit-scrollbar-track {
            background: rgba(0,0,0,0.02); /* トラック部分の背景 */
            border-radius: 10px;
        }

        .message-input-area textarea::-webkit-scrollbar-thumb {
            background: rgba(0,0,0,0.15); /* つまみ部分の色 */
            border-radius: 10px;
            transition: background 0.2s;
        }

        .message-input-area textarea::-webkit-scrollbar-thumb:hover {
            background: rgba(0,0,0,0.25); /* ホバー時の色 */
        }

.message-input-area textarea:focus {
    outline: none;
}

        .message-input-area textarea::placeholder {
            color: rgba(0,0,0,0.4);
        }

/* アイコングループを固定幅に */
.message-icons {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 5px;
    min-width: 50px;
    justify-content: flex-end;
}

/* 各アイコンボタン - 色を暗めのグレーに */
.message-icon-btn {
    background: none;
    border: none;
    color: #707070;
    font-size: 1.2rem;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

    .message-icon-btn:hover {
        color: #333;
        background-color: rgba(0,0,0,0.05);
    }

/* 送信ボタン特別スタイル - 青色を維持 */
.message-send-btn {
    background: none;
    border: none;
    color: #4f74e3;
    font-size: 1.2rem;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

    .message-send-btn:hover {
        color: #3a5ac2;
        transform: scale(1.1);
        background-color: rgba(79,116,227,0.1);
    }

/* モバイル向け調整 */
@media (max-width: 480px) {
    .message-icons {
        min-width: 140px; /* モバイル用に幅を少し狭める */
        gap: 4px;
    }
    
    .message-icon-btn, .message-send-btn {
        width: 26px;
        height: 26px;
        font-size: 1rem;
    }
}

/* 画像プレビュー用スタイル */
.preview-container {
    position: relative;
    display: inline-block;
    margin-top: 8px;
}

    .preview-container img {
        max-height: 120px;
        max-width: 100%;
        border-radius: 8px;
        border: 1px solid #ddd;
    }

.remove-image-btn {
    position: absolute;
    top: -8px;
    right: -8px;
    background: rgba(0,0,0,0.6);
    color: white;
    border: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 10px;
    padding: 0;
}

    .remove-image-btn:hover {
        background: rgba(0,0,0,0.8);
    }

.message-image {
    margin-top: 8px;
}

    .message-image img {
        max-width: 250px;
        max-height: 200px;
        border-radius: 8px;
        cursor: pointer;
        transition: transform 0.2s;
    }

        .message-image img:hover {
            transform: scale(1.02);
        }

/* モバイル対応 */
@media (max-width: 768px) {
    .message-image img {
        max-width: 200px;
        max-height: 150px;
    }
}

.conn-badge {
    margin-left: 8px;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    background: #2a2a2a;
    color: #fff;
}

    .conn-badge.connecting {
        background: #6c757d;
    }

    .conn-badge.reconnecting {
        background: #ffc107;
        color: #000;
    }

    .conn-badge.disconnected {
        background: #dc3545;
    }

    .conn-badge.connected {
        background: #28a745;
    }

/* 通報モーダル */
.report-modal {
    display: none;
    position: fixed;
    z-index: 1100;
    inset: 0;
    background: rgba(0,0,0,0.5);
    align-items: center;
    justify-content: center;
    padding: 16px;
}

    .report-modal .content {
        background: #fff;
        width: 100%;
        max-width: 520px;
        border-radius: 8px;
        box-shadow: 0 6px 24px rgba(0,0,0,0.2);
        overflow: hidden;
    }

    .report-modal .header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 12px 16px;
        border-bottom: 1px solid #eee;
    }

    .report-modal .body {
        padding: 16px;
    }

    .report-modal .footer {
        padding: 12px 16px;
        border-top: 1px solid #eee;
        display: flex;
        gap: 8px;
        justify-content: flex-end;
    }

    .report-modal .close-x {
        cursor: pointer;
        font-size: 20px;
        color: #666;
        background: transparent;
        border: 0;
    }

    .report-modal label {
        display: block;
        font-size: 0.9rem;
        margin-bottom: 6px;
        color: #333;
    }

    .report-modal select, .report-modal textarea {
        width: 100%;
        border: 1px solid #ccc;
        border-radius: 6px;
        padding: 8px;
        font-size: 14px;
    }

    .report-modal textarea {
        min-height: 96px;
        resize: vertical;
    }

.btn {
    border: 0;
    border-radius: 6px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 14px;
}

    .btn.secondary {
        background: #e0e0e0;
        color: #333;
    }

    .btn.primary {
        background: #1976d2;
        color: #fff;
    }