/* ==========================================
   WanderLand AI Chat Widget — Premium Redesign
   ========================================== */

/* Chat Widget Container */
.chat-widget {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 99999;
  font-family: "Plus Jakarta Sans", sans-serif;
  pointer-events: auto;
}

/* ========== Toggle Button (Premium 3D) ========== */
.chat-toggle-btn {
  width: 65px;
  height: 65px;
  border-radius: 22px; /* Squircle */
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: linear-gradient(135deg, #fe424d, #e63946);
  color: white;
  font-size: 1.6rem;
  cursor: pointer;
  position: relative;
  box-shadow: 
    0 10px 30px rgba(254, 66, 77, 0.3),
    inset 0 0 15px rgba(255, 255, 255, 0.3);
  transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  transform-style: preserve-3d;
}

.chat-toggle-btn:hover {
  transform: translateY(-5px) rotateX(10deg) rotateY(-10deg) scale(1.05);
  box-shadow: 0 15px 40px rgba(254, 66, 77, 0.4);
}

.chat-toggle-btn:active {
  transform: scale(0.95);
}

.chat-toggle-icon,
.chat-toggle-close {
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

/* Pulse animation (Softer) */
.chat-pulse {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 22px;
  background: rgba(254, 66, 77, 0.2);
  animation: chatPulse 2.5s infinite;
  pointer-events: none;
  z-index: -1;
}

@keyframes chatPulse {
  0% { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(1.6); opacity: 0; }
}

/* ========== Chat Panel (Glassmorphism) ========== */
.chat-panel {
  position: absolute;
  bottom: 85px;
  right: 0;
  width: 380px;
  height: 600px;
  max-height: calc(100vh - 120px);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(25px) saturate(180%);
  -webkit-backdrop-filter: blur(25px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 35px;
  box-shadow: 
    0 25px 50px rgba(0, 0, 0, 0.1),
    inset 0 0 20px rgba(255, 255, 255, 0.5);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.8) translateY(40px);
  opacity: 0;
  transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
  transform-origin: bottom right;
  pointer-events: none;
}

.chat-panel.show {
  transform: scale(1) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

/* ========== Chat Header ========== */
.chat-header {
  padding: 24px 28px;
  background: rgba(255, 255, 255, 0.4);
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chat-header-info {
  display: flex;
  align-items: center;
  gap: 15px;
}

.chat-avatar {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: linear-gradient(135deg, #fe424d, #e63946);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.3rem;
  box-shadow: 0 5px 15px rgba(254, 66, 77, 0.2);
}

.chat-header-title {
  font-weight: 800;
  font-size: 1.1rem;
  margin: 0;
  color: #1a1a1a;
}

.chat-status {
  font-size: 0.75rem;
  font-weight: 600;
  color: #666;
  display: flex;
  align-items: center;
  gap: 6px;
}

.chat-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #2ecc71;
  box-shadow: 0 0 10px #2ecc71;
}

.chat-minimize-btn {
  background: rgba(0, 0, 0, 0.05);
  border: none;
  color: #333;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.chat-minimize-btn:hover {
  background: rgba(254, 66, 77, 0.1);
  color: #fe424d;
}

/* ========== Messages Area ========== */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 25px;
  scroll-behavior: smooth;
}

.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.1); border-radius: 10px; }

/* Bot Message (Neumorphic Glass) */
.bot-message .message-bubble {
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.8);
  color: #2c3e50;
  border-radius: 5px 22px 22px 22px;
  padding: 15px 18px;
  font-size: 0.92rem;
  line-height: 1.6;
  box-shadow: 5px 5px 15px rgba(0, 0, 0, 0.03);
  margin-bottom: 5px;
}

/* User Message (Gradient) */
.user-message .message-bubble {
  background: linear-gradient(135deg, #fe424d, #e63946);
  color: white;
  border-radius: 22px 5px 22px 22px;
  padding: 14px 20px;
  font-size: 0.92rem;
  font-weight: 500;
  box-shadow: 0 8px 20px rgba(254, 66, 77, 0.2);
}

.message-time {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #999;
  margin-top: 5px;
  display: block;
}

/* ========== Suggestions (Chips) ========== */
.chat-suggestions {
  padding: 0 25px 15px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  white-space: nowrap;
}

.chat-suggestions::-webkit-scrollbar { display: none; }

.suggestion-chip {
  background: white;
  border: 1px solid rgba(0,0,0,0.05);
  color: #1a1a1a;
  padding: 8px 16px;
  border-radius: 50px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 10px rgba(0,0,0,0.03);
}

.suggestion-chip:hover {
  background: #fe424d;
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(254, 66, 77, 0.2);
}

/* ========== Input Area (Premium) ========== */
.chat-input-area {
  padding: 20px 25px 25px;
  background: rgba(255, 255, 255, 0.4);
  border-top: 1px solid rgba(255, 255, 255, 0.3);
}

.chat-form {
  background: white;
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 20px;
  padding: 6px 6px 6px 20px;
  display: flex;
  align-items: center;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
}

.chat-form:focus-within {
  transform: translateY(-2px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.08);
  border-color: rgba(254, 66, 77, 0.3);
}

.chat-input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  padding: 10px 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: #333;
}

.chat-send-btn {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: linear-gradient(135deg, #fe424d, #e63946);
  color: white;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
}

.chat-send-btn:hover {
  transform: scale(1.05) rotate(5deg);
}

/* ========== Guest View ========== */
.chat-login-cta {
  padding: 30px;
  text-align: center;
}

.chat-login-btn {
  background: linear-gradient(135deg, #fe424d, #e63946);
  color: white !important;
  padding: 14px 30px;
  border-radius: 50px;
  font-weight: 800;
  font-size: 0.95rem;
  text-decoration: none !important;
  display: inline-block;
  box-shadow: 0 10px 20px rgba(254, 66, 77, 0.2);
  transition: all 0.3s ease;
}

.chat-login-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 15px 30px rgba(254, 66, 77, 0.3);
}

/* ========== Mobile Adjustments ========== */
@media (max-width: 480px) {
  .chat-widget { bottom: 20px; right: 20px; }
  .chat-panel {
    width: calc(100vw - 40px);
    right: 0;
    border-radius: 30px;
  }
}
