body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0;
  height: 100vh;
  background: rgba(255, 255, 255, 0.9);
  overflow: hidden; 
  display: flex;
  flex-direction: column;
}

.video-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  overflow: hidden;
}

.video-background video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* --- ここから追加・変更したスタイル --- */

/* トップバー */
header {
  background: #000000;
  color: white;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

/* ヘッダーのタイトル部分 */
header .title {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

/* サイドバー開閉ボタン */
.sidebar-toggle-btn {
  background: none;
  border: none;
  color: white;
  font-size: 1.6rem;
  cursor: pointer;
  padding: 0 5px;
  margin-right: 10px;
  transition: transform 0.3s ease, color 0.2s ease;
}

/* ヘッダー右側の要素をまとめるコンテナ */
.header-right {
  display: flex;
  align-items: center;
  gap: 15px;
}

/* ログイン状態のテキスト */
.login-status {
  color: #fff;
  margin: 0;
  font-size: 0.9rem;
  white-space: nowrap;
}

/* ヘッダー以下のコンテンツエリア */
.app-container {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* 左サイドバー */
.sidebar {
  width: 220px;
  background: rgba(10, 10, 10, 0.75);
  backdrop-filter: blur(5px);
  padding: 5px;
  box-sizing: border-box;
  flex-direction: column;
  gap: 10px;
  border-right: 1px solid #444;
  overflow-y: auto;
  /* 開閉アニメーションのための設定 */
  transition: width 0.3s ease, padding 0.3s ease;
  flex-shrink: 0; /* サイドバーがウィンドウサイズに影響されないようにする */
  overflow-x: hidden; /* 横方向のはみ出しを隠す */
}

/* サイドバーが閉じている時のスタイル */
.app-container.sidebar-collapsed .sidebar {
  width: 0;
  padding-left: 0;
  padding-right: 0;
}

/* アコーディオンの各アイテム */
.accordion-item {
  overflow: hidden;
}

/* アコーディオンのヘッダー（クリックするボタン） */
.accordion-header {
  width: 100%;
  padding: 15px;
  background-color: transparent;
  color: #eee;
  border: none;
  cursor: pointer;
  text-align: left;
  font-size: 1rem;
  font-weight: bold;
  transition: background-color 0.3s ease;
  display: flex;
  justify-content: space-between;
  align-items: center;
  white-space: nowrap; /* テキストの折り返しを防ぐ */
}

.accordion-header:hover {
  background-color: #4f4f4f;
}

/* 開閉を示す矢印アイコン */
.accordion-header::after {
  content: '▼';
  font-size: 0.8em;
  color: #999;
  transition: transform 0.3s ease;
}

/* アクティブ（開いている）状態の矢印 */
.accordion-header.active::after {
  transform: rotate(180deg);
}

/* アコーディオンのコンテンツエリア */
.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
  background-color: rgba(0, 0, 0, 0.3);
  padding: 0 0 0 15px;
}

/* 展開されたコンテンツ内のツールリンク */
.tool-link {
  display: block;
  color: #ddd;
  text-decoration: none;
  padding: 12px 10px;
  margin: 8px 0;
  transition: background-color 0.2s ease, color 0.2s ease;
  white-space: nowrap;
}
.tool-link:last-child {
  margin-bottom: 10px;
}

.tool-link:hover {
  background-color: #555;
  color: #fff;
}

/* メインコンテンツエリア */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

/* --- 既存スタイルの調整 --- */

main {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  background: #0000009a;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 90%;
  margin: 1% auto 0 auto;
  box-sizing: border-box;
  box-shadow: #333 0px 0px 10px;
  border-radius: 12px;
}

footer {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  padding: 10px 20px;
  border-top: 1px solid #ddd;
  gap: 8px;
  box-sizing: border-box;
  width: 90%;
  margin: 0 auto 1% auto;
  background-color: #0000009a;
  box-shadow: #333 0px 0px 10px;
  border-radius: 12px;
}

/* --- ここまでが追加・変更したスタイル --- */


/* 既存の他のスタイルは変更ありません */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.3s ease;
  cursor: pointer;
  gap: 10px;
  border: 2px solid transparent;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: #9bbdf0;
  color: white;
}

.btn-primary:hover {
  background: #8ab2eb;
}

.btn-outline {
  background: transparent;
  color: #9bbdf0;
  border: 2px solid #9bbdf0;
}

.btn-outline:hover {
  background: #9bbdf0;
  color: white;
}

.btn-google {
  background: #fff;
  color: #333;
  border: 2px solid #ddd;
}

.btn-google:hover {
  border-color: #4285f4;
}

.btn-circle {
  border-radius: 50%;
  width: 40px;
  height: 40px;
  padding: 0;
}

.btn-icon {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  color: #9bbdf0;
}

.btn-icon:hover {
  color: #8ab2eb;
  transform: translateY(-2px);
}

header .title img {
  width: 32px;
  height: 32px;
}

header button{
  background: transparent;
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 6px 10px;
  cursor: pointer;
  transition: all 0.3s ease;
}
header button:hover {
  background-color: #9bbdf0;
  transform: translateY(-2px);
}

header .logout {
  background: transparent;
  border: 2px solid #9bbdf0;
  border-radius: 4px;
  color: #fff;
  font-weight: bold;
  padding: 6px 12px;
  cursor: pointer;
  transition: all 0.3s ease;
}
header .logout:hover {
  background: #9bbdf0;
  color: #000;
  transform: translateY(-2px);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

.chat-row {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: right;
}

.chat-row.bot {
  justify-content: flex-start;
}

.chat-row.user {
  flex-direction: row;
}

.avatar {
  width: 32px;
  height: 32px;
  background: #9bbdf0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
  font-size: 18px;
  user-select: none;
}

.bubble {
  max-width: 80vw;
  padding: 10px 15px;
  border-radius: 12px;
  font-size: 1rem;
  line-height: 1.3;
  word-break: break-word;
}

.bot .bubble {
  background: #e0e0e0;
  color: #333;
  border-bottom-left-radius: 0;
}

.user .bubble {
  background: #c0d2ec;
  color: #000000;
  border-bottom-right-radius: 0;
}

.progress-container {
    width: 100%;
    background-color: #e0e0e0;
    border-radius: 4px;
    margin: 8px 0;
    height: 10px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background-color: #4caf50;
    transition: width 0.3s ease;
}

textarea {
  flex: 1;
  min-width: 0;
  padding: 10px 15px;
  border-radius: 20px;
  border: 1px solid #ccc;
  font-size: 1rem;
  outline: none;
}

button.send {
  background: transparent;
  border: none;
  cursor: pointer;
  color: #9bbdf0;
  font-size: 1.8rem;
  user-select: none;
  flex-shrink: 0;
  transition: all 0.3s ease;
}
.send:hover {
  color: #8ab2eb;
  transform: translateY(-2px);
}

.file-select {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  user-select: none;
  flex-shrink: 0;
  transition: all 0.3s ease;
}
.file-select:hover {
  transform: translateY(-2px);
}

input[type="file"] {
  display: none;
}

.typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: #999;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-10px);
    }
}

