/* Enhanced Maya Chatbot Styles with AI Features */
#maya-chatbot {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 999999;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Enhanced Chat Button with AI indicator */
.maya-chat-button {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-color, #F2541D), #e04214);
  box-shadow: 0 4px 20px rgba(242, 84, 29, 0.3);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  border: 3px solid #fff;
}

.maya-chat-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(242, 84, 29, 0.4);
}

.maya-chat-button.maya-active {
  transform: scale(0.9);
}

.maya-bot-icon {
  width: 35px;
  height: 35px;
  border-radius: 50%;
  object-fit: cover;
}

/* Enhanced notification dot with AI pulse */
.maya-notification-dot {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 12px;
  height: 12px;
  background: linear-gradient(45deg, #00ff88, #00cc6a);
  border: 2px solid #fff;
  border-radius: 50%;
  animation: maya-ai-pulse 2s infinite;
}

@keyframes maya-ai-pulse {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(0, 255, 136, 0.7); }
  50% { transform: scale(1.1); box-shadow: 0 0 0 10px rgba(0, 255, 136, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(0, 255, 136, 0); }
}

/* Enhanced Chat Window */
.maya-chat-window {
  position: absolute;
  bottom: 80px;
  right: 0;
  width: 380px;
  height: 600px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  transform: translateY(20px) scale(0.9);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}

.maya-chat-window.maya-open {
  transform: translateY(0) scale(1);
  opacity: 1;
  visibility: visible;
}

/* Enhanced Chat Header with AI branding */
.maya-chat-header {
  background: linear-gradient(135deg, var(--brand-color, #F2541D), #e04214);
  color: white;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}

.maya-header-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.maya-header-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.3);
  object-fit: cover;
}

.maya-header-text h4 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.maya-status {
  font-size: 11px;
  opacity: 0.9;
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.1);
  padding: 2px 6px;
  border-radius: 10px;
  margin-top: 2px;
}

.maya-close-btn {
  background: none;
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s;
}

