/* Noxie Chat Widget */
#noxie-widget {
  position: fixed;
  bottom: 30px;
  right: 30px;
  /* font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; */
  z-index: 200;
}
/* Siri-like Animated Gradient Button */
#noxie-toggle {
  width: 65px;
  height: 65px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 30px;
  overflow: hidden;
  box-shadow: 0 10px 35px rgba(159, 241, 78, 0.4);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  animation: pulse 2s ease-in-out infinite;
}

/* Animated background gradient (Siri-like) */
#noxie-toggle::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
background: linear-gradient(
  145deg,
  #9ff14e,
  #baff6b,
  #9ff14e,
   #2cff05,
  #baff6b,
  #78ff00,
  #d4f1d4,
  #9ff14e,
  #78ff00,
  #baff6b,
  #21d625,
  #9ff14e,
  #baff6b,
  #9ff14e
);
background-size: 600% 600%;
animation: siriGradient 8s ease infinite;
  z-index: 0;
}

/* Light overlay for glow effect */
#noxie-toggle::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(
    circle at 30% 30%,
    rgba(255, 255, 255, 0.25),
    transparent 70%
  );
  z-index: 1;
}

/* Icon stays above background */
#noxie-toggle i {
  position: relative;
  z-index: 2;
}

/* Hover + Pulse animation */
#noxie-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 14px 45px rgba(159, 241, 78, 0.6);
}

@keyframes pulse {
  0%, 100% {
    box-shadow: 0 10px 35px rgba(159, 241, 78, 0.4);
  }
  50% {
    box-shadow: 0 10px 45px rgba(159, 241, 78, 0.7);
  }
}

/* Smooth color shift animation */
@keyframes siriGradient {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}
/* Toggle button with pulse animation */
/* #noxie-toggle {
  background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
  color: white;
  width: 65px;
  height: 65px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  cursor: pointer;
  box-shadow: 0 10px 35px rgba(76, 175, 80, 0.4), 0 0 0 0 rgba(76, 175, 80, 0.3);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  animation: pulse 2s ease-in-out infinite;
  border: none;
  position: relative;
}

#noxie-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 14px 45px rgba(76, 175, 80, 0.5), 0 0 0 0 rgba(76, 175, 80, 0.2);
}

@keyframes pulse {
  0%,
  100% {
    box-shadow: 0 10px 35px rgba(76, 175, 80, 0.4), 0 0 0 0 rgba(76, 175, 80, 0.3);
  }

  50% {
    box-shadow: 0 10px 35px rgba(76, 175, 80, 0.4), 0 0 0 12px rgba(76, 175, 80, 0);
  }
} */

/* Chat box with enhanced glassmorphism */
#noxie-chatbox {
  position: fixed;
  top: 0;
  right: -400px;
  width: 400px;
  height: 100vh;
  max-height: 100dvh;
  background: rgba(42, 50, 45, 0.65);
  backdrop-filter: blur(25px) saturate(200%);
  -webkit-backdrop-filter: blur(25px) saturate(200%);
  border-left: 1px solid rgba(76, 175, 80, 0.5);
  border-right: 1px solid rgba(76, 175, 80, 0.15);
  padding: 0;
  color: white;
  overflow: hidden;
  transition: right 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 9998;
  display: flex;
  flex-direction: column;
}

#noxie-chatbox.open {
  right: 0;
}

/* Header */
#noxie-chatbox h3 {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  margin: 0;
  padding: 24px 20px;
  font-size: 20px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid rgba(76, 175, 80, 0.3);
  color: #fff;
  letter-spacing: 0.3px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2), inset 0 1px 2px rgba(76, 175, 80, 0.1);
  flex-shrink: 0;
}

#noxie-close {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  padding: 0;
  box-shadow: none;
  flex-shrink: 0;
}

#noxie-close:hover {
  color: #4caf50;
  transform: rotate(90deg);
}

/* Messages container */
#noxie-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  background: linear-gradient(to bottom, rgba(45, 58, 50, 0.25), rgba(35, 45, 40, 0.3));
  scrollbar-width: thin;
  scrollbar-color: rgba(76, 175, 80, 0.6) transparent;
}

