/* Floating Button */

#chat-button {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #2e7d32;
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 56px;
  height: 56px;
  font-size: 22px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  z-index: 1000;
  transition: transform 0.2s ease, background 0.2s ease;
}

#chat-button:hover {
  transform: scale(1.1);
  background: #1b5e20;
}

/* Chat Widget */
#chat-widget {
  display: none;
  position: fixed;
  bottom: 0;                 /* stick to bottom */
  right: 0;
  width: 320px;
  height: 70vh;              /* scale with viewport height */
  max-height: 600px;         /* cap on larger screens */
  background: #f9fbe7;
  border: 1px solid #c5e1a5;
  border-radius: 12px 12px 0 0; /* rounded top corners */
  box-shadow: 0 6px 18px rgba(0,0,0,0.3);

  flex-direction: column;
  font-family: 'Open Sans', sans-serif;
  z-index: 999;
  overflow: hidden;
  animation: chat-slideUp 0.3s ease-out;
}



@keyframes chat-slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Header */
#chat-widget .chat-header {
  background-color: #2e7d32;
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 8px;
}

#chat-widget .chat-title {
  display: flex;
  flex-direction: column;
}

#chat-widget .language-indicator {
  font-size: 0.85em;
  color: #fff;
  opacity: 0.9;
  margin-top: 2px;
}

#chat-widget #chat-close {
  cursor: pointer;
  font-size: 16px;
  border: none;
  background: transparent;
  color: #fff;
  align-self: flex-start;
}

/* Chat Body */
#chat-body {
  flex: 1;
  padding: 10px;
  overflow-y: auto;
  background: #f9f9f9;
}

/* Messages */
#chat-body .bot-message,
#chat-body .user-message {
  padding: 10px 14px;
  margin: 6px 10px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.4;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  max-width: 80%;
}

#chat-body .bot-message {
  background: #e8f5e9;
  align-self: flex-start;
}

#chat-body .user-message {
  background: #c5e1a5;
  align-self: flex-end;
  text-align: right;
}

/* Footer */
#chat-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  border-top: 1px solid #c5e1a5;
  padding: 10px;
  background: #eee;
  gap: 10px;
  position: relative;
}

#chat-input {
  flex: 1;
  border: 1px solid #ccc;
  padding: 10px;
  border-radius: 8px;
  outline: none;
  font-size: 14px;
}

* Default desktop layout stays side-by-side */
.chat-actions {
  display: flex;
  flex-direction: row;
  gap: 6px;
}

/* Send button */
#chat-send {
  background: #388e3c;
  color: #fff;
  border: none;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s ease;
}

#chat-send:hover {
  background: #2e7d32;
}

/* Speak button */
#chat-speak {
  background-color: #4CAF50;
  color: #fff;
  border: none;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s ease;
}

#chat-speak:hover {
  background-color: #45a049;
}

/* Listen button */
#chat-listen {
  background-color: #2196F3;
  color: #fff;
  border: none;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s ease;
  align-self: flex-start;
  min-width: 70px;
  flex-shrink: 0;
}

#chat-listen:hover {
  background-color: #1976D2;
}

/* Language dropdown */
#language-select {
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid #ccc;
  font-size: 14px;
  background-color: #f9f9f9;
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

#language-select:hover {
  background-color: #f1f1f1;
}

#language-select:focus {
  outline: none;
  border-color: #4CAF50;
}

/* Label */
#chat-label {
  position: fixed;
  bottom: 70px;
  right: 90px;
  background: rgba(46, 125, 50, 0.85);
  color: #fff;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-family: 'Open Sans', sans-serif;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
  z-index: 1000;
}

.hidden {
  display: none !important;
}

/* Responsive */
@media (max-width: 400px) {
  #chat-footer {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
    padding: 0.5rem;
  }

  #chat-actions {
    flex-direction: row;
    justify-content: space-between;
    gap: 0.5rem;
  }

  /* Make all chat-actions groups stack vertically */
  .chat-actions {
    display: flex;
    flex-direction: column; /* stack buttons top to bottom */
    gap: 0.5rem;            /* spacing between each button */
  }

  #chat-send,
  #chat-listen,
  #chat-speak,
  #language-select {
    width: 100%;       /* full width like Send button */
    min-height: 40px;  /* touch-friendly size */
    font-size: 0.9rem;
  }
}



