/* Nova AI Chat Widget - WordPress Compatible CSS */
.chat-widget {
  --primary-color: #1ca08a;
  --secondary-color: #1b2c5c;
  --accent-color: #00ffe7;
  --chat-width: 380px;
  --chat-height: 500px;
  --icon-size: 60px;
}

/* Ensure no conflicts with WordPress themes */
.chat-widget * {
  box-sizing: border-box;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    sans-serif;
  margin: 0;
  padding: 0;
}

/* Chat Widget Container */
.chat-widget {
  position: fixed !important;
  bottom: 20px !important;
  right: 20px !important;
  z-index: 999999 !important;
  font-family: "Inter", sans-serif !important;
}

/* Floating Chat Icon */
.chat-widget .chat-icon {
  width: var(--icon-size);
  height: var(--icon-size);
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--accent-color)
  );
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 25px rgba(28, 160, 138, 0.3);
  transition: all 0.3s ease;
  animation: nova-chat-icon-pulse 2s infinite;
  position: relative;
  border: none;
}

.chat-widget .chat-icon:hover {
  transform: scale(1.1);
  box-shadow: 0 12px 35px rgba(28, 160, 138, 0.4);
}

@keyframes nova-chat-icon-pulse {
  0% {
    box-shadow: 0 8px 25px rgba(28, 160, 138, 0.3);
  }
  50% {
    box-shadow: 0 8px 25px rgba(28, 160, 138, 0.5),
      0 0 0 10px rgba(28, 160, 138, 0.1);
  }
  100% {
    box-shadow: 0 8px 25px rgba(28, 160, 138, 0.3);
  }
}

.chat-widget .chat-icon-inner {
  position: relative;
  width: 30px;
  height: 30px;
}

.chat-widget .chat-svg,
.chat-widget .close-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  color: white;
  transition: all 0.3s ease;
}

.chat-widget .close-svg {
  opacity: 0;
  transform: rotate(90deg);
}

/* Icon animation when chat is open */
.chat-widget.open .chat-svg {
  opacity: 0;
  transform: rotate(-90deg);
}

.chat-widget.open .close-svg {
  opacity: 1;
  transform: rotate(0deg);
}

/* Notification Badge */
.chat-widget .notification-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: #ff4757;
  color: white;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: bold;
  animation: nova-badge-bounce 1s infinite;
}

.chat-widget .notification-badge.hidden {
  display: none;
}

@keyframes nova-badge-bounce {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.2);
  }
}

/* Chat Container */
.chat-widget .chat-container {
  width: var(--chat-width);
  height: var(--chat-height);
  background: rgba(255, 255, 255, 0.98);
  border-radius: 1.2rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: absolute;
  bottom: 80px;
  right: 0;
  transform: scale(0) translateY(20px);
  opacity: 0;
  transform-origin: bottom right;
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  border: 1px solid rgba(28, 160, 138, 0.2);
}

.chat-widget.open .chat-container {
  transform: scale(1) translateY(0);
  opacity: 1;
}

/* Header with Animated Avatar */
.chat-widget .chat-header {
  background: var(--secondary-color);
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  position: relative;
}

.chat-widget .ai-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: radial-gradient(
    circle at 65% 35%,
    var(--accent-color),
    var(--primary-color)
  );
  display: flex;
  align-items: center;
  justify-content: center;
  animation: nova-avatar-pulse 2s infinite;
  box-shadow: 0 0 15px rgba(0, 255, 231, 0.3);
}

@keyframes nova-avatar-pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

.chat-widget .ai-avatar svg {
  width: 24px;
  height: 24px;
}

.chat-widget .header-text {
  flex: 1;
}

.chat-widget .header-text h1 {
  color: white;
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0;
  line-height: 1.2;
}

.chat-widget .header-text .status {
  color: var(--accent-color);
  font-size: 0.8rem;
  font-weight: 500;
  margin: 0;
  line-height: 1.2;
}

/* Minimize Button */
.chat-widget .minimize-btn {
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 50%;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
}

.chat-widget .minimize-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.chat-widget .minimize-btn svg {
  width: 16px;
  height: 16px;
}

/* Messages Area */
.chat-widget .chat-messages {
  flex: 1;
  padding: 1rem;
  overflow-y: auto;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.chat-widget .message {
  max-width: 85%;
  padding: 0.8rem 1rem;
  border-radius: 1rem;
  animation: nova-message-appear 0.3s ease;
  font-size: 0.9rem;
  line-height: 1.4;
}

@keyframes nova-message-appear {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.chat-widget .message.user {
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--accent-color)
  );
  color: white;
  align-self: flex-end;
  box-shadow: 0 4px 15px rgba(28, 160, 138, 0.2);
}

