/**
 * AI Chatbot Widget Styles
 * Modern, glassmorphic design with smooth animations
 */

/* Chatbot Toggle Button */
.chatbot-toggle {
  position: fixed;
  bottom: 110px;
  right: 30px;
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, var(--main-blue-1) 0%, var(--dark-cadet) 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(74, 122, 138, 0.5);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 100000;
  animation: bounceIn 0.6s ease;
}

.chatbot-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 12px 32px rgba(74, 122, 138, 0.7);
}

.chatbot-toggle.hidden {
  opacity: 0;
  transform: scale(0);
  pointer-events: none;
}

.chatbot-toggle-icon {
  color: white;
  font-size: 28px;
  animation: pulse 2s infinite;
}

.chatbot-pulse {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: rgba(74, 122, 138, 0.4);
  animation: pulse-ring 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Chatbot Container */
.chatbot-container {
  position: fixed;
  bottom: 110px;
  right: 30px;
  width: 400px;
  height: 600px;
  background: var(--main-dark);
  backdrop-filter: blur(20px);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: scale(0.8) translateY(20px);
  pointer-events: none;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 100001;
  overflow: hidden;
}

.chatbot-container.active {
  opacity: 1;
  transform: scale(1) translateY(0);
  pointer-events: all;
}

/* Chatbot Header */
.chatbot-header {
  background: var(--main-dark);
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 20px 20px 0 0;
  position: relative;
  overflow: hidden;
}

.chatbot-header::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg,
      transparent 30%,
      rgba(255, 255, 255, 0.1) 50%,
      transparent 70%);
  animation: shimmer 3s infinite;
}

.chatbot-header-content {
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  z-index: 1;
}

.chatbot-avatar {
  width: 45px;
  height: 45px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.3);
  animation: float 3s ease-in-out infinite;
}

.chatbot-header-text h4 {
  margin: 0;
  color: white;
  font-size: 18px;
  font-weight: 600;
}

.chatbot-status {
  display: flex;
  align-items: center;
  gap: 6px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 13px;
}

.status-dot {
  width: 8px;
  height: 8px;
  background: #2ed573;
  border-radius: 50%;
  animation: pulse 2s infinite, glow 2s ease-in-out infinite;
  box-shadow: 0 0 10px rgba(46, 213, 115, 0.5);
}

.chatbot-close {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  width: 35px;
  height: 35px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: white;
  font-size: 18px;
  transition: all 0.3s ease;
  position: relative;
  z-index: 1;
}

.chatbot-close:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: rotate(90deg);
}

/* Messages Container */
.chatbot-messages {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 15px;
  background: linear-gradient(135deg, var(--main-dark) 0%, var(--dark-cadet) 50%, var(--primary) 100%);
  background-size: 200% 200%;
  animation: gradientShift 8s ease infinite;
  position: relative;
}

/* Floating Bubbles Background */
.chatbot-messages::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image:
    radial-gradient(circle, rgba(109, 164, 185, 0.35) 5px, transparent 5px),
    radial-gradient(circle, rgba(95, 158, 160, 0.3) 8px, transparent 8px),
    radial-gradient(circle, rgba(109, 164, 185, 0.4) 12px, transparent 12px),
    radial-gradient(circle, rgba(95, 158, 160, 0.25) 6px, transparent 6px),
    radial-gradient(circle, rgba(109, 164, 185, 0.3) 10px, transparent 10px);
  background-size: 70px 70px, 110px 110px, 90px 90px, 50px 50px, 130px 130px;
  background-position: 0 0, 55px 55px, 25px 25px, 80px 10px, 40px 70px;
  animation: floatingBubbles 20s linear infinite;
  pointer-events: none;
  z-index: 0;
}

.chatbot-messages::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(circle at 15% 25%, rgba(109, 164, 185, 0.12) 0%, transparent 50%),
    radial-gradient(circle at 85% 75%, rgba(95, 158, 160, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(109, 164, 185, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 70% 30%, rgba(95, 158, 160, 0.09) 0%, transparent 50%);
  animation: floatingOrbs 15s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}

.chatbot-messages>* {
  position: relative;
  z-index: 1;
}

.chatbot-messages::-webkit-scrollbar {
  width: 6px;
}

.chatbot-messages::-webkit-scrollbar-track {
  background: var(--main-dark);
  border-radius: 10px;
}

.chatbot-messages::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 10px;
}

.chatbot-messages::-webkit-scrollbar-thumb:hover {
  background: var(--secondary);
}

/* Message Bubbles */
.chatbot-message {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  animation: messageSlideIn 0.3s ease;
}

.bot-message {
  align-self: flex-start;
}