/* Landing page chat footer */
.lp-chat-footer {
  padding: 12px;
  border-top: 1px solid #ccc;
  background: #f9f9f9;
}

/* Input row: text box + send inline */
.lp-chat-input-row {
  display: flex;
  gap: 8px;
  width: 100%;
}

.lp-chat-input {
  flex: 1;
  padding: 14px;
  font-size: 16px;
  border: 1px solid #ccc;
  border-radius: 8px;
}

.lp-chat-send {
  background: #388e3c;
  color: white;
  border: none;
  padding: 14px 20px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.lp-chat-send:hover {
  background: #2e7d32;
}

/* Secondary row: buttons + dropdown inline (desktop default) */
.lp-chat-secondary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin-top: 10px;
}

.lp-chat-secondary button,
.lp-chat-secondary select {
  flex: 1;
  padding: 12px;
  border-radius: 8px;
  font-size: 14px;
}

/* Specific styles */
.lp-chat-listen {
  background-color: #2196F3;
  color: white;
  border: none;
  cursor: pointer;
}

.lp-chat-listen:hover {
  background-color: #1976D2;
}

.lp-chat-speak {
  background-color: #4CAF50;
  color: white;
  border: none;
  cursor: pointer;
}

.lp-chat-speak:hover {
  background-color: #45a049;
}

.lp-chat-language {
  border: 1px solid #ccc;
  background-color: #f9f9f9;
  cursor: pointer;
}

.lp-chat-language:focus {
  border-color: #4CAF50;
}

.lp-chat-secondary {
  display: flex;
  gap: 10px; /* space between items */
}

/* Popup card */
/*
.popup-content {
  background: #fff;
  padding: 20px;
  border-radius: 8px;
  max-width: 600px;  
  width: 90%;         
  margin: 50px auto;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
} */
.popup-content {
  background: white;
  width: 380px;
  height: 90vh;
  margin-right: 20px;
  border-radius: 20px;
  padding: 25px;
  box-shadow: -10px 0 30px rgba(0,0,0,0.2);
  pointer-events: auto; /* Re-enable clicks for form elements */
  overflow-y: auto;
  animation: slideIn 0.3s ease-out;
}
#resume-booking {
  display: none; /* Controlled by JS */
  position: fixed;
  bottom: 30px; 
  left: 20px;
  
  /* FIXED: This ensures it only takes up as much space as the text needs */
  width: fit-content; 
  white-space: nowrap; /* Prevents text from wrapping to a second line */
  
  background: #2e7d32;
  color: white;
  padding: 12px 22px;
  border-radius: 50px;
  cursor: pointer;
  z-index: 3000;
  box-shadow: 0 4px 15px rgba(0,0,0,0.4);
  font-weight: bold;
  
  /* Layout logic for the icon and text */
  display: flex; 
  align-items: center;
  gap: 10px;
  
  border: 1px solid rgba(255,255,255,0.2);
  transition: all 0.3s ease;
}
/* Mobile adjustments */
@media (max-width: 480px) {
  .popup-content {
    width: 100%;
    max-width: none;
    margin: 0;
    border-radius: 12px 12px 0 0; /* rounded top corners */
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 80vh;              /* taller on mobile */
    overflow-y: auto;          /* allow scrolling if content overflows */
    animation: slideUp 0.3s ease-out;
  }
  #resume-booking {
    /* Move to Top-Center for Mobile */
    bottom: auto !important;
    top: 20px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    
    /* Style it as a clear notification pill */
    width: 90%;
    max-width: 300px;
    justify-content: center;
    background: #2e7d32;
    padding: 10px 15px;
    font-size: 14px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
    z-index: 5000; /* Above everything */
    border: 2px solid #fff;
  }
  #resume-booking {
    animation: slideDownFade 0.5s ease-out, pulse-glow 2s infinite;
  }
  /* Chat widget tweaks for mobile */
  #chat-widget {
    width: 100%;
    max-width: none;
    height: 75vh;              /* use most of viewport height */
    bottom: 0;
    right: 0;
    border-radius: 12px 12px 0 0;
  }

  #chat-body {
    flex: 1;
    min-height: 200px;         /* ensure usable chat space */
    overflow-y: auto;
  }
  #resume-booking {
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    bottom: 20px;
    justify-content: center;
  }
}


