/* Basic Reset + Previous Bubble Styles... */
#bubble-widget-container { margin: 0; padding: 0; box-sizing: border-box; font-family: sans-serif; }
.hidden { display: none !important; }

/* --- Bubble Widget Container --- */
#bubble-widget-container { position: fixed; bottom: 20px; right: 20px; z-index: 1000; }

/* --- Closed Bubble --- */
.bubble-toggle { display: flex; align-items: center; background-color: #7FA923; color: #fff; padding: 12px 24px; border-radius: 50px; cursor: pointer; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2); transition: transform 0.2s ease-out, box-shadow 0.2s ease-out; font-weight: 500; font-size: 16px; }
.bubble-toggle:hover { transform: scale(1.05); box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25); }
.Xbubble-icon { font-size: 22px; margin-right: 10px; background-color: #fff; color: #7FA923; border-radius: 50%; width: 30px; height: 30px; display: flex; justify-content: center; align-items: center; padding-bottom: 2px; }
.bubble-icon { font-size: 16px; margin-right: 10px; Xbackground-color: #fff; color: #fff; border-radius: 50%; width: 30px; height: 30px; display: flex; justify-content: center; align-items: center; padding-bottom: 2px; }

/* --- Open Bubble Window --- */
.bubble-window { width: 360px; height: 550px; background: linear-gradient(to bottom, #6a941e, #8cbd2b); border-radius: 15px; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3); display: flex; flex-direction: column; overflow: hidden; position: absolute; bottom: 0; right: 0; animation: slideUp 0.3s ease-out; }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* --- Bubble Header --- */
.bubble-header { background-color: rgba(0, 0, 0, 0.1); Xpadding: 15px 20px; color: white; display: flex; align-items: center; justify-content: space-between; min-height: 70px; flex-shrink: 0; /* Added */ }
.bubble-header-button { background: none; border: none; color: white; font-size: 18px; cursor: pointer; padding: 5px; width: 30px; text-align: center; }
.bubble-header-button.hidden { visibility: hidden; }
#bubble-header-content { text-align: center; flex-grow: 1; }
.bubble-header-spacer { width: 30px; height: 1px; }
.bubble-title { font-size: 1.2em; font-weight: normal; opacity: 0.9; }
.bubble-subtitle { font-size: 18px; font-weight: bold; }

/* --- Bubble Content Area --- */
.bubble-content { flex-grow: 1; /* padding: 20px; */ /* Padding handled by children now */ overflow: hidden; /* Prevent padding overflow */ display: flex; flex-direction: column; }

/* --- Initial View --- */
#bubble-initial-view { display: flex; flex-direction: column; height: 100%; padding: 20px; /* Add padding back here */ overflow-y: auto; /* Scroll if needed */ }
.bubble-questions-list { background-color: white; border-radius: 10px; margin-bottom: 15px; padding: 5px 0; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
.bubble-question-item { display: flex; justify-content: space-between; align-items: center; padding: 15px 20px; border: none; background: none; width: 100%; text-align: left; font-size: 15px; color: #333; cursor: pointer; border-bottom: 1px solid #eee; }
.bubble-question-item:last-child { border-bottom: none; }
.bubble-question-item:hover { background-color: #f9f9f9; }
.bubble-question-item i { color: #7FA923; font-size: 12px; }
.bubble-start-message-area { background-color: white; border-radius: 10px; padding: 12px 15px; display: flex; align-items: center; box-shadow: 0 1px 3px rgba(0,0,0,0.1); cursor: pointer; /* Not implemented yet */ }
.bubble-start-message-area:hover { background-color: #f9f9f9; }
.bubble-avatar-icon { font-size: 24px; color: #7FA923; margin-right: 10px; }
.bubble-send-message-text { flex-grow: 1; font-size: 14px; color: #555; }
.bubble-send-icon { font-size: 18px; color: #7FA923; }

/* --- Conversation View & Area --- */
#bubble-conversation-view { display: flex; flex-direction: column; height: 100%; background-color: white; border-radius: 10px; box-shadow: 0 1px 3px rgba(0,0,0,0.1); overflow: hidden; /* Contain children */ }
.bubble-conversation-area { flex-grow: 1; padding: 15px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; /* padding-bottom: 10px; */ /* Managed by flex */ }
/* Ensure first message aligns correctly */
.bubble-conversation-area > .bubble-message:first-child { margin-top: auto; }

/* --- Bubble Messages (General) --- */
.bubble-message { display: flex; flex-direction: column; max-width: 90%; /* Adjusted from chatbot.css */ word-wrap: break-word; line-height: 1.4; flex-shrink: 0; font-size: .9em; /* From chatbot.css */ }
.message-bubble { padding: 10px 15px; border-radius: 18px; /* From chatbot.css */ }
.message-meta { font-size: 11px; color: #888; margin-top: 4px; }

/* --- User Message Styling --- */
.bubble-message-user { background-color: #7FA923; /* From chatbot.css */ color: white; align-self: flex-end; border-bottom-right-radius: 5px; /* From chatbot.css */ /* Override bubble base */ padding: 10px 15px; border-radius: 18px; /* Needed again */ }
/* Target span inside if needed, or adjust formatText output */
.bubble-message-user span { color: white; }

/* --- Bot Message Styling --- */
.bubble-message-bot { background-color: #f1f1f3; /* From chatbot.css */ color: #333; align-self: flex-start; border-bottom-left-radius: 5px; /* From chatbot.css */ /* Override bubble base */ padding: 10px 15px; border-radius: 18px; /* Needed again */ }
.bubble-message-bot .message-meta { align-self: flex-start; margin-left: 5px; } /* Keep meta positioning */
/* Bot message content styling (from chatbot.css, adapted) */
.bubble-message-bot p { margin: 0.5em 0; line-height: 1.5; position: relative; }
.bubble-message-bot span.titleNum { float: left; margin-right: 10px; }
.bubble-message-bot span.titleTxt { display: flex; }
.bubble-message-bot span.price { display: block; padding-top: 0.2em; padding-left: 1.5em; }
.bubble-message-bot span.link { display: block; padding-top: 0.2em; padding-left: 1.5em; margin-bottom: 1em; }
.bubble-message-bot span.more-details-link { font-size: 1em; color: #0056b3; text-decoration: underline; cursor: pointer; outline: none; }
.bubble-message-bot span.more-details-link:hover,
.bubble-message-bot span.more-details-link:focus { color: #003d80; }
.bubble-message-bot p.follow-up { margin-top: 1.5em; padding-left: 16px; }
.bubble-message-bot ul { padding-left: 1.5em; /* Adjusted */ margin: 0.5em 0; }
.bubble-message-bot li { margin-bottom: 0.3em; }
/* Ensure links within bot messages are styled */
.bubble-message-bot a { color: #0056b3; text-decoration: underline; }
.bubble-message-bot a:hover { color: #003d80; }
.bubble-message-bot h3, .bubble-message-bot h4 { margin-top: 0.8em; margin-bottom: 0.4em; font-weight: 600; }

/* --- Loading Dots --- */
.bubble-message-bot.loading { padding: 12px 15px !important; /* Ensure padding is consistent */ background-color: #f1f1f3; /* Match bot bubble */ align-self: flex-start; border-bottom-left-radius: 5px; border-radius: 18px; }
.loading-dots { display: flex; align-items: center; height: 17px; /* Match height inside loading bubble */ }
.loading-dots .dot { display: inline-block; width: 8px; height: 8px; background-color: #555555; border-radius: 50%; margin: 0 3px; animation-name: bounce; animation-duration: 1.2s; animation-iteration-count: infinite; animation-timing-function: ease-in-out; }
.loading-dots .dot:nth-child(1) { animation-delay: 0s; }
.loading-dots .dot:nth-child(2) { animation-delay: 0.2s; }
.loading-dots .dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes bounce { 0%, 60%, 100% { transform: translateY(0); } 30% { transform: translateY(-8px); } }

/* --- Input Area --- */
.bubble-input-area { display: flex; align-items: center; padding: 10px 15px; border-top: 1px solid #ccc; /* Use bubble color */ background-color: #ffffff; flex-shrink: 0; /* From chatbot.css */ border-bottom-left-radius: 10px; /* Keep rounding */ border-bottom-right-radius: 10px; /* Keep rounding */ }
.bubble-user-input { flex-grow: 1; border: 1px solid #ddd; /* From chatbot.css */ border-radius: 18px; /* From chatbot.css */ padding: 8px 12px; /* From chatbot.css */ font-size: 1em; /* From chatbot.css */ margin-right: 10px; outline: none; }
.bubble-user-input:focus { border-color: #7FA923; /* Use bubble theme color */ }
#bubble-send-button { background: none; /* From chatbot.css */ border: none; padding: 5px; cursor: pointer; color: #7FA923; /* Use bubble theme color */ display: flex; align-items: center; justify-content: center; flex-shrink: 0; border-radius: 50%; transition: background-color 0.2s ease; width: 36px; /* Keep size */ height: 36px; /* Keep size */ }
#bubble-send-button:hover { background-color: rgba(127, 169, 35, 0.1); /* Light bubble green */ }
#bubble-send-button i { font-size: 16px; /* Adjust icon size if needed */ display: block; /* From chatbot.css svg rule */ }

/* --- Contact Form Styling (within bot message) --- */
#bubble-response-area p { font-size: 1rem; }
#bubble-response-area h3 { font-size: 1.1rem; }
#bubble-response-area h4 { margin:10px 0!important; font-size: 1.1rem!important; }
#bubble-response-area .bubble-contact-form-panel, #bubble-response-area .bubble-tracking-form-panel { background-color: #e7e7ea; /* Slightly different shade */ border: 1px solid #d1d9e1; border-radius: 12px; padding: 15px 20px; max-width: 95%; /* Allow slightly wider */ width: auto; /* align-self: flex-start; */ /* Already handled by parent */ box-shadow: 0 1px 3px rgba(0,0,0,0.05); box-sizing: border-box; position: relative; font-size: 0.9em; /* Adjust base size slightly */ line-height: 1.4; margin-top: 5px; /* Add space */ }
#bubble-response-area .bubble-contact-form-panel .bubble-contact-form-header, #bubble-response-area .bubble-tracking-panel .bubble-tracking-form-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; padding-bottom: 10px; border-bottom: 1px solid #d1d9e1; }
#bubble-response-area .bubble-contact-form-panel .bubble-contact-form-title, #bubble-response-area .bubble-tracking-form-panel .bubble-tracking-form-title { font-size: 1em; font-weight: 600; color: #333; margin-right: 20px; }
#bubble-response-area .bubble-contact-form-panel .bubble-close-form-button, #bubble-response-area .bubble-tracking-form-panel .bubble-close-tracking-form-button { position: absolute; top: 4px; right: 8px; background: none; border: none; font-size: 14px; line-height: 1; color: #aaa; cursor: pointer; padding: 2px 5px; transition: color 0.2s ease; z-index: 2; }
#bubble-response-area .bubble-contact-form-panel .bubble-close-form-button:hover, #bubble-response-area .bubble-tracking-form-panel .bubble-close-tracking-form-button:hover { color: #555; }
#bubble-response-area .bubble-contact-form-panel .bubble-contact-us-form, #bubble-response-area .bubble-tracking-form-panel .bubble-tracking-form { display: flex; flex-direction: column; gap: 12px; }
#bubble-response-area .bubble-contact-form-panel .bubble-contact-us-form label, #bubble-response-area .bubble-tracking-form-panel .bubble-tracking-form label { display: block; margin-bottom: 4px; font-size: 0.9em; /* Relative */ font-weight: 500; color: #555; }
#bubble-response-area .bubble-contact-form-panel .bubble-contact-us-form input[type="text"],
#bubble-response-area .bubble-contact-form-panel .bubble-contact-us-form input[type="email"],
#bubble-response-area .bubble-contact-form-panel .bubble-contact-us-form input[type="tel"],
#bubble-response-area .bubble-contact-form-panel .bubble-contact-us-form textarea,
#bubble-response-area .bubble-tracking-form-panel .bubble-tracking-form input[type="text"],
#bubble-response-area .bubble-tracking-form-panel .bubble-tracking-form input[type="email"],
#bubble-response-area .bubble-tracking-form-panel .bubble-tracking-form input[type="tel"],
#bubble-response-area .bubble-tracking-form-panel .bubble-tracking-form textarea { width: 100%; padding: 10px 12px; border: 1px solid #ccc; border-radius: 6px; font-size: 1em; /* Relative */ box-sizing: border-box; transition: border-color 0.2s ease; background-color: #fff; /* Ensure background */ }
#bubble-response-area .bubble-contact-form-panel .bubble-contact-us-form input:focus,
#bubble-response-area .bubble-contact-form-panel .bubble-contact-us-form textarea:focus,
#bubble-response-area .bubble-tracking-form-panel .bubble-tracking-form input:focus,
#bubble-response-area .bubble-tracking-form-panel .bubble-tracking-form textarea:focus { border-color: #7FA923; /* Theme color */ outline: none; }
#bubble-response-area .bubble-contact-form-panel .bubble-contact-us-form textarea, #bubble-response-area .bubble-tracking-form-panel .bubble-tracking-form textarea { min-height: 80px; resize: vertical; }
#bubble-response-area .bubble-contact-form-panel .bubble-contact-us-form button[type="submit"], #bubble-response-area .bubble-tracking-form-panel .bubble-tracking-form button[type="submit"] { background-color: #7FA923; /* Keep original blue for contrast */ color: white; border: none; padding: 10px 15px; border-radius: 6px; font-size: 1em; /* Relative */ font-weight: 500; cursor: pointer; transition: background-color 0.2s ease; margin-top: 5px; align-self: stretch; }
#bubble-response-area .bubble-contact-form-panel .bubble-contact-us-form button[type="submit"]:hover, #bubble-response-area .bubble-tracking-form-panel .bubble-tracking-form button[type="submit"]:hover { background-color: #93C91C; }
#bubble-response-area .bubble-contact-form-panel .bubble-contact-us-form button[type="submit"]:disabled, #bubble-response-area .bubble-tracking-form-panel .bubble-tracking-form button[type="submit"]:disabled { background-color: #a0cfff; cursor: not-allowed; }

/* --- Widget Close Button --- */
.bubble-close-button { position: absolute; bottom: 560px; /* Adjust if bubble size changes */ right: 0px; background-color: rgba(0, 0, 0, 0.5); color: white; border: none; border-radius: 50%; width: 35px; height: 35px; font-size: 18px; cursor: pointer; display: flex; justify-content: center; align-items: center; box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2); transition: background-color 0.2s ease; z-index: 1100; /* Above window */ }
.bubble-close-button:hover { background-color: rgba(0, 0, 0, 0.7); }

/* --- Scroll & Help Buttons CSS (Unchanged) --- */
.bubble-scroll-to-bottom { position: absolute; bottom: 70px; right: 6px; z-index: 50; background-color: rgba(255, 255, 255, 0.9); border: 1px solid #ddd; border-radius: 50%; width: 40px; height: 40px; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2); cursor: pointer; display: flex; align-items: center; justify-content: center; color: #555; opacity: 0; visibility: hidden; transform: translateY(10px); transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease; } 
.bubble-scroll-to-bottom.visible { opacity: 1; visibility: visible; transform: translateY(0); } 
.bubble-scroll-to-bottom:hover { background-color: rgba(240, 240, 240, 0.95); color: #333; } 
.bubble-scroll-to-bottom svg { display: block; width: 30px; height: 30px; }

/* Add these styles to your style.css file */

/* --- Header Menu Button (Adjust bubble-header-button if needed) --- */
#bubble-menu-button {
   /* Inherits from .bubble-header-button: background, border, color, cursor, padding, width, text-align */
   font-size: 20px; /* Adjust icon size */
}
#bubble-menu-button.hidden {
    display: none; /* Ensure it's truly hidden */
}

/* --- Options Menu Dropdown --- */
.bubble-options-menu {
  position: absolute;
  top: 60px; /* Adjust based on header height + desired gap */
  right: 15px;
  background-color: #ffffff;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  padding: 6px 0;
  min-width: 180px; /* Adjust width as needed */
  z-index: 1050; /* Above header/content, below close button */
  border: 1px solid #eee;
  /* display: none; */ /* Use hidden class */
}

.bubble-options-menu.visible { /* Class added by JS */
  display: block;
}

.bubble-menu-item {
  display: flex;
  align-items: center;
  gap: 12px; /* Space between icon and text */
  padding: 10px 15px;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.95em;
  color: #333;
  transition: background-color 0.15s ease-in-out;
  box-sizing: border-box;
}

.bubble-menu-item:hover {
  background-color: #f1f1f3;
}

.bubble-menu-item i {
  flex-shrink: 0;
  width: 20px; /* Icon container width */
  text-align: center;
  font-size: 16px; /* Icon size */
  color: #555;
}

/* --- Responsive --- */
@media (max-width: 480px) {
  #bubble-widget-container { bottom: 10px; right: 10px; }
  .bubble-window { width: calc(100vw - 20px); height: calc(100vh - 80px); max-width: 360px; max-height: 600px; /* Increased max height slightly */ bottom: 0; right: 0; border-radius: 15px; }
  .bubble-close-button { top: -45px; bottom: auto; right: 5px; }
  /* Adjust message width on mobile */
  .bubble-message { max-width: 90% !important; }
  /* Adjust contact form padding/width on mobile */
   .bubble-message-bot .bubble-contact-form-panel, .bubble-message-bot .bubble-tracking-form-panel { padding: 15px; max-width: 98%; }
   .bubble-message-bot .bubble-contact-form-panel .contact-us-form button[type="submit"], .bubble-message-bot .bubble-tracking-form-panel .tracking-form button[type="submit"] { padding: 12px 15px; }
}
