/* Importing Google Fonts - Inter */
@import url('https://fonts.googleapis.com/css2?family=Inter:opsz,wght@14..32,100..900&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Inter", sans-serif;
}

body {
  width: 100%;
  min-height: 100vh;
  background: white;
  transition: background 0.3s ease;
}

body[data-theme="dark"] {
  background: linear-gradient(#1E1E2F, #2D2D44);
}

.chatbot-popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: white;
  border-radius: 0;
  overflow: hidden;
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
  transition: background 0.3s ease;
}

body[data-theme="dark"] .chatbot-popup {
  background: #2D2D44;
}

.chat-header {
  display: flex;
  align-items: center;
  padding: 12px 15px;
  background: #5350C4;
  justify-content: space-between;
}

.chat-header .header-info {
  display: flex;
  gap: 10px;
  align-items: center;
}

.header-info .chatbot-logo {
  width: 35px;
  height: 35px;
  padding: 6px;
  fill: #5350C4;
  flex-shrink: 0;
  background: #fff;
  border-radius: 50%;
}

.header-info .logo-text {
  color: #fff;
  font-weight: 600;
  font-size: 1.31rem;
  letter-spacing: 0.02rem;
}

.header-controls {
  display: flex;
  gap: 10px;
  position: relative;
}

.header-controls button {
  border: none;
  color: #fff;
  height: 40px;
  width: 40px;
  font-size: 1.9rem;
  cursor: pointer;
  border-radius: 50%;
  background: none;
  transition: 0.2s ease;
}

.header-controls #theme-switcher {
  font-size: 1.5rem;
}

.header-controls button:hover {
  background: #3d39ac;
}

.menu-dropdown {
  position: absolute;
  top: 50px;
  right: 10px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  display: none;
  flex-direction: column;
  width: 180px;
  padding: 10px 0;
  border: 1px solid #e0e0e0;
  overflow: hidden;
}

body[data-theme="dark"] .menu-dropdown {
  background: #3E3E5A;
  border: 1px solid #6F6BC2;
}

.menu-dropdown a {
  padding: 12px 20px;
  text-decoration: none;
  color: #333;
  font-size: 0.95rem;
  font-weight: 500;
  transition: background 0.3s ease, color 0.3s ease;
}

body[data-theme="dark"] .menu-dropdown a {
  color: #fff;
}

.menu-dropdown a:hover {
  background: #5350C4;
  color: #fff;
}

body[data-theme="dark"] .menu-dropdown a:hover {
  background: #6F6BC2;
}

.menu-dropdown.show {
  display: flex;
}

.chat-body {
  padding: 25px 15px;
  gap: 20px;
  display: flex;
  height: calc(100% - 135px);
  overflow-y: auto;
  flex-direction: column;
  scrollbar-width: thin;
  scrollbar-color: #ccccf5 transparent;
  background: white;
  transition: background 0.3s ease;
}

body[data-theme="dark"] .chat-body {
  background: #2D2D44;
  scrollbar-color: #6F6BC2 transparent;
}

.chat-body .message {
  display: flex;
  gap: 11px;
  align-items: center;
}

.chat-body .message .bot-avatar {
  width: 35px;
  height: 35px;
  padding: 6px;
  fill: #fff;
  flex-shrink: 0;
  margin-bottom: 2px;
  align-self: flex-end;
  border-radius: 50%;
  background: #5350C4;
}

.chat-body .message .message-text {
  padding: 12px 16px;
  max-width: 75%;
  font-size: 0.95rem;
  background: #F2F2FF;
  border-radius: 13px 13px 13px 3px;
  transition: background 0.3s ease, color 0.3s ease;
}

body[data-theme="dark"] .chat-body .message .message-text {
  background: #3E3E5A;
  color: #fff;
}

.chat-body .bot-message.thinking .message-text {
  padding: 2px 16px;
}

.chat-body .user-message {
  flex-direction: column;
  align-items: flex-end;
}

.chat-body .user-message .message-text {
  color: #fff;
  background: #5350C4;
  border-radius: 13px 13px 3px 13px;
}

.chat-body .user-message .attachment {
  width: 50%;
  margin-top: -7px;
  border-radius: 13px 3px 13px 13px;
}

.chat-body .bot-message .thinking-indicator {
  display: flex;
  gap: 4px;
  padding-block: 15px;
}

.chat-body .bot-message .thinking-indicator .dot {
  height: 7px;
  width: 7px;
  opacity: 0.7;
  border-radius: 50%;
  background: #6F6BC2;
  animation: dotPulse 1.8s ease-in-out infinite;
}

.chat-body .bot-message .thinking-indicator .dot:nth-child(1) {
  animation-delay: 0.2s;
}

.chat-body .bot-message .thinking-indicator .dot:nth-child(2) {
  animation-delay: 0.3s;
}

.chat-body .bot-message .thinking-indicator .dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes dotPulse {
  
  0%,
  100% {
    transform: scale(1);
    opacity: 0.7;
  }
  
  50% {
    transform: scale(1.5);
    opacity: 1;
  }
}

/* Code Block Styles */
.code-block {
  position: relative;
  margin: 10px 0;
  background: #f5f5f5;
  border-radius: 8px;
  padding: 10px;
  border: 1px solid #ddd;
  max-width: 100%;
  overflow-x: auto;
}