@keyframes slideUp {
  from { transform: translateY(100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes slideDownFade {
  from { transform: translate(-50%, -20px); opacity: 0; }
  to { transform: translate(-50%, 0); opacity: 1; }
}

@keyframes pulse-glow {
  0% { box-shadow: 0 0 0 0 rgba(46, 125, 50, 0.7); }
  70% { box-shadow: 0 0 0 10px rgba(46, 125, 50, 0); }
  100% { box-shadow: 0 0 0 0 rgba(46, 125, 50, 0); }
}

.error-toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #ff4d4d;
  color: white;
  padding: 10px 15px;
  border-radius: 5px;
  font-size: 14px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  z-index: 9999;
}

.chat-message.bot select {
  margin-top: 8px;
  padding: 6px;
  border-radius: 6px;
  border: 1px solid #ccc;
  font-size: 14px;
}
/* Overlay behind the popup */
/* Overlay */
#booking-popup {
  display: none; /* hidden by default */
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.5); /* translucent dark overlay */
  z-index: 9999;
}

#booking-popup h2 {
  margin-top: 0;
}
/*
.popup-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.5); 
  display: none; 
  z-index: 9999;
} */

/* Container for the side-panel effect */
.popup-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.3);
  display: none;
  z-index: 1000;
  justify-content: flex-end; /* Align form to the right */
  align-items: center;
  pointer-events: none; /* Allow clicks to pass to the chat behind */
}
/* Villa dropdown container */
.villa-dropdown-container {
  margin: 12px 0;
  padding: 10px;
  background: #f1f8e9; /* soft green background */
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

/* Villa dropdown label */
.villa-label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  color: #2e7d32;
  font-size: 14px;
}

/* Villa dropdown select */
.villa-select {
  width: 100%;
  padding: 8px;
  border: 1px solid #c5e1a5;
  border-radius: 6px;
  font-size: 14px;
  background-color: #fff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.villa-select:focus {
  border-color: #388e3c;
  box-shadow: 0 0 4px rgba(56,142,60,0.4);
  outline: none;
}
#typing-indicator {
  padding: 5px 10px;
  font-style: italic;
  color: gray;
}

.horizontal-scroll {
  scrollbar-width: thin;
  scrollbar-color: #2e7d32 transparent;
  -webkit-overflow-scrolling: touch; /* smooth momentum scroll on iOS */
}

.horizontal-scroll::-webkit-scrollbar {
  height: 6px;
}

.horizontal-scroll::-webkit-scrollbar-thumb {
  background-color: #2e7d32;
  border-radius: 10px;
}

.gallery-wrapper img:hover {
  transform: scale(1.05);
  transition: transform 0.3s ease;
}

/* Specific style for the typing bubble */
.typing-indicator {
  background: rgba(255, 255, 255, 0.7);
  font-style: italic;
  font-size: 0.9rem;
  color: #2e7d32;
  display: none; /* Hidden by default */
  padding: 8px 15px;
  border-radius: 15px 15px 15px 2px;
  margin-bottom: 10px;
  align-self: flex-start;
  width: fit-content;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

@keyframes slideIn {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}
/* Base state (Centered) */
#bot-page {
  margin: 100px auto 20px auto; /* 'auto' handles the centering */
  max-width: 800px;
  transition: all 0.4s ease;
}
/* Side-by-Side state (Shifted) */
#bot-page.side-by-side {
  margin-left: 5% !important; /* Force it to the left */
  margin-right: auto;
  max-width: 500px; /* Shrink it to make room */
}

@keyframes slideInFromLeft {
  from { transform: translateX(-100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
#resume-booking:hover {
  background: #1b5e20;
  transform: scale(1.05);
  transition: transform 0.2s;
}
/* When the booking side-panel is open, move the widget to the left */
#chat-widget.side-by-side {
  right: auto;        /* Disable the right: 0 */
  left: 20px;         /* Move to the left side of the screen */
  bottom: 20px;
  width: 350px;       /* Slightly wider for easier reading */
  transition: all 0.4s ease;
  z-index: 2005;      /* Ensure it stays above the booking overlay */
}