/* ================ CORE STYLES ================ */
:root {
  --primary-color: #4361ee;
  --primary-hover: #3a56d4;
  --secondary-color: #f8f9fa;
  --text-color: #2b2d42;
  --text-light: #6c757d;
  --white: #ffffff;
  --success-color: #4cc9f0;
  --error-color: #f72585;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.12);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.1);
  --border-radius: 12px;
  --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* ================ CHAT BUTTON ================ */
.aura-chat-button {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, var(--primary-color), #4895ef);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  z-index: 9999;
  transition: var(--transition);
  border: none;
  outline: none;
}

.aura-chat-button:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 15px 30px rgba(67, 97, 238, 0.3);
}

.aura-chat-button:active {
  transform: translateY(1px);
}

.aura-chat-button svg {
  width: 28px;
  height: 28px;
  fill: var(--white);
  transition: var(--transition);
}

.aura-chat-button:hover svg {
  transform: rotate(10deg);
}

/* ================ CHAT CONTAINER ================ */
.aura-chat-container {
  position: fixed;
  bottom: 110px;
  right: 30px;
  width: 400px;
  height: 600px;
  max-height: 80vh;
  background: var(--white);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-lg);
  z-index: 9998;
  display: none;
  flex-direction: column;
  overflow: hidden;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  transform-origin: bottom right;
}

.aura-chat-container.visible {
  display: flex;
  animation: aura-scale-in 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes aura-scale-in {
  from { opacity: 0; transform: scale(0.8); }
  to { opacity: 1; transform: scale(1); }
}

/* ================ CHAT HEADER ================ */
.aura-chat-header {
  padding: 18px 24px;
  background: linear-gradient(135deg, var(--primary-color), #4895ef);
  color: var(--white);
  display: flex;
  align-items: center;
  position: relative;
  z-index: 1;
}

.aura-chat-close {
  background: none;
  border: none;
  color: var(--white);
  font-size: 24px;
  cursor: pointer;
  padding: 4px;
  margin-left: auto;
  opacity: 0.8;
  transition: var(--transition);
  border-radius: 50%;
}

.aura-chat-close:hover {
  opacity: 1;
  background: rgba(255,255,255,0.2);
}

/* ================ AVATAR & TITLE ================ */
.aura-chat-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  margin-right: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Pacifico', cursive;
  font-size: 18px;
  color: var(--white);
  background: linear-gradient(135deg, #f72585, #b5179e);
  position: relative;
  box-shadow: var(--shadow-sm);
}

.aura-chat-avatar::after {
  content: '';
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 12px;
  height: 12px;
  background-color: var(--success-color);
  border-radius: 50%;
  border: 2px solid var(--primary-color);
}

.aura-chat-title {
  display: flex;
  flex-direction: column;
}

.aura-chat-name {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
}

.aura-chat-subtitle {
  font-size: 12px;
  font-weight: 400;
  opacity: 0.9;
  display: flex;
  align-items: center;
  margin-top: 2px;
}

.aura-chat-subtitle::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  background-color: var(--success-color);
  border-radius: 50%;
  margin-right: 6px;
}

/* ================ CHAT CONTENT ================ */
.aura-chat-content {
  flex-grow: 1;
  padding: 20px;
  overflow-y: auto;
  background-color: var(--secondary-color);
  scroll-behavior: smooth;
  display: flex;
  flex-direction: column;
}

/* Custom scrollbar */
.aura-chat-content::-webkit-scrollbar {
  width: 6px;
}

.aura-chat-content::-webkit-scrollbar-track {
  background: rgba(0,0,0,0.05);
}

.aura-chat-content::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.1);
  border-radius: 3px;
}

.aura-chat-content::-webkit-scrollbar-thumb:hover {
  background: rgba(0,0,0,0.2);
}

/* ================ MESSAGE STYLES ================ */
.aura-message {
  max-width: 80%;
  margin-bottom: 16px;
  display: flex;
  align-items: flex-end;
  animation: aura-message-in 0.3s ease-out;
}

@keyframes aura-message-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.aura-message-user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.aura-message-bot {
  align-self: flex-start;
}

.aura-message-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  margin: 0 10px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: bold;
  box-shadow: var(--shadow-sm);
}

