/* LINE風チャットUIのカスタムスタイル */

/* チャットログのスクロールバー（LINE風） */
#log {
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.1) transparent;
  background: #f7f7f7;
}

#log::-webkit-scrollbar {
  width: 6px;
}

#log::-webkit-scrollbar-track {
  background: transparent;
}

#log::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 3px;
}

#log::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.3);
}

/* メッセージのアニメーション（LINE風のフェードイン） */
.msg {
  animation: fadeInUp 0.2s ease-out;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ローディングアニメーション（タイピングインジケーター） */
@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
    opacity: 0.4;
  }
  50% {
    transform: translateY(-4px);
    opacity: 1;
  }
}

.animate-bounce {
  animation: bounce 1.4s infinite;
}

/* メッセージバブルのホバー効果（デスクトップ用） */
@media (hover: hover) {
  .msg:hover .bg-blue-500,
  .msg:hover .bg-white {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  }
}

/* 入力フィールドのフォーカス効果 */
input:focus {
  outline: none;
}

/* ボタンのトランジション */
button {
  transition: all 0.2s ease;
}

button:not(:disabled):active {
  transform: scale(0.95);
}

/* レスポンシブ対応 */
@media (max-width: 640px) {
  /* モバイルでのメッセージバブルの最大幅を調整 */
  .msg .max-w-\[75\%\] {
    max-width: 85%;
  }
  
  /* ヘッダーのフォントサイズ調整 */
  header h1 {
    font-size: 1.125rem;
  }
  
  header p {
    font-size: 0.7rem;
  }
}

/* メッセージバブルのテキスト選択を改善 */
.msg div {
  word-wrap: break-word;
  word-break: break-word;
}

/* ソース情報のスタイル調整 */
.sources {
  font-size: 0.75rem;
  line-height: 1.4;
}

/* タイムスタンプのスタイル */
.msg .text-xs {
  user-select: none;
}
