/* ========== CHAT WIDGET STYLES ========== */
/* Centralized chat styles for consistent appearance across all pages */

/* Subtle Professional Chat Button */
.chat-button {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 80px;
  height: 80px;
  background: radial-gradient(circle at 30% 30%, rgba(242, 245, 250, 0.2), var(--brand-blue), var(--bg-hero));
  border: 2px solid var(--brand-blue);
  border-radius: 50%;
  cursor: pointer;
  z-index: 9999;
  box-shadow:
    0 4px 12px rgba(74, 144, 226, 0.25),
    0 2px 6px rgba(22, 119, 255, 0.2),
    inset 0 0 15px rgba(242, 245, 250, 0.05);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  animation: orb-pulse 6s ease-in-out infinite, orb-float 8s ease-in-out infinite;
}

.chat-button:hover {
  transform: scale(1.05);
  box-shadow:
    0 6px 18px rgba(22, 119, 255, 0.4),
    0 3px 9px rgba(22, 119, 255, 0.3),
    inset 0 0 20px rgba(242, 245, 250, 0.1);
  animation: orb-pulse 4s ease-in-out infinite, orb-float 6s ease-in-out infinite;
}

.chat-button .crystal-ball-icon {
  width: 50px;
  height: 50px;
  filter: drop-shadow(0 2px 4px rgba(242, 245, 250, 0.4));
  animation: crystal-glow 5s ease-in-out infinite;
}

/* Subtle professional animations */
@keyframes orb-pulse {
  0%, 100% {
    box-shadow:
      0 4px 12px rgba(22, 119, 255, 0.3),
      0 2px 6px rgba(22, 119, 255, 0.2),
      inset 0 0 15px rgba(242, 245, 250, 0.05);
  }
  50% {
    box-shadow:
      0 6px 16px rgba(22, 119, 255, 0.4),
      0 3px 8px rgba(22, 119, 255, 0.3),
      inset 0 0 18px rgba(242, 245, 250, 0.08);
  }
}

@keyframes orb-float {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-4px);
  }
}

@keyframes crystal-glow {
  0%, 100% {
    filter: drop-shadow(0 2px 4px rgba(242, 245, 250, 0.4));
  }
  50% {
    filter: drop-shadow(0 2px 8px rgba(22, 119, 255, 0.5)) drop-shadow(0 0 12px rgba(22, 119, 255, 0.3));
  }
}

/* Turnstile verification styling - Professional Theme */
.turnstile-container {
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
  padding: 12px;
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-primary);
  transition: all 0.3s ease;
}

.turnstile-container.verified {
  background: rgba(22, 197, 74, 0.1);
  border-color: var(--success);
  animation: fadeOut 0.5s ease-in-out 2s forwards;
}

.turnstile-container.hidden {
  display: none;
}

/* Chat-specific Turnstile styling */
.chat-turnstile-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 12px;
  padding: 16px;
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-primary);
  transition: all 0.3s ease;
  min-height: 80px;
}

.chat-turnstile-wrapper.verified {
  background: rgba(22, 197, 74, 0.1);
  border-color: var(--success);
  animation: fadeOut 0.5s ease-in-out 2s forwards;
}

.chat-turnstile-wrapper iframe {
  border-radius: var(--radius-sm);
}

.chat-turnstile-wrapper .loading-message {
  color: var(--text-muted);
  font-size: 14px;
  text-align: center;
}

@keyframes fadeOut {
  0% {
    opacity: 1;
    transform: translateY(0);
    max-height: 100px;
  }
  100% {
    opacity: 0;
    transform: translateY(-20px);
    max-height: 0;
    margin-bottom: 0;
    padding: 0;
  }
}

/* Modern Chat Widget Styling */
#chat-widget {
  background: var(--bg-surface) !important;
  border: 1px solid var(--border-primary) !important;
  box-shadow:
    0 20px 25px -5px rgba(0, 0, 0, 0.3),
    0 10px 10px -5px rgba(0, 0, 0, 0.2) !important;
  border-radius: 16px !important;
  overflow: hidden !important;
  backdrop-filter: blur(10px) !important;
}