.aura-message-avatar-bot {
  background: linear-gradient(135deg, #f72585, #b5179e);
  color: var(--white);
  font-family: 'Pacifico', cursive;
}

.aura-message-avatar-user {
  background: linear-gradient(135deg, #4cc9f0, #4895ef);
  color: var(--white);
}

.aura-message-bubble {
  padding: 12px 16px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.5;
  position: relative;
  word-wrap: break-word;
  max-width: 100%;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.aura-message-bubble-bot {
  background-color: var(--white);
  color: var(--text-color);
  border-bottom-left-radius: 4px;
  margin-left: 10px;
}

.aura-message-bubble-user {
  background: linear-gradient(135deg, var(--primary-color), #4895ef);
  color: var(--white);
  border-bottom-right-radius: 4px;
  margin-right: 10px;
}

.aura-message-time {
  display: block;
  font-size: 11px;
  opacity: 0.8;
  margin-top: 6px;
}

.aura-message-bubble-bot .aura-message-time {
  color: var(--text-light);
  text-align: left;
}

.aura-message-bubble-user .aura-message-time {
  color: rgba(255,255,255,0.8);
  text-align: right;
}

/* ================ WELCOME MESSAGE ================ */
.aura-welcome-message {
  background-color: var(--white);
  color: var(--text-color);
  padding: 16px;
  border-radius: var(--border-radius);
  border-bottom-left-radius: 4px;
  margin-bottom: 16px;
  align-self: flex-start;
  max-width: 80%;
  box-shadow: var(--shadow-sm);
  font-size: 14px;
  line-height: 1.6;
  border-left: 4px solid var(--primary-color);
}

.aura-welcome-message .aura-message-time {
  color: var(--text-light);
  text-align: left;
}

/* ================ TYPING INDICATOR ================ */
.aura-typing-indicator {
  display: inline-flex;
  padding: 12px 16px;
  background-color: var(--white);
  border-radius: 18px;
  border-bottom-left-radius: 4px;
  margin-bottom: 16px;
  align-self: flex-start;
  box-shadow: var(--shadow-sm);
}

.aura-typing-dots {
  display: flex;
  align-items: center;
}

.aura-typing-dots span {
  width: 8px;
  height: 8px;
  background-color: var(--text-light);
  border-radius: 50%;
  display: inline-block;
  margin: 0 3px;
  animation: aura-typing-animation 1.4s infinite ease-in-out;
}

.aura-typing-dots span:nth-child(1) {
  animation-delay: 0s;
}

.aura-typing-dots span:nth-child(2) {
  animation-delay: 0.2s;
}

.aura-typing-dots span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes aura-typing-animation {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-4px); }
}

/* ================ INPUT AREA ================ */
.aura-chat-input-area {
  display: flex;
  border-top: 1px solid #e9ecef;
  padding: 16px 20px;
  background: var(--white);
  align-items: center;
}

#chat-input {
  flex-grow: 1;
  padding: 12px 18px;
  border: 1px solid #e9ecef;
  border-radius: 24px;
  outline: none;
  font-size: 14px;
  transition: var(--transition);
  background-color: #f8f9fa;
  font-family: 'Inter', sans-serif;
}

#chat-input:focus {
  border-color: var(--primary-color);
  background-color: var(--white);
  box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.15);
}

.aura-chat-send-button {
  margin-left: 12px;
  padding: 10px 20px;
  background: linear-gradient(135deg, var(--primary-color), #4895ef);
  color: var(--white);
  border: none;
  border-radius: 24px;
  cursor: pointer;
  transition: var(--transition);
  font-size: 14px;
  font-weight: 500;
  min-width: 70px;
  box-shadow: var(--shadow-sm);
}

.aura-chat-send-button:hover {
  background: linear-gradient(135deg, var(--primary-hover), #3a7bd5);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(67, 97, 238, 0.25);
}

.aura-chat-send-button:active {
  transform: translateY(0);
}

.aura-chat-send-button:disabled {
  background: #e9ecef;
  color: #adb5bd;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* ================ RESPONSIVE ================ */
@media (max-width: 480px) {
  .aura-chat-container {
    width: calc(100% - 32px);
    right: 16px;
    bottom: 90px;
    height: 75vh;
    max-height: none;
    border-radius: 16px;
  }
  
  .aura-chat-button {
    right: 16px;
    bottom: 16px;
    width: 56px;
    height: 56px;
  }
  
  .aura-chat-button svg {
    width: 24px;
    height: 24px;
  }
  
  .aura-message-bubble {
    padding: 10px 14px;
    font-size: 13px;
  }
  
  .aura-chat-header {
    padding: 14px 16px;
  }
  
  .aura-chat-avatar {
    width: 36px;
    height: 36px;
    margin-right: 10px;
  }
  
  .aura-chat-content {
    padding: 16px;
  }
  
  .aura-chat-input-area {
    padding: 12px 16px;
  }
}