footer.dragover {
  background-color: #f0eaff;
  border-radius: 8px;
  transition: background-color 0.3s ease;
}

@media (max-width: 767px) {
  .app-container {
    width: 100%;
  }
  .sidebar {
    width: 100%;
    height: auto;
    padding: 10px;
    border-right: none;
    border-bottom: 1px solid #444;
  }

  .main-content {
    height: auto;
    flex: 1;
  }
  
  .header-right {
    gap: 8px;
  }
  .login-status {
    font-size: 0.8rem;
  }
}

.disabled {
  pointer-events: none;
  opacity: 0.5;
}


.header-right {
  display: flex;
  align-items: center;
  gap: 15px;
  position: relative;
}

/* ユーザーメニュー全体 */
.user-menu {
  position: relative;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ドロップダウンメニュー */
.dropdown-menu {
  display: none;
  position: absolute;
  right: 0;
  top: 40px;
  background: rgba(20, 20, 20, 0.95);
  border-radius: 8px;
  padding: 10px;
  min-width: 160px;
  color: #fff;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
  z-index: 999;
  text-align: left;
  backdrop-filter: blur(8px);
}

.dropdown-menu.show {
  display: block;
  animation: fadeIn 0.2s ease-out;
}

.dropdown-menu p {
  margin: 0;
  padding-bottom: 8px;
  border-bottom: 1px solid #444;
  font-size: 0.85rem;
  color: #ccc;
}

.dropdown-item {
  width: 100%;
  border-radius: 0;
  display: block;
  color: #ddd;
  text-decoration: none;
  padding: 8px 10px;
  margin: 6px 0;
  transition: background-color 0.2s ease, color 0.2s ease;
  text-align: left;
}
.dropdown-item:hover {
  background-color: #555;
  color: #fff;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 通信時間表示用のスタイル */
#communication-timer {
  gap: 8px;
  padding: 6px 12px;
  background-color: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 6px;
  font-size: 14px;
  color: #91bbfd;
  margin-right: 10px;
  margin-left: auto
}

#communication-timer.active {
  display: flex;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

#communication-timer .timer-text {
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}