.user-message {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.message-avatar {
  width: 35px;
  height: 35px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  animation: float 4s ease-in-out infinite;
  transition: transform 0.3s ease;
}

.message-avatar:hover {
  transform: scale(1.15) rotate(5deg);
}

.bot-message .message-avatar {
  background: linear-gradient(135deg, var(--main-blue-1) 0%, var(--dark-cadet) 100%);
  color: white;
}

.user-message .message-avatar {
  background: linear-gradient(135deg, var(--secondary) 0%, var(--primary) 100%);
  color: white;
}

.message-content {
  max-width: 70%;
  padding: 12px 16px;
  border-radius: 18px;
  position: relative;
  word-wrap: break-word;
  line-height: 1.5;
}

.bot-message .message-content {
  background: linear-gradient(135deg, var(--dark-cadet) 0%, var(--main-dark) 100%);
  background-size: 200% 200%;
  animation: gradientShift 10s ease infinite;
  border: 1px solid var(--main-blue-1);
  color: #fff;
  border-bottom-left-radius: 4px;
}

.user-message .message-content {
  background: linear-gradient(135deg, var(--main-blue-1) 0%, var(--dark-cadet) 100%);
  background-size: 200% 200%;
  animation: gradientShift 12s ease infinite;
  color: white;
  border-bottom-right-radius: 4px;
}

.message-time {
  font-size: 10px;
  opacity: 0.6;
  margin-top: 4px;
  display: block;
}

/* Typing Indicator */
.typing-indicator .message-content {
  padding: 16px 20px;
}

.typing-dots {
  display: flex;
  gap: 4px;
  align-items: center;
}

.typing-dots span {
  width: 8px;
  height: 8px;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 50%;
  animation: typingBounce 1.4s infinite;
}

.typing-dots span:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
  animation-delay: 0.4s;
}

/* Quick Replies */
.chatbot-quick-replies {
  padding: 20px 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  background: linear-gradient(135deg, var(--main-dark) 0%, var(--dark-cadet) 50%, var(--primary) 100%);
  background-size: 200% 200%;
  animation: gradientShift 8s ease infinite;
  position: relative;
  overflow: hidden;
}

.chatbot-quick-replies:empty {
  display: none !important;
  padding: 0 !important;
}

/* Floating Bubbles for Quick Replies - More visible */
.chatbot-quick-replies::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image:
    radial-gradient(circle, rgba(109, 164, 185, 0.35) 5px, transparent 5px),
    radial-gradient(circle, rgba(95, 158, 160, 0.3) 8px, transparent 8px),
    radial-gradient(circle, rgba(109, 164, 185, 0.4) 12px, transparent 12px),
    radial-gradient(circle, rgba(95, 158, 160, 0.25) 6px, transparent 6px),
    radial-gradient(circle, rgba(109, 164, 185, 0.3) 10px, transparent 10px);
  background-size: 70px 70px, 110px 110px, 90px 90px, 50px 50px, 130px 130px;
  background-position: 0 0, 55px 55px, 25px 25px, 80px 10px, 40px 70px;
  animation: floatingBubbles 20s linear infinite;
  pointer-events: none;
  z-index: 0;
}

.chatbot-quick-replies::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(circle at 15% 25%, rgba(109, 164, 185, 0.12) 0%, transparent 50%),
    radial-gradient(circle at 85% 75%, rgba(95, 158, 160, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(109, 164, 185, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 70% 30%, rgba(95, 158, 160, 0.09) 0%, transparent 50%);
  animation: floatingOrbs 15s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}

.chatbot-quick-replies>* {
  position: relative;
  z-index: 1;
}

.quick-reply-btn {
  background: linear-gradient(135deg, var(--dark-cadet) 0%, var(--main-dark) 100%);
  background-size: 200% 200%;
  border: 1px solid var(--secondary);
  color: #fff;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.quick-reply-btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(109, 164, 185, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.4s, height 0.4s;
}

.quick-reply-btn:hover::before {
  width: 200px;
  height: 200px;
}

.quick-reply-btn:hover {
  background: var(--dark-cadet);
  background-size: 100% 100%;
  border-color: var(--main-blue-1);
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 4px 12px rgba(109, 164, 185, 0.4);
}

/* Contact Form Styles */
.contact-form-wrapper {
  background: linear-gradient(135deg, var(--dark-cadet) 0%, var(--main-dark) 100%);
  border: 1px solid var(--primary);
  border-radius: 16px;
  padding: 25px;
  margin: 10px 0;
  box-shadow: 0 8px 24px rgba(109, 164, 185, 0.3);
  position: relative;
  z-index: 1;
}

.contact-form-header h4 {
  color: var(--primary);
  font-size: 1.5rem;
  margin-bottom: 10px;
  font-weight: 700;
}

.contact-form-header p {
  color: rgba(255, 255, 255, 0.8);
  font-size: 1.2rem;
  margin-bottom: 20px;
  line-height: 1.5;
}

.chatbot-contact-form .form-group {
  margin-bottom: 15px;
}

.chatbot-contact-form label {
  display: block;
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.chatbot-contact-form input {
  width: 100%;
  padding: 12px 15px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: white;
  font-size: 1.2rem;
  transition: all 0.3s ease;
}

.chatbot-contact-form input:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.15);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(109, 164, 185, 0.2);
}

.chatbot-contact-form input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.error-message {
  display: block;
  color: #ff6b6b;
  font-size: 0.85rem;
  margin-top: 5px;
  min-height: 18px;
}

.submit-btn {
  width: 100%;
  padding: 14px 20px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  border: none;
  border-radius: 8px;
  color: white;
  font-size: 1.2rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 10px;
}

