/*
 * Chill Theme CSS
 * A relaxing theme with animated gradients, floating elements, and glassmorphism
 */

/* ===== ANIMATED GRADIENT BACKGROUND ===== */
@keyframes chillGradient {
  0% {
    background-position: 0% 50%;
  }
  25% {
    background-position: 100% 50%;
  }
  50% {
    background-position: 100% 100%;
  }
  75% {
    background-position: 0% 100%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* Chill theme background - only visible when chill theme is active */
.chill-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(-45deg, #a8edea, #fed6e3, #d299c2, #c2e9fb);
  background-size: 400% 400%;
  animation: chillGradient 15s ease infinite;
  z-index: -2;
  opacity: 0;
  transition: opacity 0.5s ease;
}

body.theme-chill .chill-background {
  opacity: 1;
}

/* ===== FLOATING ELEMENTS ANIMATIONS ===== */
@keyframes floatDown {
  0% {
    transform: translateY(-100px) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    transform: translateY(calc(100vh + 100px)) rotate(360deg);
    opacity: 0;
  }
}

@keyframes floatBubble {
  0% {
    transform: translateY(100vh) scale(0);
    opacity: 0;
  }
  10% {
    opacity: 0.7;
    transform: translateY(90vh) scale(1);
  }
  90% {
    opacity: 0.7;
  }
  100% {
    transform: translateY(-100px) scale(1.2);
    opacity: 0;
  }
}

@keyframes cloudFloat {
  0% {
    transform: translateX(-100px);
  }
  100% {
    transform: translateX(calc(100vw + 100px));
  }
}

/* Floating elements container */
.chill-floating-elements {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  opacity: 0;
  transition: opacity 0.5s ease;
}

body.theme-chill .chill-floating-elements {
  opacity: 1;
}

/* Falling leaves */
.falling-leaf {
  position: absolute;
  font-size: 20px;
  animation: floatDown 12s linear infinite;
  color: rgba(139, 195, 74, 0.6);
}

/* Floating bubbles */
.floating-bubble {
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.8), rgba(173, 216, 230, 0.4));
  animation: floatBubble 8s linear infinite;
  box-shadow: 0 0 10px rgba(173, 216, 230, 0.3);
}

/* Small clouds */
.small-cloud {
  position: absolute;
  font-size: 24px;
  animation: cloudFloat 20s linear infinite;
  color: rgba(255, 255, 255, 0.6);
  filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.3));
}

/* ===== GLASSMORPHISM CHAT BUBBLES ===== */
body.theme-chill .message {
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
  border-radius: 20px;
  color: white;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  position: relative;
  overflow: hidden;
}

body.theme-chill .message::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), transparent);
  pointer-events: none;
}

/* Floating message animation */
@keyframes messageFloat {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-3px);
  }
}

body.theme-chill .message {
  animation: messageFloat 4s ease-in-out infinite;
}

/* ===== INTERACTIVE PULSE ANIMATION ===== */
@keyframes chillPulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(255, 192, 203, 0.7);
  }
  70% {
    transform: scale(1.05);
    box-shadow: 0 0 0 10px rgba(255, 192, 203, 0);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(255, 192, 203, 0);
  }
}

body.theme-chill .message.pulse-animation {
  animation: chillPulse 0.6s ease-out;
}

/* Emoji reaction overlay */
.chill-emoji-reaction {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 24px;
  opacity: 0;
  pointer-events: none;
  z-index: 10;
}

@keyframes emojiReaction {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.5);
  }
  50% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.2);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -70%) scale(1);
  }
}

.chill-emoji-reaction.show {
  animation: emojiReaction 1.5s ease-out;
}



/* ===== CHILL ASSISTANT ===== */
.chill-assistant {
  position: fixed;
  bottom: 80px;
  right: 20px;
  font-size: 48px;
  z-index: 1000;
  cursor: pointer;
  transition: transform 0.3s ease;
  opacity: 0;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

body.theme-chill .chill-assistant {
  opacity: 1;
}

.chill-assistant:hover {
  transform: scale(1.1);
}

/* Winking animation */
@keyframes wink {
  0%, 90%, 100% {
    transform: scale(1);
  }
  95% {
    transform: scale(1.1);
  }
}

.chill-assistant.winking {
  animation: wink 0.5s ease-in-out;
}

/* Assistant speech bubble */
.assistant-speech {
  position: absolute;
  bottom: 60px;
  right: 0;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border-radius: 15px;
  padding: 10px 15px;
  color: #333;
  font-size: 14px;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.assistant-speech.show {
  opacity: 1;
  transform: translateY(0);
}

.assistant-speech::after {
  content: '';
  position: absolute;
  bottom: -5px;
  right: 20px;
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 8px solid rgba(255, 255, 255, 0.9);
}

/* ===== SOUND TOGGLE ENHANCEMENTS ===== */
body.theme-chill .sound-toggle {
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

body.theme-chill .sound-toggle:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* ===== THEME OVERRIDES ===== */
body.theme-chill {
  --theme-primary: #fed6e3;
  --theme-secondary: #a8edea;
  --theme-accent: #d299c2;
  --theme-glow: rgba(254, 214, 227, 0.8);
  --theme-shadow: rgba(168, 237, 234, 0.4);
  --theme-text-primary: #ffffff;
  --theme-text-secondary: #f0f0f0;
  --theme-font-family: 'Poppins', 'Arial', sans-serif;
}

/* Override main elements for chill theme */
body.theme-chill .glow {
  color: white;
  text-shadow: 
    0 0 10px rgba(254, 214, 227, 0.8),
    0 0 20px rgba(168, 237, 234, 0.6),
    0 0 30px rgba(210, 153, 194, 0.4);
}

body.theme-chill .start-btn {
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  border: 2px solid rgba(255, 255, 255, 0.3);
  color: white;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
}

body.theme-chill .start-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

body.theme-chill .chat-input {
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
}

body.theme-chill .chat-input::placeholder {
  color: rgba(255, 255, 255, 0.7);
}

body.theme-chill .send-btn {
  background: rgba(254, 214, 227, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
  backdrop-filter: blur(10px);
}

body.theme-chill .send-btn:hover {
  background: rgba(254, 214, 227, 1);
  transform: translateY(-1px);
}