body[data-theme="dark"] .code-block {
  background: #1E1E2F;
  border: 1px solid #6F6BC2;
}

.code-block pre {
  margin: 0;
}

.code-block code {
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.9rem;
  color: #333;
  white-space: pre-wrap;
  word-wrap: break-word;
}

body[data-theme="dark"] .code-block code {
  color: #fff;
}

.code-block .copy-code-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: #5350C4;
  color: #fff;
  border: none;
  border-radius: 5px;
  padding: 5px;
  cursor: pointer;
  font-size: 1rem;
  transition: background 0.2s ease;
}

.code-block .copy-code-btn:hover {
  background: #3d39ac;
}

/* Floating Buttons Styles */
.floating-buttons {
  position: fixed;
  bottom: 80px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 1000;
}

.floating-btn {
  background: #5350C4;
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease, opacity 0.3s ease;
  font-size: 1.2rem;
}

.floating-btn:hover {
  background: #3d39ac;
  transform: scale(1.1);
}

.floating-btn.hidden {
  opacity: 0;
  transform: translateX(60px);
}

.chat-footer {
  position: absolute;
  bottom: 0;
  width: 100%;
  background: #fff;
  padding: 10px 15px 15px;
  transition: background 0.3s ease;
}

body[data-theme="dark"] .chat-footer {
  background: #2D2D44;
}

.chat-footer .chat-form {
  display: flex;
  align-items: center;
  position: relative;
  background: #fff;
  border-radius: 32px;
  outline: 1px solid #CCCCE5;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.06);
  transition: background 0.3s ease, outline 0.3s ease;
}

body[data-theme="dark"] .chat-footer .chat-form {
  background: #3E3E5A;
  outline: 1px solid #6F6BC2;
}

.chat-form:focus-within {
  outline: 2px solid #5350C4;
}

.chat-form .message-input {
  width: 100%;
  height: 47px;
  outline: none;
  resize: none;
  border: none;
  max-height: 180px;
  scrollbar-width: thin;
  border-radius: inherit;
  font-size: 0.95rem;
  padding: 14px 0 12px 18px;
  scrollbar-color: transparent transparent;
  background: transparent;
  transition: color 0.3s ease;
}

body[data-theme="dark"] .chat-form .message-input {
  color: #fff;
}

.chat-form .chat-controls {
  gap: 3px;
  height: 47px;
  display: flex;
  padding-right: 6px;
  align-items: center;
  align-self: flex-end;
}

.chat-form .chat-controls button {
  height: 35px;
  width: 35px;
  border: none;
  cursor: pointer;
  color: #706DB0;
  border-radius: 50%;
  font-size: 1.15rem;
  background: none;
  transition: 0.2s ease;
}

body[data-theme="dark"] .chat-form .chat-controls button {
  color: #fff;
}

.chat-form .chat-controls button:hover,
body.show-emoji-picker .chat-controls #emoji-picker {
  color: #3d39ac;
  background: #f1f1ff;
}

body[data-theme="dark"] .chat-form .chat-controls button:hover,
body[data-theme="dark"].show-emoji-picker .chat-controls #emoji-picker {
  color: #fff;
  background: #5350C4;
}

.chat-form .chat-controls #send-message {
  color: #fff;
  display: none;
  background: #5350C4;
}

.chat-form .chat-controls #send-message:hover {
  background: #3d39ac;
}

.chat-form .message-input:valid~.chat-controls #send-message {
  display: block;
}

.chat-form .file-upload-wrapper {
  position: relative;
  height: 35px;
  width: 35px;
}

.chat-form .file-upload-wrapper :where(button, img) {
  position: absolute;
}

.chat-form .file-upload-wrapper img {
  height: 100%;
  width: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.chat-form .file-upload-wrapper #file-cancel {
  color: #ff0000;
  background: #fff;
}

body[data-theme="dark"] .chat-form .file-upload-wrapper #file-cancel {
  background: #3E3E5A;
}

.chat-form .file-upload-wrapper :where(img, #file-cancel),
.chat-form .file-upload-wrapper.file-uploaded #file-upload {
  display: none;
}

.chat-form .file-upload-wrapper.file-uploaded img,
.chat-form .file-upload-wrapper.file-uploaded:hover #file-cancel {
  display: block;
}

.file-upload-wrapper.uploading {
  opacity: 0.7;
  pointer-events: none;
}

.message-actions {
  display: none;
  gap: 5px;
  margin-left: 10px;
}

.message:hover .message-actions {
  display: flex;
}

.message-actions button {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.2rem;
  color: #706DB0;
  padding: 5px;
  transition: color 0.2s ease;
}

body[data-theme="dark"] .message-actions button {
  color: #fff;
}

.message-actions button:hover {
  color: #5350C4;
}

.edit-input {
  width: 100%;
  padding: 8px;
  border: 1px solid #5350C4;
  border-radius: 8px;
  font-size: 0.95rem;
  background: transparent;
  resize: none;
  overflow: hidden;
}

body[data-theme="dark"] .edit-input {
  color: #fff;
  border-color: #6F6BC2;
}

em-emoji-picker {
  position: absolute;
  left: 50%;
  top: -337px;
  width: 100%;
  max-width: 350px;
  visibility: hidden;
  max-height: 330px;
  transform: translateX(-50%);
}

body.show-emoji-picker em-emoji-picker {
  visibility: visible;
}