#chat-widget {
  position: fixed;
  top: 50%;
  right: 3%;
  transform: translateY(-50%) scale(0.95);
  width: 325px;
  height: 80vh;
  max-height: 720px;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
}

#chat-widget.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(-50%) scale(1);
}

.chat-header-widget {
  background: white;
  color: white;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-radius: 20px 20px 0 0;
}

.chat-title {
  font-size: 18px;
  font-weight: 600;
  color: #2f4f5f;
}

.chat-subtitle {
  font-size: 14px;
  font-weight: 500;
  color: #b4c7dc;
}

.chat-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #b4c7dc;
}

.chat-close {
  position: absolute;
  right: 5%;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  color: inherit;
  line-height: 0;
}

.chat-close:hover {
  background: #0f172a;
  border-radius: 5px;
}

.chat-close svg {
  display: block;
}

.chat-body {
  flex: 1;
  overflow-y: auto;
  background: #b9e0f2;
  padding: 16px;
  border-radius: 0 0 20px 20px;
}

.chat-body::-webkit-scrollbar {
  width: 8px;
}
.chat-body::-webkit-scrollbar-thumb {
  background: #a8c7e9;
  border-radius: 4px;
}

.chat-buttons {
  padding: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  background: transparent;
}

.chat-btn {
  background: transparent;
  border: 2px solid #64748b;
  color: #0f172a;

  padding: 12px 16px;
  border-radius: 16px;
  font-weight: 600;

  transition: all 0.2s ease;
}

.chat-btn:hover {
  border-color: #1e293b;
  background: #1e293b;
  color: white;
}

.chat-messages {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.msg-ai,
.msg-user {
  padding: 10px 12px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.45;
}

.msg-ai {
  align-self: flex-start;
  background: #0f172a;
  color: #f8fafc;
}

.msg-user {
  align-self: flex-end;
  background: transparent;
  border: 2px solid #64748b;
  color: #0f172a;
  font-weight: 600;
}

body.dark-mode .chat-header-widget {
  background: linear-gradient(135deg, #0b1324, #121c35);
  border-bottom: 1px solid #1f2a44;
}

body.dark-mode .chat-btn {
  background: transparent;
  color: #f5f7fa;
}

body.dark-mode .chat-btn:hover {
  background: #1d3f90;
}

body.dark-mode .chat-body {
  background: #091c44;
}

body.dark-mode .chat-title {
  color: #f5f7fa;
}

body.dark-mode .chat-subtitle {
  color: #919395;
}

body.dark-mode .chat-avatar {
  border: 2px solid #919395;
}

body.dark-mode .chat-close {
  color: #091c44;
}

body.dark-mode .chat-close:hover {
  background: #919395;
}