/* Modern Header with Logo */
#chat-widget .chat-header {
  background: linear-gradient(135deg, var(--brand-blue-dark) 0%, var(--brand-blue) 100%) !important;
  color: var(--text-primary) !important;
  border-bottom: none !important;
  padding: 16px 20px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  position: relative !important;
  overflow: hidden !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15) !important;
}

/* Header gradient overlay */
#chat-widget .chat-header::before {
  content: '' !important;
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  background: linear-gradient(45deg, rgba(255,255,255,0.08) 0%, transparent 50%, rgba(255,255,255,0.03) 100%) !important;
  pointer-events: none !important;
}

.chat-header-content {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  z-index: 1 !important;
  position: relative !important;
}

.arosoft-logo {
  width: 36px !important;
  height: 36px !important;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.2)) !important;
  opacity: 1 !important;
  border-radius: 6px !important;
}

.header-text {
  display: flex !important;
  flex-direction: column !important;
  gap: 2px !important;
}

.chat-title {
  font-size: 16px !important;
  font-weight: 700 !important;
  color: white !important;
  line-height: 1.2 !important;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3) !important;
}

.chat-subtitle {
  font-size: 12px !important;
  color: rgba(255, 255, 255, 0.95) !important;
  font-weight: 500 !important;
  text-shadow: 0 1px 1px rgba(0,0,0,0.2) !important;
}

/* Modern Close Button */
.chat-close-btn {
  background: rgba(255, 255, 255, 0.1) !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  border-radius: 8px !important;
  width: 32px !important;
  height: 32px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  color: white !important;
  z-index: 1 !important;
  position: relative !important;
}

.chat-close-btn:hover {
  background: rgba(255, 255, 255, 0.2) !important;
  transform: scale(1.05) !important;
}

/* Modern Messages Area */
#chat-widget .chat-messages {
  background: linear-gradient(180deg, var(--bg-hero) 0%, rgba(15, 23, 32, 0.95) 100%) !important;
  padding: 20px !important;
  max-height: 350px !important;
  overflow-y: auto !important;
  position: relative !important;
}

/* Custom Scrollbar */
#chat-widget .chat-messages::-webkit-scrollbar {
  width: 4px !important;
}

#chat-widget .chat-messages::-webkit-scrollbar-track {
  background: transparent !important;
}

#chat-widget .chat-messages::-webkit-scrollbar-thumb {
  background: rgba(22, 119, 255, 0.3) !important;
  border-radius: 2px !important;
}

#chat-widget .chat-messages::-webkit-scrollbar-thumb:hover {
  background: rgba(22, 119, 255, 0.5) !important;
}

/* Modern Message Layout */
#chat-widget .message {
  margin-bottom: 16px !important;
  display: flex !important;
  align-items: flex-start !important;
  gap: 10px !important;
  animation: messageSlideIn 0.3s ease-out !important;
}

#chat-widget .message.user-message {
  flex-direction: row-reverse !important;
}

/* Message Avatars */
.message-avatar {
  width: 28px !important;
  height: 28px !important;
  border-radius: 50% !important;
  background: rgba(22, 119, 255, 0.1) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
  margin-top: 2px !important;
}

.bot-avatar {
  width: 16px !important;
  height: 16px !important;
  filter: drop-shadow(0 0 4px rgba(22, 119, 255, 0.5)) !important;
}

/* Modern Message Bubbles */
#chat-widget .message.bot-message .message-content {
  background: var(--bg-surface) !important;
  color: var(--text-primary) !important;
  border: 1px solid var(--border-subtle) !important;
  padding: 14px 18px !important;
  border-radius: 18px 18px 18px 6px !important;
  max-width: 280px !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
  position: relative !important;
}

#chat-widget .message.user-message .message-content {
  background: linear-gradient(135deg, var(--brand-blue) 0%, var(--brand-blue-hover) 100%) !important;
  color: white !important;
  padding: 14px 18px !important;
  border-radius: 18px 18px 6px 18px !important;
  max-width: 280px !important;
  box-shadow: 0 2px 8px rgba(74, 144, 226, 0.15) !important;
  position: relative !important;
}

/* Message Animation */
@keyframes messageSlideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Quick Reply Buttons */
.quick-replies {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
  margin: 16px 0 !important;
  padding: 0 38px !important; /* Align with message content */
  animation: quickRepliesSlideIn 0.5s ease-out 0.3s both !important;
}