.maya-close-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Enhanced Messages Container */
.maya-chat-messages {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  scroll-behavior: smooth;
  background: linear-gradient(to bottom, #f8f9fa, #f5f6f7);
}

.maya-chat-messages::-webkit-scrollbar {
  width: 4px;
}

.maya-chat-messages::-webkit-scrollbar-track {
  background: transparent;
}

.maya-chat-messages::-webkit-scrollbar-thumb {
  background: #ddd;
  border-radius: 2px;
}

/* Enhanced Messages with AI styling */
.maya-message {
  margin-bottom: 16px;
  animation: maya-fadeInUp 0.4s ease-out;
}

.maya-message-content {
  max-width: 85%;
  padding: 14px 18px;
  border-radius: 18px;
  position: relative;
  line-height: 1.5;
  word-wrap: break-word;
  font-size: 14px;
}

.maya-message-bot .maya-message-content {
  background: linear-gradient(145deg, #fff, #f8f9fa);
  color: #333;
  border: 1px solid #e1e8ed;
  border-bottom-left-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  position: relative;
}

/* AI message indicator */
.maya-message-bot .maya-message-content::before {
  content: '🤖';
  position: absolute;
  top: -8px;
  left: 12px;
  background: #fff;
  padding: 2px 4px;
  border-radius: 8px;
  font-size: 10px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.maya-message-user .maya-message-content {
  background: linear-gradient(145deg, var(--brand-color, #F2541D), #e04214);
  color: white;
  margin-left: auto;
  border-bottom-right-radius: 6px;
  box-shadow: 0 2px 8px rgba(242, 84, 29, 0.3);
}

.maya-message-time {
  font-size: 10px;
  opacity: 0.7;
  display: block;
  margin-top: 6px;
}

.maya-message-user .maya-message-time {
  text-align: right;
}

/* New message animation */
.maya-message-new {
  animation: maya-newMessagePulse 0.8s ease-out;
}

@keyframes maya-newMessagePulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.02); box-shadow: 0 0 20px rgba(242, 84, 29, 0.3); }
  100% { transform: scale(1); }
}

/* Enhanced Typing Indicator */
.maya-typing-indicator {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  background: linear-gradient(145deg, #fff, #f8f9fa);
  border-top: 1px solid #e1e8ed;
}

.maya-typing-dots {
  display: flex;
  gap: 4px;
}

.maya-typing-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(45deg, var(--brand-color, #F2541D), #e04214);
  animation: maya-typing 1.4s infinite ease-in-out;
}

.maya-typing-dots span:nth-child(1) { animation-delay: -0.32s; }
.maya-typing-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes maya-typing {
  0%, 80%, 100% {
    transform: scale(0.8);
    opacity: 0.5;
  }
  40% {
    transform: scale(1.2);
    opacity: 1;
  }
}

.maya-typing-text {
  font-size: 12px;
  color: #666;
  font-style: italic;
}

/* Enhanced Input Container */
.maya-chat-input-container {
  background: #fff;
  border-top: 1px solid #e1e8ed;
}

.maya-chat-input {
  display: flex;
  padding: 16px 20px;
  gap: 12px;
  align-items: flex-end;
}

#maya-message-input {
  flex: 1;
  border: 2px solid #e1e8ed;
  border-radius: 20px;
  padding: 12px 16px;
  font-size: 14px;
  outline: none;
  resize: none;
  font-family: inherit;
  transition: all 0.2s;
  background: #fafbfc;
}

#maya-message-input:focus {
  border-color: var(--brand-color, #F2541D);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(242, 84, 29, 0.1);
}

#maya-message-input:disabled {
  background: #f5f5f5;
  cursor: not-allowed;
}

.maya-send-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--brand-color, #F2541D), #e04214);
  border: none;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(242, 84, 29, 0.3);
}

.maya-send-btn:hover:not(:disabled) {
  background: linear-gradient(145deg, #e04214, #d63a12);
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(242, 84, 29, 0.4);
}

.maya-send-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Enhanced Quick Actions */
.maya-quick-actions {
  padding: 8px 20px 16px;
  display: flex;
  gap: 8px;
}

.maya-quick-btn {
  padding: 8px 16px;
  border: 1px solid #e1e8ed;
  background: linear-gradient(145deg, #fff, #f8f9fa);
  border-radius: 16px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 500;
}

.maya-quick-btn:hover {
  background: linear-gradient(145deg, var(--brand-color, #F2541D), #e04214);
  color: white;
  border-color: var(--brand-color, #F2541D);
  transform: translateY(-1px);
}

/* Enhanced Homestay Cards */
.maya-homestay-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 15px;
  max-width: 100%;
}

.maya-homestay-card {
  background: linear-gradient(145deg, #fff, #f8f9fa);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #e1e8ed;
  transition: all 0.3s ease;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.06);
  margin-bottom: 10px;
}

.maya-homestay-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
  border-color: var(--brand-color, #F2541D);
}

.maya-card-image {
  height: 120px;
  overflow: hidden;
  background: linear-gradient(45deg, #f5f5f5, #eee);
  position: relative;
}

.maya-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.maya-homestay-card:hover .maya-card-image img {
  transform: scale(1.05);
}

.maya-card-content {
  padding: 15px 16px;
}

.maya-card-content h4 {
  margin: 0 0 8px 0;
  font-size: 15px;
  font-weight: 600;
  color: #333;
  line-height: 1.3;
}

.maya-card-location {
  margin: 0 0 8px 0;
  font-size: 12px;
  color: #666;
  font-weight: 500;
}

.maya-card-excerpt {
  margin: 0 0 12px 0;
  font-size: 12px;
  color: #555;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.maya-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #f0f0f0;
}

.maya-card-price {
  font-size: 11px;
  color: var(--brand-color, #F2541D);
  font-weight: 600;
  background: linear-gradient(145deg, rgba(242, 84, 29, 0.1), rgba(242, 84, 29, 0.05));
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid rgba(242, 84, 29, 0.2);
}

.maya-card-link {
  font-size: 12px;
  color: var(--brand-color, #F2541D);
  text-decoration: none;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 8px;
  transition: all 0.2s;
  border: 1px solid transparent;
}

.maya-card-link:hover {
  background: linear-gradient(145deg, var(--brand-color, #F2541D), #e04214);
  color: white;
  border-color: var(--brand-color, #F2541D);
  text-decoration: none;
  transform: translateY(-1px);
}

/* Enhanced Animations */
@keyframes maya-fadeInUp {
  from {
    opacity: 0;
    transform: translateY(15px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Mobile Responsive Enhancements */
@media (max-width: 480px) {
  #maya-chatbot {
    bottom: 10px;
    right: 10px;
  }
  
  .maya-chat-window {
    width: calc(100vw - 20px);
    height: calc(100vh - 100px);
    bottom: 70px;
    right: -10px;
  }
  
  .maya-chat-button {
    width: 55px;
    height: 55px;
  }
  
  .maya-bot-icon {
    width: 30px;
    height: 30px;
  }
  
  .maya-homestay-card {
    margin-bottom: 8px;
  }
  
  .maya-card-image {
    height: 100px;
  }
  
  .maya-card-content {
    padding: 12px 14px;
  }
  
  .maya-header-text h4 {
    font-size: 14px;
  }
  
  .maya-status {
    font-size: 10px;
  }
}

/* Link Styles */
.maya-message-content a {
  color: var(--brand-color, #F2541D);
  text-decoration: none;
  font-weight: 500;
}

.maya-message-content a:hover {
  text-decoration: underline;
}

.maya-message-user .maya-message-content a {
  color: rgba(255, 255, 255, 0.9);
}

/* Text Formatting */
.maya-message-content strong {
  font-weight: 600;
}

.maya-message-content em {
  font-style: italic;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .maya-chat-window {
    background: #1a1a1a;
  }
  
  .maya-chat-messages {
    background: linear-gradient(to bottom, #2d2d2d, #262626);
  }
  
  .maya-message-bot .maya-message-content {
    background: linear-gradient(145deg, #3a3a3a, #333);
    color: #e1e1e1;
    border-color: #555;
  }
  
  .maya-chat-input-container {
    background: #1a1a1a;
    border-color: #555;
  }
  
  #maya-message-input {
    background: #3a3a3a;
    color: #e1e1e1;
    border-color: #555;
  }
  
  #maya-message-input:focus {
    background: #404040;
  }
  
  #maya-message-input:disabled {
    background: #2d2d2d;
  }
  
  .maya-homestay-card {
    background: linear-gradient(145deg, #3a3a3a, #333);
    border-color: #555;
  }
  
  .maya-card-content h4 {
    color: #e1e1e1;
  }
  
  .maya-quick-btn {
    background: linear-gradient(145deg, #3a3a3a, #333);
    color: #e1e1e1;
    border-color: #555;
  }
  
  .maya-typing-indicator {
    background: linear-gradient(145deg, #3a3a3a, #333);
    border-color: #555;
  }
}