/* ========================================
   Support Chat Widget Styles
   ======================================== */

/* Chat toggle button */
.chat-widget-toggle {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--gradient-brand);
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0, 212, 255, 0.3);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.chat-widget-toggle:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 25px rgba(0, 212, 255, 0.4);
}

.chat-widget-toggle svg {
  width: 28px;
  height: 28px;
  fill: white;
  transition: transform 0.2s ease;
}

.chat-widget-toggle.active svg.icon-chat {
  display: none;
}

.chat-widget-toggle svg.icon-close {
  display: none;
}

.chat-widget-toggle.active svg.icon-close {
  display: block;
}

/* Chat container */
.chat-widget-container {
  position: fixed;
  bottom: 100px;
  right: 24px;
  width: 380px;
  max-width: calc(100vw - 48px);
  height: 520px;
  max-height: calc(100vh - 140px);
  background: #1a1a1d;
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  z-index: 9998;
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.95);
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
  overflow: hidden;
}

.chat-widget-container.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* Chat header */
.chat-widget-header {
  background: var(--gradient-brand);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.chat-widget-header-icon {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-widget-header-icon svg {
  width: 22px;
  height: 22px;
  fill: white;
}

.chat-widget-header-info h3 {
  color: white;
  font-size: 16px;
  font-weight: 600;
  margin: 0;
}

.chat-widget-header-info p {
  color: rgba(255, 255, 255, 0.8);
  font-size: 12px;
  margin: 2px 0 0;
}

/* Chat messages area */
.chat-widget-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #1a1a1d;
}

/* Individual message */
.chat-message {
  max-width: 85%;
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.5;
  animation: messageSlide 0.3s ease;
}

@keyframes messageSlide {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.chat-message.bot {
  background: #2a2a2f;
  color: #e5e5e5;
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.chat-message.user {
  background: var(--gradient-brand);
  color: white;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.chat-message.typing {
  display: flex;
  gap: 4px;
  padding: 16px;
}

.chat-message.typing span {
  width: 8px;
  height: 8px;
  background: #888888;
  border-radius: 50%;
  animation: typingBounce 1.4s ease-in-out infinite;
}

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

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

@keyframes typingBounce {
  0%, 60%, 100% {
    transform: translateY(0);
  }
  30% {
    transform: translateY(-6px);
  }
}

/* Chat input area */
.chat-widget-input {
  padding: 16px;
  border-top: 1px solid #3a3a40;
  background: #1a1a1d;
  display: flex;
  gap: 12px;
}

.chat-widget-input input {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid #3a3a40;
  border-radius: 24px;
  background: #2a2a2f;
  color: #e5e5e5;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s ease;
}

.chat-widget-input input:focus {
  border-color: #00d9ff;
}

.chat-widget-input input::placeholder {
  color: #888888;
}

.chat-widget-input button {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--gradient-brand);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.chat-widget-input button:hover:not(:disabled) {
  transform: scale(1.05);
}

.chat-widget-input button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.chat-widget-input button svg {
  width: 20px;
  height: 20px;
  fill: white;
}

/* Welcome message */
.chat-welcome {
  text-align: center;
  padding: 20px;
  color: #888888;
}

.chat-welcome h4 {
  color: #e5e5e5;
  margin-bottom: 8px;
}

.chat-welcome p {
  font-size: 13px;
  margin-bottom: 16px;
}

.chat-suggestions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chat-suggestion {
  padding: 10px 16px;
  background: #2a2a2f;
  border: 1px solid #3a3a40;
  border-radius: 20px;
  font-size: 13px;
  color: #e5e5e5;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.chat-suggestion:hover {
  border-color: #00d9ff;
  background: rgba(0, 212, 255, 0.1);
}

/* Mobile responsive */
@media (max-width: 480px) {
  .chat-widget-container {
    bottom: 0;
    right: 0;
    left: 0;
    width: 100%;
    max-width: 100%;
    height: calc(100vh - 80px);
    max-height: calc(100vh - 80px);
    border-radius: 16px 16px 0 0;
  }

  .chat-widget-toggle {
    bottom: 16px;
    right: 16px;
    width: 54px;
    height: 54px;
  }
}
