.support-buddy-header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.support-buddy-header-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  border: none;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.support-buddy-header-close, .support-buddy-header-icon {
  padding: 0;
  margin: 0;
  svg {
    position: absolute;
  }
}

.support-buddy-header-icon:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

.support-buddy-widget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.support-buddy-container {
  width: 384px;
  margin-bottom: 16px;
  background: white;
  border-radius: 16px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.support-buddy-header {
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.support-buddy-header-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.support-buddy-messages {
  height: 384px;
  overflow-y: auto;
  padding: 16px;
  background-color: #f9fafb;
}

.support-buddy-message {
  margin-bottom: 12px;
  display: block;

  &.user {
    text-align: right;
  }

  .support-buddy-message-content {
    display: inline-block;
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 16px;
    word-wrap: break-word;
  }

  .support-buddy-message-content  {
      p {
        margin-top: 0;
        margin-bottom: 10px;

        &:last-child {
          margin-bottom: 0;
        }
      }
  }

  &.user .support-buddy-message-content {
    border-bottom-right-radius: 4px;
    text-align: left;
    color: #ffffff;
  }

  &.bot .support-buddy-message-content {
    background: white;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  }

  .support-buddy-message-timestamp {
    font-size: 0.75rem;
    color: #9ca3af;
    margin: 4px 8px;
    padding: 0 4px;
    display: inline-block;
  }

  &.user .support-buddy-message-timestamp {
    text-align: right;
    display: block;
  }

  &.bot .support-buddy-message-timestamp {
    text-align: left;
    display: block;
  }
}

.support-buddy-input {
  padding: 16px;
  background: white;
}

.support-buddy-input form {
  display: flex;
  gap: 8px;
}

.support-buddy-input input {
  flex: 1;
  padding: 12px 16px;
  border-radius: 12px;
  border: none;
  background: #f3f4f6;
  outline: none;
}

.support-buddy-input button {
  padding: 12px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
}

.support-buddy-input input:focus {
  outline: 2px solid var(--primary-color, #4F46E5);
  outline-offset: -2px;
}

.support-buddy-footer {
  padding: 12px;
  background: #f9fafb;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.support-buddy-toggle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.support-buddy-footer-icons {
  display: flex;
  gap: 8px;
}

.support-buddy-footer-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  border-radius: 50%;
  cursor: pointer;
  color: #6b7280;
  transition: all 0.2s ease;
}

.support-buddy-footer-icon:hover {
  background-color: #f3f4f6;
  color: #374151;
}

.support-buddy-footer-text {
  font-size: 0.7rem;
  color: #6b7280;
}

@media screen and (max-width: 450px) {

  .support-buddy-container {
    width: auto;
    height: auto;
    margin: 0;
    border-radius: 0;
    position: fixed;
    top: 8px;
    left: 8px;
    right: 8px;
    bottom: 8px;
  }

  .support-buddy-messages {
    height: calc(100vh - 210px);
    padding: 12px;
  }

  .support-buddy-input {
    position: fixed;
    bottom: 53px;
    left: 12px;
    right: 12px;
    width: auto;
    padding: 4px;
    background: transparent;
    box-shadow: 0 -2px 10px #0000000d;
  }

  .support-buddy-footer-text {
    padding: 8px 0;
  }

  .support-buddy-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
  }

  .support-buddy-footer {
    padding: 4px 12px;
    position: fixed;
    bottom: 8px;
    left: 8px;
    right: 8px;
  }
}

/* Suggested questions */
.support-buddy-suggested-questions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}

.support-buddy-suggested-question {
  padding: 12px 16px;
  border-radius: 12px;
  border: none;
  text-align: left;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.support-buddy-suggested-question:hover {
  opacity: 0.9;
}

/* Products carousel */
.support-buddy-products {
  margin-top: 8px;
  padding: 8px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.support-buddy-products-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.support-buddy-product-card {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
}

.support-buddy-product-image {
  height: 128px;
  width: 100%;
  object-fit: cover;
}

.support-buddy-product-info {
  padding: 8px;
}

/* Animation classes */
.support-buddy-fade-in {
  animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Loading indicator */
.support-buddy-typing {
  display: flex;
  gap: 4px;
  padding: 12px 16px;
  background: white;
  border-radius: 16px;
  border-bottom-left-radius: 4px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  width: fit-content;
}

.support-buddy-typing-dot {
  width: 8px;
  height: 8px;
  background: #d1d5db;
  border-radius: 50%;
  animation: typing 1.4s infinite both;
}

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

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

@keyframes typing {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-4px);
  }
}

/* Optimistic typing indicator */
.typing-indicator {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 8px 0;
}

.typing-indicator span {
  width: 6px;
  height: 6px;
  background: #9ca3af;
  border-radius: 50%;
  animation: typingPulse 1.4s infinite both;
}

.typing-indicator span:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typingPulse {
  0%, 100% {
    opacity: 0.4;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.2);
  }
}

.support-buddy-header-logo {
  max-width: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.support-buddy-header-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.support-buddy-header-icon img {
  border-radius: 50%;
  width: 100%;
  height: 100%;
  object-fit: cover;
  max-width: 32px;
  max-height: 32px;
}

.support-buddy-header-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  border-radius: 50%;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.support-buddy-header-close:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

/* Email link styling */
.chat-email-link {
  color: #1976d2;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: all 0.2s ease;
}

.chat-email-link:hover {
  color: #1565c0;
  border-bottom-color: #1565c0;
  text-decoration: none;
}

.chat-email-link:focus {
  outline: 2px solid #1976d2;
  outline-offset: 2px;
  border-radius: 2px;
}

