/* Enhanced Chat Styles - Crystal Ball Theme */

/* Magic Particle Background for Chat Widget */
#chat-widget::before,
.chat-widget::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.95) 100%);
  z-index: -2;
  pointer-events: none;
  border-radius: 16px;
}

/* Dark mode background */
[data-theme="dark"] #chat-widget::before,
[data-theme="dark"] .chat-widget::before {
  background: linear-gradient(135deg, rgba(22, 28, 36, 0.85) 0%, rgba(15, 18, 24, 0.95) 100%);
}

/* Magical particles in chat background */
#chat-widget::after,
.chat-widget::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image:
    radial-gradient(circle at 10% 20%, rgba(77, 151, 209, 0.1) 0%, transparent 60%),
    radial-gradient(circle at 90% 80%, rgba(224, 92, 147, 0.1) 0%, transparent 60%),
    radial-gradient(circle at 50% 50%, rgba(255, 214, 51, 0.07) 0%, transparent 60%);
  opacity: 0.9;
  z-index: -1;
  pointer-events: none;
  animation: crystal-magic-bg 12s ease-in-out infinite alternate;
  border-radius: 16px;
}

/* Dark mode particles */
[data-theme="dark"] #chat-widget::after,
[data-theme="dark"] .chat-widget::after {
  background-image:
    radial-gradient(circle at 15% 25%, rgba(77, 151, 209, 0.2) 0%, transparent 60%),
    radial-gradient(circle at 85% 75%, rgba(224, 92, 147, 0.2) 0%, transparent 60%),
    radial-gradient(circle at 50% 50%, rgba(255, 214, 51, 0.15) 0%, transparent 60%),
    linear-gradient(45deg, rgba(30, 40, 70, 0.05) 0%, rgba(60, 30, 60, 0.05) 100%);
  opacity: 1;
  animation: crystal-magic-bg-dark 12s ease-in-out infinite alternate;
}

/* Floating particles */
.chat-particle {
  position: absolute;
  width: 5px;
  height: 5px;
  background: transparent;
  border-radius: 50%;
  pointer-events: none;
  z-index: 1;
  opacity: 0;
  animation: float-particle 6s ease-in-out infinite;
}

/* Create multiple particles with different positions and animations */
.chat-particle:nth-child(1) {
  top: 20%;
  left: 10%;
  animation-delay: 0s;
  box-shadow: 0 0 10px 3px rgba(77, 151, 209, 0.7);
}

.chat-particle:nth-child(2) {
  top: 70%;
  left: 85%;
  animation-delay: 1.5s;
  box-shadow: 0 0 10px 3px rgba(224, 92, 147, 0.7);
}

.chat-particle:nth-child(3) {
  top: 40%;
  left: 50%;
  animation-delay: 3s;
  box-shadow: 0 0 10px 3px rgba(255, 214, 51, 0.7);
}

.chat-particle:nth-child(4) {
  top: 80%;
  left: 30%;
  animation-delay: 0.8s;
  box-shadow: 0 0 10px 3px rgba(77, 151, 209, 0.7);
}

.chat-particle:nth-child(5) {
  top: 10%;
  left: 70%;
  animation-delay: 2.2s;
  box-shadow: 0 0 10px 3px rgba(224, 92, 147, 0.7);
}

/* Add more particles for increased effect */
.chat-particle:nth-child(6) {
  top: 55%;
  left: 15%;
  animation-delay: 1.2s;
  box-shadow: 0 0 10px 3px rgba(255, 214, 51, 0.7);
}

.chat-particle:nth-child(7) {
  top: 25%;
  left: 85%;
  animation-delay: 2.7s;
  box-shadow: 0 0 10px 3px rgba(77, 151, 209, 0.7);
}

/* Enhanced Send Button Styles */
#chat-send-btn {
  position: relative;
  overflow: visible !important;
}

/* Flying stars around send button */
.send-btn-star {
  position: absolute;
  width: 4px;
  height: 4px;
  background: white;
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
  z-index: 10;
  transition: opacity 0.3s ease;
}

