/* ── Chat page layout ────────────────────────────────────────── */
.chat-page-layout {
  display: flex;
  height: calc(100vh - 76px);
  overflow: hidden;
  margin: 0 -1.5rem;
}

.chat-main {
  min-width: 0;
}

.chat-messages {
  background: #f8f9fa;
}

/* ── Sidebar ─────────────────────────────────────────────────── */
.conv-list {
  overflow-y: auto;
}

.conv-item {
  cursor: pointer;
  border-bottom: 1px solid #f0f0f0;
  transition: background 0.1s;
}

.conv-item:hover {
  background: #f8f9fa;
}

.conv-item.active {
  background: #e8f0fe;
}

.conv-remove-btn {
  opacity: 0;
  font-size: 0.75rem;
  line-height: 1;
  color: #6c757d !important;
  text-decoration: none;
}

.conv-item:hover .conv-remove-btn {
  opacity: 1;
}

/* ── Desktop: offcanvas becomes static sidebar ───────────────── */
@media (min-width: 768px) {
  .chat-sidebar.offcanvas {
    position: static !important;
    transform: none !important;
    visibility: visible !important;
    width: 260px !important;
    height: 100%;
    border-right: 1px solid #dee2e6;
    z-index: auto;
  }
  .chat-sidebar.offcanvas .btn-close {
    display: none;
  }
  .chat-sidebar.offcanvas-start {
    top: auto;
    left: auto;
  }
}

/* ── Chat bubbles ────────────────────────────────────────────── */
.chat-bubble {
  display: inline-block;
  width: fit-content;
  padding: 0.6rem 1rem;
  border-radius: 1.1rem;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.5;
  font-size: 0.95rem;
}

.chat-bubble-user {
  background-color: #13294b;
  color: #fff;
  border-bottom-right-radius: 0.25rem;
}

.chat-bubble-assistant {
  background-color: #e9ecef;
  color: #212529;
  border-bottom-left-radius: 0.25rem;
}

/* ── Message metadata & info icon ────────────────────────────── */
.msg-meta {
  font-size: 0.72rem;
  color: #6c757d;
  margin-top: 2px;
}

.info-icon {
  cursor: pointer;
  opacity: 0.5;
  font-size: 0.8rem;
  user-select: none;
}

.info-icon:hover {
  opacity: 1;
}

/* ── Typing indicator ────────────────────────────────────────── */
@keyframes blink {
  0%, 80%, 100% { opacity: 0.2; }
  40%           { opacity: 1;   }
}

.typing-dot {
  font-size: 0.6rem;
  animation: blink 1.4s infinite;
}

/* ── Avatar ──────────────────────────────────────────────────── */
.avatar-wrapper {
  position: relative;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}

.avatar-img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
}

.avatar-initials {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: #13294b;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  user-select: none;
}

/* ── Progress bars ───────────────────────────────────────────── */
.progress-bar {
  background-color: #13294b;
}

/* ── Override Bootstrap primary color with il-blue ───────────── */
.btn-primary {
  background-color: #13294b;
  border-color: #13294b;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active,
.btn-primary.active {
  background-color: #0e1f38;
  border-color: #0e1f38;
}

.btn-primary:focus,
.btn-primary:active {
  box-shadow: 0 0 0 0.25rem rgba(19, 41, 75, 0.4);
}

/* ── Navbar ──────────────────────────────────────────────────── */
.navbar-illm {
  background-color: #e2e3e3;
}

.navbar-illm .navbar-brand,
.navbar-illm .nav-link,
.navbar-illm .nav-link.active {
  color: #13294b;
}

.navbar-illm .nav-link:hover,
.navbar-illm .nav-link:focus {
  color: #0e1f38;
}

.navbar-illm .navbar-toggler {
  border-color: #13294b;
}

.btn-logout {
  color: #13294b;
  border-color: #13294b;
  background: transparent;
}

.btn-logout:hover,
.btn-logout:focus {
  background-color: #13294b;
  color: #fff;
}

/* ── Login button ────────────────────────────────────────────── */
.btn-login {
  background-color: #13294b;
  border-color: #13294b;
  color: #fff;
}

.btn-login:hover,
.btn-login:focus {
  background-color: #0e1f38;
  border-color: #0e1f38;
  color: #fff;
}

/* ── Misc ────────────────────────────────────────────────────── */
.font-monospace {
  font-family: var(--bs-font-monospace);
}