#noxie-messages::-webkit-scrollbar {
  width: 8px;
}

#noxie-messages::-webkit-scrollbar-track {
  background: transparent;
}

#noxie-messages::-webkit-scrollbar-thumb {
  background: rgba(76, 175, 80, 0.6);
  border-radius: 4px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

#noxie-messages::-webkit-scrollbar-thumb:hover {
  background: rgba(76, 175, 80, 0.8);
  background-clip: padding-box;
}

/* Message bubbles */
.noxie-message {
  margin: 12px 0;
  padding: 12px 16px;
  border-radius: 14px;
  max-width: 85%;
  word-wrap: break-word;
  animation: fadeIn 0.4s ease;
  line-height: 1.5;
  font-size: 14px;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.noxie-bot {
  background: rgba(76, 175, 80, 0.18);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1.5px solid rgba(76, 175, 80, 0.45);
  color: #d4f1d4;
  margin-right: auto;
  border-radius: 14px 14px 14px 4px;
  box-shadow: 0 8px 24px rgba(76, 175, 80, 0.08), inset 0 1px 2px rgba(255, 255, 255, 0.1);
}

.noxie-message:not(.noxie-bot) {
  background: rgba(100, 110, 105, 0.3);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1.5px solid rgba(100, 110, 105, 0.5);
  color: #fff;
  margin-left: auto;
  text-align: right;
  border-radius: 14px 14px 4px 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1), inset 0 1px 2px rgba(255, 255, 255, 0.1);
}

/* Chat input */
#noxie-chat-input {
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border-top: 1px solid rgba(76, 175, 80, 0.35);
  display: flex;
  gap: 12px;
  align-items: flex-end;
  flex-shrink: 0;
}

/* Textarea */
#noxie-userInput {
  flex: 1;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1.5px solid rgba(76, 175, 80, 0.3);
  background: rgba(16, 20, 17, 0.5);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: white;
  font-size: 14px;
  font-family: inherit;
  transition: all 0.3s ease;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.15);
  resize: none;
  max-height: 120px;
  min-height: 40px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(76, 175, 80, 0.4) transparent;
  line-height: 1.4;
}

#noxie-userInput::-webkit-scrollbar {
  width: 6px;
}

#noxie-userInput::-webkit-scrollbar-track {
  background: transparent;
}

#noxie-userInput::-webkit-scrollbar-thumb {
  background: rgba(76, 175, 80, 0.4);
  border-radius: 3px;
}

#noxie-userInput::-webkit-scrollbar-thumb:hover {
  background: rgba(76, 175, 80, 0.6);
}

#noxie-userInput:focus {
  outline: none;
  border-color: #4caf50;
  background: rgba(55, 70, 60, 0.6);
  box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.2), inset 0 2px 8px rgba(0, 0, 0, 0.15);
}

#noxie-userInput::placeholder {
  color: rgba(255, 255, 255, 0.35);
}

/* Buttons */
#noxie-chatbox button:not(#noxie-close) {
  padding: 12px 20px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
  color: white;
  cursor: pointer;
  font-weight: 700;
  font-size: 14px;
  transition: all 0.3s ease;
  box-shadow: 0 6px 20px rgba(76, 175, 80, 0.3), inset -2px -2px 6px rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(76, 175, 80, 0.5);
  letter-spacing: 0.3px;
  flex-shrink: 0;
}

#noxie-chatbox button:not(#noxie-close):hover {
  background: linear-gradient(135deg, #45a049 0%, #388e3c 100%);
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(76, 175, 80, 0.4), inset -2px -2px 6px rgba(0, 0, 0, 0.2);
}

#noxie-chatbox button:not(#noxie-close):active {
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3), inset -2px -2px 6px rgba(0, 0, 0, 0.2);
}

#noxie-chatbox button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Multiple choice options */
.noxie-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 12px 0;
  padding: 0;
}