/* Star 1 */
.send-btn-star:nth-child(1) {
  top: -8px;
  left: 50%;
  box-shadow: 0 0 10px 3px rgba(77, 151, 209, 0.8);
  animation: flying-star-1 2.5s ease-in-out infinite;
}

/* Star 2 */
.send-btn-star:nth-child(2) {
  bottom: -8px;
  right: 50%;
  box-shadow: 0 0 10px 3px rgba(224, 92, 147, 0.8);
  animation: flying-star-2 3s ease-in-out infinite 0.3s;
}

/* Star 3 */
.send-btn-star:nth-child(3) {
  top: 50%;
  right: -8px;
  box-shadow: 0 0 10px 3px rgba(255, 214, 51, 0.8);
  animation: flying-star-3 2.8s ease-in-out infinite 0.7s;
}

/* Star 4 */
.send-btn-star:nth-child(4) {
  top: 50%;
  left: -8px;
  box-shadow: 0 0 10px 3px rgba(77, 151, 209, 0.8);
  animation: flying-star-4 3.2s ease-in-out infinite 1.1s;
}

/* Star 5 */
.send-btn-star:nth-child(5) {
  top: -5px;
  right: -5px;
  box-shadow: 0 0 10px 3px rgba(224, 92, 147, 0.8);
  animation: flying-star-5 3.5s ease-in-out infinite 1.5s;
}

/* Send button hover effect */
#chat-send-btn:hover .send-btn-star {
  opacity: 1;
  animation-duration: 2s !important;
}

/* Send button active/click effect */
#chat-send-btn.sending .send-btn-star {
  opacity: 1;
  animation-duration: 1.2s !important;
  animation-timing-function: cubic-bezier(0.1, 0.8, 0.2, 1) !important;
}

/* Magic particles for send button click */
.magic-particle {
  position: absolute;
  width: 5px;
  height: 5px;
  background: white;
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
  transition: all 0.8s cubic-bezier(0.1, 0.8, 0.2, 1);
  z-index: 10;
}

/* Animations */
@keyframes crystal-magic-bg {
  0% {
    background-position: 0% 0%;
    opacity: 0.7;
  }
  50% {
    opacity: 0.9;
  }
  100% {
    background-position: 100% 100%;
    opacity: 0.7;
  }
}

@keyframes crystal-magic-bg-dark {
  0% {
    background-position: 0% 0%;
    opacity: 0.9;
  }
  50% {
    opacity: 1;
  }
  100% {
    background-position: 100% 100%;
    opacity: 0.9;
  }
}

@keyframes float-particle {
  0% {
    transform: translateY(0) translateX(0);
    opacity: 0;
  }
  20% {
    opacity: 0.9;
  }
  50% {
    transform: translateY(-20px) translateX(8px);
    opacity: 1;
  }
  80% {
    opacity: 0.9;
  }
  100% {
    transform: translateY(0) translateX(0);
    opacity: 0;
  }
}

@keyframes flying-star-1 {
  0% {
    opacity: 0;
    transform: translate(0, 0) scale(0.5);
  }
  25% {
    opacity: 1;
  }
  75% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(10px, -10px) scale(1.2);
  }
}

@keyframes flying-star-2 {
  0% {
    opacity: 0;
    transform: translate(0, 0) scale(0.5);
  }
  25% {
    opacity: 1;
  }
  75% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(-10px, 10px) scale(1.2);
  }
}

@keyframes flying-star-3 {
  0% {
    opacity: 0;
    transform: translate(0, 0) scale(0.5);
  }
  25% {
    opacity: 1;
  }
  75% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(15px, 0) scale(1.2);
  }
}

@keyframes flying-star-4 {
  0% {
    opacity: 0;
    transform: translate(0, 0) scale(0.5);
  }
  25% {
    opacity: 1;
  }
  75% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(-15px, 0) scale(1.2);
  }
}

@keyframes flying-star-5 {
  0% {
    opacity: 0;
    transform: translate(0, 0) scale(0.5);
  }
  25% {
    opacity: 1;
  }
  75% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(8px, -8px) scale(1.2);
  }
}
