/* ============================================
   CHAT SIDEBAR
   ============================================ */

.chat-sidebar {
  width: var(--chat-width, 340px);
  flex-shrink: 0;
  background-color: rgba(20, 20, 34, 0.96);
  border-left: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.06));
  display: flex;
  flex-direction: column;
  height: calc(100dvh - var(--navbar-height, 64px));
  max-height: 100%;
  box-shadow: none;
  overflow: visible; /* Changed from hidden to allow button outside */
  backdrop-filter: blur(16px);
  position: relative; /* For absolute positioned hide button */
  z-index: 100; /* Ensure chat sidebar and buttons stay above main layout content */
}

/* Chat Hide/Show Button - Must stay visible above content */
.chat-hide-edge-btn {
  position: absolute !important; /* relative to .chat-sidebar */
  left: -28px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 48px;
  background: var(--chat-bg);
  border: 1px solid var(--border-color);
  border-right: none;
  border-radius: 8px 0 0 8px;
  color: var(--accent-color);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000 !important; /* Much higher than main-layout (z-index: 1), stays visible */
  transition: all 0.3s ease;
  box-shadow: -2px 0 8px rgba(0, 0, 0, 0.3);
}

.chat-hide-edge-btn:hover {
  background: var(--accent-color);
  color: var(--primary-dark);
  border-color: var(--accent-color);
}

.chat-sidebar.hidden ~ .chat-hide-edge-btn,
.chat-sidebar[hidden] ~ .chat-hide-edge-btn {
  left: 0;
  border-radius: 0 8px 8px 0;
  border-left: 1px solid var(--border-color);
  border-right: none;
}

.chat-hide-edge-btn i {
  transition: transform 0.3s ease;
}

.chat-sidebar.hidden ~ .chat-hide-edge-btn i,
.chat-sidebar[hidden] ~ .chat-hide-edge-btn i {
  transform: rotate(180deg);
}

.chat-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden; /* Keep overflow hidden for container content */
  position: relative;
  width: 100%;
  height: 100%;
}

.chat-container iframe,
.chat-container>script {
  width: 100% !important;
  height: 100% !important;
  border: none;
}