.submit-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(109, 164, 185, 0.4);
}

.submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.contact-note {
  text-align: center;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.85rem;
  margin-top: 15px;
  margin-bottom: 0;
}

.contact-note strong {
  color: var(--primary);
  font-weight: 700;
}

/* Input Area */
.chatbot-input-wrapper {
  background: var(--dark-2);
  padding: 15px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.chatbot-input-container {
  display: flex;
  gap: 10px;
  align-items: center;
}

.chatbot-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 25px;
  padding: 12px 20px;
  color: white;
  font-size: 14px;
  outline: none;
  transition: all 0.3s ease;
}

.chatbot-input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.chatbot-input:focus {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(109, 164, 185, 0.15);
}

.chatbot-menu-toggle {
  width: 45px;
  height: 45px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  color: white;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.chatbot-menu-toggle:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(109, 164, 185, 0.2);
}

.chatbot-send {
  width: 45px;
  height: 45px;
  background: linear-gradient(135deg, var(--main-blue-1) 0%, var(--dark-cadet) 100%);
  border: none;
  border-radius: 50%;
  color: white;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

.chatbot-send::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.chatbot-send:hover::before {
  width: 100px;
  height: 100px;
}

.chatbot-send:hover {
  transform: scale(1.1) rotate(15deg);
  box-shadow: 0 4px 12px rgba(74, 122, 138, 0.5);
  animation: sendPulse 0.6s ease;
}

.chatbot-send:active {
  transform: scale(0.95);
}

.chatbot-footer-text {
  text-align: center;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.4);
  margin-top: 8px;
}

.chatbot-footer-text .digitech-link {
  color: var(--primary);
  font-weight: 700;
  text-decoration: none;
  transition: all 0.3s ease;
  position: relative;
}

.chatbot-footer-text .digitech-link:hover {
  color: var(--secondary);
  text-shadow: 0 0 8px rgba(109, 164, 185, 0.6);
}


/* Animations */
@keyframes bounceIn {
  0% {
    opacity: 0;
    transform: scale(0.3);
  }

  50% {
    opacity: 1;
    transform: scale(1.05);
  }

  70% {
    transform: scale(0.9);
  }

  100% {
    transform: scale(1);
  }
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }
}

@keyframes pulse-ring {
  0% {
    transform: scale(1);
    opacity: 1;
  }

  100% {
    transform: scale(1.5);
    opacity: 0;
  }
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }

  100% {
    transform: translateX(100%);
  }
}

@keyframes messageSlideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes typingBounce {

  0%,
  60%,
  100% {
    transform: translateY(0);
  }

  30% {
    transform: translateY(-10px);
  }
}

@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }

  100% {
    background-position: 0% 50%;
  }
}

@keyframes float {

  0%,
  100% {
    transform: translateY(0px);
  }

  50% {
    transform: translateY(-8px);
  }
}

@keyframes glow {

  0%,
  100% {
    box-shadow: 0 0 10px rgba(46, 213, 115, 0.5);
  }

  50% {
    box-shadow: 0 0 20px rgba(46, 213, 115, 0.9), 0 0 30px rgba(46, 213, 115, 0.6);
  }
}

@keyframes sendPulse {
  0% {
    transform: scale(1.1) rotate(15deg);
  }

  50% {
    transform: scale(1.2) rotate(15deg);
  }

  100% {
    transform: scale(1.1) rotate(15deg);
  }
}

@keyframes floatingBubbles {
  0% {
    background-position: 0 0, 40px 40px, 20px 20px;
  }

  100% {
    background-position: 0 -1000px, 40px -960px, 20px -980px;
  }
}

@keyframes floatingOrbs {

  0%,
  100% {
    background-position: 20% 30%, 80% 70%, 50% 50%;
  }

  25% {
    background-position: 25% 40%, 75% 60%, 55% 45%;
  }

  50% {
    background-position: 30% 50%, 70% 50%, 50% 40%;
  }

  75% {
    background-position: 25% 60%, 75% 40%, 45% 55%;
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .chatbot-container {
    width: 100%;
    height: 100%;
    bottom: 0;
    right: 0;
    border-radius: 0;
  }

  .chatbot-header {
    border-radius: 0;
  }

  .chatbot-toggle {
    bottom: 90px;
    right: 20px;
    width: 55px;
    height: 55px;
  }

  .chatbot-toggle-icon {
    font-size: 24px;
  }

  .message-content {
    max-width: 80%;
  }
}

@media (max-width: 480px) {
  .chatbot-input {
    font-size: 16px;
    /* Prevents zoom on iOS */
  }

  .quick-reply-btn {
    font-size: 12px;
    padding: 6px 12px;
  }
}

/* Dark theme adjustments */
@media (prefers-color-scheme: dark) {
  .chatbot-container {
    background: var(--main-dark);
  }
}

/* Accessibility */
.chatbot-toggle:focus,
.chatbot-close:focus,
.chatbot-send:focus,
.quick-reply-btn:focus {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Print styles */
@media print {

  .chatbot-toggle,
  .chatbot-container {
    display: none !important;
  }
}