/* layout.css : サイドバー／メインエリア／チャット下部入力欄／メモ帳 */

/* サイドバー */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 240px;
  height: 100vh;
  background: #111827;
  color: #fff;
  display: flex;
  flex-direction: column;
  padding: 16px 16px;
  box-sizing: border-box;
  z-index: 20;  /* 入力エリアより前面 */
}

.logo {
  font-weight: 700;
  margin-bottom: 16px;
}

.new-chat-btn {
  width: 100%;
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 10px 12px;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 10px;
}

.new-chat-btn:hover {
  background: #1e40af;
}

.section-title {
  font-size: 11px;
  letter-spacing: 0.06em;
  color: #cbd5e1;
  text-transform: uppercase;
  margin: 10px 0 6px;
}

.chat-session-list {
  max-height: 42vh;
  overflow-y: auto;
  margin-bottom: 14px;
  padding-right: 4px;
}

.chat-session-item {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 6px 6px;
  margin-bottom: 6px;
  border-radius: 12px;
  background: transparent;
}

.chat-session-item.active {
  background: #1f2937;
}

.chat-session-title {
  flex: 1;
  text-align: left;
  border: 1px solid #4b5563;
  background: #111827;
  color: #e5e7eb;
  border-radius: 10px;
  padding: 8px 10px;
  cursor: pointer;
  font-size: 13px;
  line-height: 1.4;
  word-break: break-word;
}

.chat-session-title:hover {
  background: #1f2937;
}

.chat-session-item.active .chat-session-title {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
}

.chat-delete-btn {
  border: 1px solid #4b5563;
  background: #111827;
  color: #cbd5e1;
  font-size: 14px;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 8px;
  white-space: nowrap;
}

.chat-delete-btn:hover {
  color: #ef4444;
  border-color: #ef4444;
}

.nav-btn {
  width: 100%;
  padding: 10px 12px;
  margin-bottom: 8px;
  border: none;
  border-radius: 12px;
  background: #1f2937;
  color: #e5e7eb;
  border: 1px solid #1f2937;
  text-align: left;
  cursor: pointer;
}

.nav-btn:hover {
  background: #334155;
}

/* ログアウトボタン（一番下に配置） */
.logout-btn {
  margin-top: auto;
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-radius: 9999px;
  background: #ef4444;
  color: #fff;
  cursor: pointer;
}

.logout-btn:hover {
  background: #b91c1c;
}

/* サイドバー右側メインエリア */
.main-area {
  margin-left: 240px;
  width: calc(100% - 240px);
  min-height: 100vh;
  box-sizing: border-box;
}

/* 画面切替（チャット/メモ帳） */
.screen {
  display: none;
  padding: 24px;
  box-sizing: border-box;
}

.screen.active {
  display: block;
}

/* メモ帳 */
#memoArea {
  width: 100%;
  height: 60vh;
  font-size: 15px;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  box-sizing: border-box;
}

.memo-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.memo-new-btn {
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 8px 12px;
  cursor: pointer;
}

.memo-new-btn:hover {
  background: #1e40af;
}

.memo-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 12px 0;
}

.memo-item {
  display: flex;
  align-items: center;
  gap: 6px;
  border: none;
  background: #f8fafc;
  color: #0f172a;
  border-radius: 10px;
  padding: 4px 8px;
  line-height: 1.2;
  cursor: pointer;
  font-size: 13px;
}

.memo-item:hover {
  background: #e2e8f0;
}

.memo-item.active {
  background: #2563eb;
  color: #fff;
}

.memo-delete-btn {
  border: none;
  background: transparent;
  color: #9ca3af;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 6px;
  font-size: 12px;
}

.memo-delete-btn:hover {
  color: #ef4444;
  background: #e5e7eb;
}

/* チャットの下固定入力エリア */
.input-area {
  position: fixed;
  bottom: 0;
  left: 240px;
  width: calc(100% - 240px);
  background: #ffffff;
  border-top: 1px solid #ddd;
  box-shadow: 0 -2px 8px rgba(0,0,0,0.08);
  padding: 12px 0;
  z-index: 10;
}

.chat-log {
  border-top: 1px solid #eee;
  padding-top: 10px;
  font-size: 14px;
  /* ページ全体でスクロールするため高さ指定・内部スクロールを無効化 */
  height: auto;
  overflow: visible;
}

/* サイドバー右側メインエリア */
.main-area {
  margin-left: 240px;
  width: calc(100% - 240px);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}