.quick-reply-btn {
  background: rgba(74, 144, 226, 0.08) !important;
  border: 1px solid rgba(74, 144, 226, 0.15) !important;
  color: var(--brand-blue) !important;
  padding: 8px 12px !important;
  border-radius: 20px !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  white-space: nowrap !important;
  backdrop-filter: blur(10px) !important;
}

.quick-reply-btn:hover {
  background: rgba(22, 119, 255, 0.15) !important;
  border-color: rgba(22, 119, 255, 0.4) !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 12px rgba(22, 119, 255, 0.2) !important;
}

.quick-reply-btn:active {
  transform: translateY(0) !important;
  box-shadow: 0 2px 6px rgba(22, 119, 255, 0.2) !important;
}

.quick-reply-icon {
  font-size: 14px !important;
  opacity: 0.8 !important;
}

/* Quick Replies Animation */
@keyframes quickRepliesSlideIn {
  from {
    opacity: 0;
    transform: translateY(15px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

/* Modern Input Area */
#chat-widget .chat-input-area {
  padding: 20px !important;
  background: var(--bg-surface) !important;
  border-top: 1px solid var(--border-subtle) !important;
  display: flex !important;
  gap: 12px !important;
  align-items: flex-end !important;
  position: relative !important;
}

/* Input Container */
.input-container {
  flex: 1 !important;
  position: relative !important;
}

/* Question Counter */
.question-counter {
  position: absolute !important;
  top: -24px !important;
  right: 8px !important;
  font-size: 11px !important;
  color: var(--text-muted) !important;
  background: rgba(22, 119, 255, 0.1) !important;
  padding: 2px 8px !important;
  border-radius: 10px !important;
  border: 1px solid rgba(22, 119, 255, 0.2) !important;
  backdrop-filter: blur(10px) !important;
  transition: all 0.2s ease !important;
}

.question-counter.warning {
  background: rgba(255, 165, 0, 0.1) !important;
  border-color: rgba(255, 165, 0, 0.3) !important;
  color: #FFA500 !important;
}

.question-counter.limit-reached {
  background: rgba(255, 69, 58, 0.1) !important;
  border-color: rgba(255, 69, 58, 0.3) !important;
  color: #FF453A !important;
}

/* Floating Input Design */
#chat-widget #chat-input {
  background: var(--bg-hero) !important;
  color: var(--text-primary) !important;
  border: 2px solid var(--border-primary) !important;
  padding: 14px 18px !important;
  border-radius: 24px !important;
  width: 100% !important;
  font-size: 14px !important;
  resize: none !important;
  min-height: 20px !important;
  max-height: 100px !important;
  transition: all 0.2s ease !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
}

#chat-widget #chat-input:focus {
  border-color: var(--brand-blue) !important;
  box-shadow:
    0 0 0 3px rgba(74, 144, 226, 0.08),
    0 4px 12px rgba(0, 0, 0, 0.15) !important;
  outline: none !important;
  transform: translateY(-1px) !important;
}

#chat-widget #chat-input::placeholder {
  color: var(--text-muted) !important;
}

/* Modern Send Button */
#chat-widget #chat-send-btn {
  background: linear-gradient(135deg, var(--brand-blue) 0%, var(--brand-blue-hover) 100%) !important;
  color: white !important;
  border: none !important;
  padding: 12px !important;
  border-radius: 50% !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 44px !important;
  height: 44px !important;
  box-shadow: 0 4px 12px rgba(22, 119, 255, 0.3) !important;
  position: relative !important;
  overflow: hidden !important;
}

#chat-widget #chat-send-btn::before {
  content: '' !important;
  position: absolute !important;
  top: 0 !important;
  left: -100% !important;
  width: 100% !important;
  height: 100% !important;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent) !important;
  transition: left 0.5s ease !important;
}

#chat-widget #chat-send-btn:hover:not(:disabled) {
  transform: translateY(-2px) scale(1.05) !important;
  box-shadow: 0 6px 20px rgba(22, 119, 255, 0.4) !important;
}

#chat-widget #chat-send-btn:hover:not(:disabled)::before {
  left: 100% !important;
}

