/* Fibonacci chat widget — scoped to .chat-widget only (no global * reset) */
.chat-widget,
.chat-widget * {
  box-sizing: border-box;
}

.chat-widget {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1000;
  font-family: "Manrope", sans-serif;
}

.chat-bubble {
  background-color: transparent;
  border-radius: 0;
  box-shadow: none;
  width: auto;
  height: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.chat-bubble:hover {
  transform: scale(1.1);
}

.chat-bubble img {
  display: block;
  width: 60px;
  height: 60px;
  object-fit: contain;
  border-radius: 50%;
  /* drop-shadow follows SVG alpha; reads better than box-shadow on vector img */
  filter: drop-shadow(0 4px 10px rgba(4, 34, 34, 0.22)) drop-shadow(0 2px 4px rgba(4, 34, 34, 0.12));
}

.dark .chat-bubble img {
  filter: drop-shadow(0 5px 14px rgba(0, 0, 0, 0.45)) drop-shadow(0 2px 6px rgba(0, 0, 0, 0.35));
}

.notification-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  background-color: #ff0000;
  color: #ffffff;
  font-size: 12px;
  font-weight: 600;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.chat-container {
  display: none;
  width: 400px;
  height: 600px;
  background-color: #0f2d26;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  flex-direction: column;
  overflow: hidden;
}

.chat-header {
  background-color: #0f2d26;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chat-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chat-logo {
  width: 32px;
  height: 32px;
  background-color: #29433c;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.chat-logo img {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.chat-title {
  color: #ffffff;
  font-weight: 600;
  font-size: 16px;
}

.chat-close {
  background: none;
  border: none;
  color: #ffffff;
  font-size: 20px;
  cursor: pointer;
  padding: 4px;
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.chat-close:hover {
  opacity: 1;
}

.chat-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.welcome-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  height: 100%;
}

.welcome-message {
  color: #ffffff;
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 30px;
}

.send-message-btn {
  background-color: #1ef9b4;
  color: #0f2d26;
  border: none;
  padding: 14px 28px;
  border-radius: 12px;
  font-family: "Manrope", sans-serif;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 30px;
}

.send-message-btn:hover {
  background-color: #30fcbc;
  transform: translateY(-1px);
}

.disclaimer {
  color: #ffffff;
  font-size: 12px;
  line-height: 1.5;
  opacity: 0.8;
  max-width: 300px;
}

.chat-screen {
  display: none;
  flex-direction: column;
  height: 100%;
  position: relative;
}

.chat-messages {
  position: absolute;
  top: 0;
  bottom: 60px;
  left: 0;
  right: 0;
  padding: 20px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

.chat-messages::-webkit-scrollbar {
  width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
  background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.3);
  border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
  background-color: rgba(255, 255, 255, 0.5);
}

.chat-input-container {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  background-color: rgba(255, 255, 255, 0.05);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 10px 16px;
  height: 60px;
}

.chat-input {
  flex: 1;
  background: transparent;
  border: none;
  color: #ffffff;
  font-family: "Manrope", sans-serif;
  font-size: 12px;
  padding: 12px 16px;
  outline: none;
}

.chat-input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.send-btn {
  background-color: #1ef9b4;
  color: #0f2d26;
  border: none;
  padding: 12px 20px;
  border-radius: 8px;
  font-family: "Manrope", sans-serif;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.send-btn:hover {
  background-color: #30fcbc;
}

.powered-by {
  position: absolute;
  bottom: 10px;
  right: 15px;
  color: rgba(255, 255, 255, 0.4);
  font-size: 11px;
}

.bot-message {
  background-color: rgba(255, 255, 255, 0.1);
  color: #ffffff !important;
  margin-bottom: 12px;
  padding: 12px;
  border-radius: 12px;
  max-width: 80%;
  word-wrap: break-word;
  line-height: 1.4;
}

.bot-message ol,
.bot-message ul {
  margin: 8px 0;
  padding-left: 20px;
  color: #ffffff !important;
}

.bot-message li {
  margin: 4px 0;
  color: #ffffff !important;
}

.bot-message strong {
  font-weight: 600;
  color: #ffffff !important;
}

.bot-message a {
  color: #1ef9b4 !important;
  text-decoration: underline;
}

.bot-message p {
  margin: 8px 0;
  color: #ffffff !important;
}

.bot-message p:first-child {
  margin-top: 0;
}

.bot-message p:last-child {
  margin-bottom: 0;
}

.bot-message * {
  color: inherit;
}

.bot-message br {
  color: #ffffff;
}

.bot-message em {
  color: #ffffff !important;
  font-style: italic;
}

.bot-message code {
  background-color: rgba(255, 255, 255, 0.1);
  color: #1ef9b4 !important;
  padding: 2px 4px;
  border-radius: 4px;
  font-family: monospace;
}

.user-message {
  background-color: #1ef9b4;
  color: #0f2d26;
  margin-left: auto;
  text-align: right;
  margin-bottom: 12px;
  padding: 12px;
  border-radius: 12px;
  max-width: 80%;
  word-wrap: break-word;
}

.loading-indicator {
  display: none;
  align-items: center;
  gap: 6px;
  padding: 12px;
  margin-bottom: 12px;
  max-width: 80%;
}

.dot {
  width: 8px;
  height: 8px;
  background-color: #1ef9b4;
  border-radius: 50%;
  animation: fib-chat-bounce 0.6s infinite alternate;
}

.dot:nth-child(2) {
  animation-delay: 0.2s;
}

.dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes fib-chat-bounce {
  to {
    transform: translateY(-6px);
  }
}

@media (max-width: 768px) {
  .chat-container {
    width: 350px;
    height: 500px;
  }
}

@media (max-width: 480px) {
  .chat-container {
    width: calc(100vw - 20px);
    height: 70vh;
    right: 10px;
    left: 10px;
  }
}