.chat-widget .message.bot {
  background: white;
  color: var(--secondary-color);
  align-self: flex-start;
  box-shadow: 0 4px 15px rgba(44, 62, 80, 0.1);
}

.chat-widget .message.system {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--accent-color);
  align-self: center;
  text-align: center;
}

/* Message Content Formatting */
.chat-widget .message-content p {
  margin: 0 0 1rem 0;
  line-height: 1.6;
}

.chat-widget .message-content p:last-child {
  margin-bottom: 0;
}

.chat-widget .message-content .bullet-point {
  margin: 0.5rem 0;
  padding-left: 0.5rem;
  line-height: 1.6;
  display: flex;
  align-items: flex-start;
}

.chat-widget .message-content .bullet-point::before {
  content: "•";
  font-weight: bold;
  margin-right: 0.5rem;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.chat-widget .message-content .numbered-point {
  margin: 0.5rem 0;
  padding-left: 0.5rem;
  line-height: 1.6;
}

.chat-widget .message-content .sub-point {
  margin: 0.4rem 0;
  padding-left: 1.5rem;
  line-height: 1.6;
  font-size: 0.95em;
  display: flex;
  align-items: flex-start;
}

.chat-widget .message-content .sub-point::before {
  content: "◦";
  font-weight: bold;
  margin-right: 0.5rem;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

/* Bold headers styling - no special colors */
.chat-widget .message-content strong {
  font-weight: 700;
  font-size: 1.02em;
}

/* Better spacing for bot messages */
.chat-widget .message.bot .message-content {
  line-height: 1.6;
}

/* Code-like formatting for technical responses */
.chat-widget .message-content code {
  background: rgba(0, 0, 0, 0.05);
  padding: 0.2rem 0.4rem;
  border-radius: 0.3rem;
  font-family: "Courier New", monospace;
  font-size: 0.9em;
  font-weight: 500;
}

.chat-widget .message-content pre {
  background: rgba(28, 160, 138, 0.1);
  padding: 0.8rem;
  border-radius: 0.5rem;
  overflow-x: auto;
  margin: 0.5rem 0;
  font-family: "Courier New", monospace;
  font-size: 0.85em;
}

/* Input Area */
.chat-widget .input-container {
  padding: 1rem;
  background: white;
  border-top: 1px solid #e0f7fa;
}

.chat-widget .input-wrapper {
  position: relative;
  display: flex;
  gap: 0.5rem;
}

.chat-widget #user-input {
  flex: 1;
  padding: 0.7rem 1rem;
  border: 2px solid #e0f7fa;
  border-radius: 0.8rem;
  font-size: 0.9rem;
  transition: all 0.2s;
  outline: none;
  font-family: inherit;
}

.chat-widget #user-input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 8px rgba(28, 160, 138, 0.1);
}

.chat-widget #send-button {
  width: 36px;
  height: 36px;
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--accent-color)
  );
  border: none;
  border-radius: 50%;
  color: white;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  min-width: 36px;
  flex-shrink: 0;
}

.chat-widget #send-button:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 15px rgba(28, 160, 138, 0.3);
}

.chat-widget #send-button svg {
  width: 16px;
  height: 16px;
  fill: white;
  pointer-events: none;
}

/* Scrollbar */
.chat-widget .chat-messages::-webkit-scrollbar {
  width: 6px;
}

.chat-widget .chat-messages::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.chat-widget .chat-messages::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 3px;
}

/* Mobile Responsive */
@media (max-width: 480px) {
  .chat-widget {
    bottom: 15px !important;
    right: 15px !important;
  }

  .chat-widget .chat-container {
    width: calc(100vw - 30px);
    height: calc(100vh - 120px);
    bottom: 80px;
    right: -15px;
    border-radius: 1rem;
  }

  .chat-widget .chat-icon {
    width: 55px;
    height: 55px;
  }

  .chat-widget .chat-icon-inner {
    width: 26px;
    height: 26px;
  }
}

/* Additional mobile optimizations */
@media (max-width: 380px) {
  .chat-widget .chat-container {
    width: 100vw;
    height: 100vh;
    bottom: 0;
    right: -20px;
    border-radius: 0;
    position: fixed;
  }
}