#chat-widget #chat-send-btn:active:not(:disabled) {
  transform: translateY(-1px) scale(1.02) !important;
}

#chat-widget #chat-send-btn:disabled {
  background: var(--text-muted) !important;
  opacity: 0.5 !important;
  cursor: not-allowed !important;
  transform: none !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1) !important;
}

#chat-widget #chat-send-btn img {
  width: 18px !important;
  height: 18px !important;
  filter: brightness(0) invert(1) !important;
  z-index: 1 !important;
  position: relative !important;
}

/* Typing indicator */
.typing-dots {
  display: flex !important;
  gap: 4px !important;
  align-items: center !important;
}

.typing-dots span {
  width: 6px !important;
  height: 6px !important;
  background: var(--text-muted) !important;
  border-radius: 50% !important;
  animation: typing-bounce 1.4s infinite ease-in-out !important;
}

.typing-dots span:nth-child(1) { animation-delay: -0.32s !important; }
.typing-dots span:nth-child(2) { animation-delay: -0.16s !important; }
.typing-dots span:nth-child(3) { animation-delay: 0s !important; }

@keyframes typing-bounce {
  0%, 80%, 100% {
    transform: scale(0.8);
    opacity: 0.5;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Error message styling */
#chat-widget .message.error-message .message-content {
  background: rgba(239, 68, 68, 0.1) !important;
  border: 1px solid var(--danger) !important;
  color: var(--danger) !important;
  align-self: center !important;
  max-width: 90% !important;
  text-align: center !important;
  animation: errorPulse 0.5s ease-in-out !important;
}

#chat-widget .error-content i {
  margin-right: 8px !important;
}

@keyframes errorPulse {
  0% {
    transform: scale(0.95);
    opacity: 0.8;
  }
  50% {
    transform: scale(1.02);
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Subtle professional theme particles */
#chat-widget .chat-particle {
  background: var(--brand-blue) !important;
  box-shadow: 0 0 4px 1px rgba(74, 144, 226, 0.2) !important;
  opacity: 0.6 !important;
}

#chat-widget .chat-particle:nth-child(2) {
  box-shadow: 0 0 4px 1px rgba(15, 106, 230, 0.3) !important;
  opacity: 0.5 !important;
}

#chat-widget .chat-particle:nth-child(3) {
  background: rgba(242, 245, 250, 0.6) !important;
  box-shadow: 0 0 4px 1px rgba(242, 245, 250, 0.2) !important;
  opacity: 0.4 !important;
}

/* Hide some particles for cleaner look */
#chat-widget .chat-particle:nth-child(4),
#chat-widget .chat-particle:nth-child(5) {
  display: none !important;
}

/* Subtle button particles */
.chat-button .chat-particle {
  opacity: 0.4 !important;
  animation-duration: 8s !important; /* Slower animation */
}

.chat-button .chat-particle:nth-child(2) {
  opacity: 0.3 !important;
  animation-delay: 2s !important;
}

/* Powered by Innosol Footer */
#chat-widget .chat-footer {
  background: var(--bg-hero) !important;
  border-top: 1px solid var(--border-subtle) !important;
  padding: 8px 16px !important;
  border-radius: 0 0 var(--radius-xl) var(--radius-xl) !important;
}

.powered-by-innosol {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  opacity: 0.7 !important;
  transition: all 0.2s ease !important;
  text-decoration: none !important;
  cursor: pointer !important;
  padding: 4px 8px !important;
  border-radius: var(--radius-sm) !important;
}

.powered-by-innosol:hover {
  opacity: 1 !important;
  background: rgba(74, 144, 226, 0.08) !important;
  transform: translateY(-1px) !important;
}

.innosol-logo {
  width: 20px !important;
  height: 20px !important;
  filter: grayscale(100%) brightness(0.7) !important;
  transition: filter 0.3s ease !important;
}

.powered-by-innosol:hover .innosol-logo {
  filter: grayscale(0%) brightness(1) !important;
}

.powered-text {
  font-size: 12px !important;
  color: var(--text-muted) !important;
  font-weight: 500 !important;
  letter-spacing: 0.5px !important;
  transition: color 0.2s ease !important;
}

.powered-by-innosol:hover .powered-text {
  color: var(--text-secondary) !important;
}

