/* =========  色票 ========= */
:root {
  --aisi-primary: #5f849b;
  --aisi-secondary: #f2b263;
  --aisi-bg: #f8fafc;
  --aisi-border: #e0e6ed;
}

/* ===== sidebar ===== */
#sidebar {
  width: 250px;
  height: 100vh; /* Fixed height to match viewport */
  background: #fff;
}
#sidebar .list-group-item {
  cursor: pointer;
  border: none;
}
#sidebar .list-group-item.active,
#sidebar .list-group-item:hover {
  background: var(--aisi-secondary);
  color: #fff;
}

/* ===== folder / record ===== */
.accordion-button {
  background: var(--aisi-bg);
  font-weight: 500;
}
.record-item {
  cursor: pointer;
  padding: 0.4rem 0.75rem;
  border-bottom: 1px solid var(--aisi-border);
}
.record-item:hover,
.record-item.active {
  background: var(--aisi-bg);
}
.record-badge {
  font-size: 0.75rem;
}

/* ⇢ 資料夾操作按鈕 */
.delete-folder {
  font-size: 0.9rem;
  color: #dc3545;
}
.delete-folder:hover {
  color: #a71d2a;
}

/* ===== chat bubble ===== */
.chat-bubble {
  max-width: 640px;
  white-space: pre-wrap;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  margin-bottom: 1rem;
}
.chat-bubble.user {
  background: #8ab6c9;
  color: #000;
  margin-left: auto;
}
.chat-bubble.assistant {
  background: #fff;
  border: 1px solid var(--aisi-border);
}
.waiting-dot {
  animation: blink 1s infinite;
}
@keyframes blink {
  0% {
    opacity: 0.2;
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 0.2;
  }
}

.chat-bubble.user img.uploaded-thumbnail {
  max-width: 200px;
  height: auto; /* Maintain aspect ratio */
  display: block;
  margin-top: 8px; /* Optional spacing */
  border-radius: 6px; /* Optional rounded corners */
  border: 1px solid #eee; /* Optional subtle border */
}

/* ===== input 自動伸縮 ===== */
#chatInput {
  resize: none;
  overflow: hidden;
}

/* 讓 MathLive 的虛擬鍵盤層級高於 Bootstrap Modal */
.mathlive-content .ML__keyboard,
.modal-open .ML__keyboard {
  z-index: 20000 !important;
}

/* ===== modeSelect & moveFolderSelect ===== 1*/
#modeSelect,
#moveFolderSelect {
  text-align: center;
  text-align-last: center;
}

/* ===== Auto-close Notification (Toast) ===== */
.aisi-toast-notification {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 20px;
  border-radius: 5px;
  color: #fff;
  font-size: 0.9rem;
  z-index: 10000; /* Ensure it's above other elements */
  opacity: 0;
  transition: opacity 0.5s ease-in-out, top 0.5s ease-in-out;
  min-width: 250px; /* Minimum width */
  max-width: 90%; /* Responsive max width */
  text-align: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.aisi-toast-notification.show {
  opacity: 1;
  top: 50px; /* Animate to this position */
}

.aisi-toast-notification.success {
  background-color: var(
    --aisi-primary
  ); /* Or #28a745 for a typical success green */
}

.aisi-toast-notification.error {
  background-color: #dc3545; /* Bootstrap danger red */
}

/* Responsive adjustments for smaller screens */
@media (max-width: 576px) {
  .aisi-toast-notification {
    width: 90%;
    left: 5%;
    transform: translateX(0);
    top: 10px;
  }
  .aisi-toast-notification.show {
    top: 20px;
  }
}