.noxie-option-btn {
  background: rgba(76, 175, 80, 0.15);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1.5px solid rgba(76, 175, 80, 0.35);
  color: #d4f1d4;
  padding: 13px 16px;
  border-radius: 11px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: left;
  font-size: 14px;
  font-weight: 500;
  width: 100%;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), inset 0 1px 2px rgba(255, 255, 255, 0.08);
}

.noxie-option-btn:hover {
  background: rgba(76, 175, 80, 0.25);
  border-color: #4caf50;
  transform: translateX(6px);
  box-shadow: 0 6px 16px rgba(76, 175, 80, 0.25), inset 0 1px 2px rgba(255, 255, 255, 0.1);
}

.noxie-option-btn:active {
  transform: translateX(3px);
}

.noxie-link-btn {
  display: inline-block;
  background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
  color: white;
  padding: 8px 14px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  margin-top: 8px;
  transition: all 0.2s;
  font-size: 13px;
  border: 1px solid rgba(76, 175, 80, 0.4);
  box-shadow: 0 3px 10px rgba(76, 175, 80, 0.2);
}

.noxie-link-btn:hover {
  background: linear-gradient(135deg, #45a049 0%, #388e3c 100%);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(76, 175, 80, 0.3);
}

.noxie-message.thinking em {
  color: #999;
  font-style: italic;
  animation: pulses 1.5s infinite ease-in-out;
}

@keyframes pulses {
  0% { opacity: 0.3; }
  50% { opacity: 1; }
  100% { opacity: 0.3; }
}

/* Mobile Responsive */
@media (max-width: 768px) {
  #noxie-chatbox {
    width: 100%;
    right: -100%;
    height: 100dvh;
    max-height: 100dvh;
  }

  #noxie-widget {
    bottom: 20px;
    right: 20px;
  }

  #noxie-toggle {
    width: 60px;
    height: 60px;
    font-size: 28px;
  }

  #noxie-chatbox h3 {
    padding: 20px;
    font-size: 18px;
  }

  #noxie-close {
    width: 30px;
    height: 30px;
    font-size: 18px;
  }

  #noxie-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
  }

  .noxie-message {
    padding: 10px 12px;
    font-size: 13px;
    max-width: 90%;
    margin: 8px 0;
  }

  #noxie-chat-input {
    padding: 12px 16px;
    gap: 10px;
  }

  #noxie-userInput {
    padding: 10px 12px;
    font-size: 13px;
    border-radius: 8px;
    max-height: 100px;
  }

  #noxie-chatbox button:not(#noxie-close) {
    padding: 10px 16px;
    font-size: 13px;
    border-radius: 8px;
  }

  .noxie-option-btn {
    padding: 11px 14px;
    font-size: 13px;
    border-radius: 9px;
  }

  .noxie-link-btn {
    padding: 6px 12px;
    font-size: 12px;
  }
}

@media (max-width: 480px) {
  #noxie-chatbox {
    width: 100%;
    height: 100dvh;
    max-height: 100dvh;
  }

  #noxie-toggle {
    width: 55px;
    height: 55px;
    font-size: 26px;
    bottom: 15px;
    right: 15px;
  }

  #noxie-widget {
    bottom: 15px;
    right: 15px;
  }

  #noxie-chatbox h3 {
    padding: 16px;
    font-size: 16px;
  }

  #noxie-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
  }

  .noxie-message {
    padding: 8px 10px;
    font-size: 12px;
    max-width: 92%;
    margin: 6px 0;
    border-radius: 11px;
  }

  #noxie-chat-input {
    padding: 10px 12px;
    gap: 8px;
  }

  #noxie-userInput {
    padding: 9px 11px;
    font-size: 16px;
    border-radius: 7px;
    max-height: 80px;
  }

  #noxie-chatbox button:not(#noxie-close) {
    padding: 9px 14px;
    font-size: 12px;
    border-radius: 7px;
  }

  .noxie-option-btn {
    padding: 10px 12px;
    font-size: 12px;
    border-radius: 8px;
  }

  .noxie-link-btn {
    padding: 6px 10px;
    font-size: 11px;
  }
}