/* --- Chatbot UI Styles --- */
.chatbot-container { /* Wrapper for bubble and context text */
    position: fixed;
    bottom: 25px;
    right: 25px;
    z-index: 1001;
    display: flex;
    align-items: center;
    gap: 10px;
}

#chat-bubble {
    background-color: var(--primary-color);
    color: white;
    width: 65px;
    height: 65px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 30px; /* Adjust if using SVG */
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
    flex-shrink: 0; /* Prevent shrinking */
    animation: gentle-pulse 3s infinite ease-in-out;
}

@keyframes gentle-pulse {
    0% { transform: scale(1); box-shadow: 0 8px 20px rgba(0,0,0,0.3); }
    50% { transform: scale(1.04); box-shadow: 0 10px 22px rgba(0,0,0,0.35); }
    100% { transform: scale(1); box-shadow: 0 8px 20px rgba(0,0,0,0.3); }
}


#chat-bubble:hover {
    transform: scale(1.08); /* Keep hover scale slightly larger */
    box-shadow: 0 12px 25px rgba(0,0,0,0.4);
    background-color: var(--secondary-color);
    animation-play-state: paused; /* Pause animation on hover */
}
#chat-bubble svg { /* Style for SVG icon if used */
    width: 32px;
    height: 32px;
    fill: currentColor;
}


.chat-context-text {
    background-color: rgba(0, 90, 91, 0.9); /* Semi-transparent background */
    color: white;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    transform: translateX(10px);
    transition: opacity 0.3s ease 0.1s, transform 0.3s ease 0.1s; /* ADDED slight delay */
    pointer-events: none; /* Don't block bubble clicks */
}
/* Show context text on hover of the container */
.chatbot-container:hover .chat-context-text {
    opacity: 1;
    transform: translateX(0);
}


#chat-window {
    position: fixed;
    bottom: 100px;
    right: 25px;
    width: 360px;
    height: 500px;
    background-color: white;
    border-radius: 15px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 1000;
    transform: scale(0.8) translateY(20px);
    transform-origin: bottom right;
    opacity: 0;
    visibility: hidden;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.2s ease, visibility 0s 0.3s linear;
}

#chat-window.open {
    transform: scale(1) translateY(0);
    opacity: 1;
    visibility: visible;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s ease, visibility 0s 0s linear;
}

.chat-header {
    background-color: var(--primary-color);
    color: white;
    padding: 15px 20px;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

#chat-close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 26px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    margin-left: 10px;
    opacity: 0.8;
    transition: color 0.2s, opacity 0.2s, transform 0.2s;
}

#chat-close-btn:hover {
    color: var(--accent-color);
    opacity: 1;
    transform: rotate(90deg);
}

.chat-messages {
    flex-grow: 1;
    padding: 20px 15px;
    overflow-y: auto;
    background-color: var(--light-gray);
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.chat-messages::-webkit-scrollbar { width: 6px; }
.chat-messages::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 3px; }
.chat-messages::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }
.chat-messages::-webkit-scrollbar-thumb:hover { background: #aaa; }


/* --- FIX: Updated Chat Message & Avatar Styles --- */
.chat-msg { /* Renamed from .chat-message for clarity */
    display: flex; /* Use flex for layout */
    max-width: 85%;
    margin-bottom: 8px; /* Consistent margin */
    align-items: flex-end; /* Align avatar and bubble bottom */
}

/* User Message Alignment */
.user-msg {
    align-self: flex-end;
    flex-direction: row-reverse; /* Put content first */
}

/* Bot Message Alignment */
.bot-msg {
    align-self: flex-start;
}

/* Avatar Styling */
.chat-avatar {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    border-radius: 50%;
    background-color: #f0f0f0; /* Default background */
    padding: 6px;
    box-sizing: border-box;
    color: var(--secondary-color); /* Default icon color */
    margin-right: 10px; /* Space between avatar and bot message */
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}
.user-msg .chat-avatar { /* Hide avatar for user */
    display: none;
}

.chat-avatar svg { /* Style SVGs inside avatar */
    width: 100%;
    height: 100%;
    fill: currentColor; /* Inherit color from parent .avatar */
}

/* Message Content Styling */
.chat-msg-content {
    padding: 10px 14px;
    border-radius: var(--border-radius-lg);
    word-wrap: break-word;
    font-size: 0.95rem;
    line-height: 1.5;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.bot-msg .chat-msg-content {
    background-color: var(--white);
    color: var(--text-color-dark);
    border-bottom-left-radius: 0; /* Pointy corner */
}

.user-msg .chat-msg-content {
    background-color: var(--primary-color);
    color: var(--white-color);
    border-bottom-right-radius: 0; /* Pointy corner */
    margin-right: 10px; /* Space between user message and edge */
}
/* --- END FIX --- */

/* --- *** START: TYPING INDICATOR STYLES (REPLACED) *** --- */
/* This rule is kept from your original file */
.bot-msg.loading .chat-msg-content { /* Target loading bot messages specifically */
    background-color: var(--white); /* Match bot bubble background */
    padding: 12px 16px; /* Adjust padding for spinner */
}

/* This is the new rule for the container */
.typing-indicator {
  display: flex;
  padding: 10px 0; /* Gives it some space - adjust as needed */
  /* We removed justify-content: center; so it aligns left in the bubble */
}

/* This REPLACES your old span rules */
.typing-indicator span {
  height: 8px;
  width: 8px;
  background-color: #9ca3af; /* A neutral gray, change as needed */
  border-radius: 50%;
  display: inline-block;
  margin: 0 1px;
  
  /* The animation magic */
  animation-name: bounce;
  animation-duration: 1.4s;
  animation-iteration-count: infinite;
  animation-fill-mode: both;
}

.typing-indicator span:nth-child(1) {
  animation-delay: 0.2s;
}

.typing-indicator span:nth-child(2) {
  animation-delay: 0.4s;
}

.typing-indicator span:nth-child(3) {
  animation-delay: 0.6s;
}

/* This REPLACES your old @keyframes rule */
@keyframes bounce {
  0%, 80%, 100% {
    transform: scale(0);
  }
  40% {
    transform: scale(1.0);
  }
}
/* --- *** END: TYPING INDICATOR STYLES (REPLACED) *** --- */


/* Chat Options Container */
#chat-options {
    padding: 8px 15px 15px 15px; /* Add padding around options */
    display: flex;
    gap: 8px;
    overflow-x: auto; /* Allow horizontal scroll if needed */
    flex-wrap: nowrap; /* Prevent wrapping */
    align-items: flex-start; /* Align tops */
    scrollbar-width: thin; /* Firefox */
    scrollbar-color: #ccc #f0f0f0; /* Firefox */
}
#chat-options::-webkit-scrollbar { height: 6px; }
#chat-options::-webkit-scrollbar-track { background: #f0f0f0; border-radius: 3px; }
#chat-options::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }
#chat-options::-webkit-scrollbar-thumb:hover { background: #aaa; }


/* Individual Chat Option Button */
.chat-option {
    background-color: var(--white-color);
    border: 1px solid var(--secondary-color);
    color: var(--secondary-color);
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap; /* Keep text on one line */
    transition: background-color 0.2s, color 0.2s, transform 0.1s ease;
    flex-shrink: 0; /* Prevent buttons from shrinking */
}

.chat-option:hover {
    background-color: var(--secondary-color);
    color: var(--white-color);
    transform: translateY(-1px);
}


/* List styles inside chat */
.chat-list {
    padding-left: 20px;
    margin-top: 5px;
    margin-bottom: 5px;
}
.chat-list li {
    margin-bottom: 4px;
}

/* Links within Messages (Updated) */
.chat-msg-content a { /* Target all links in message content */
    color: var(--secondary-color); /* Use secondary color for links */
    text-decoration: underline;
    font-weight: 600;
}
/* Ensure user message links are readable */
.user-msg .chat-msg-content a {
    color: #e0f2f7; /* Lighter teal for user messages */
}

.chat-msg-content a:hover {
    color: var(--accent-color);
}
.user-msg .chat-msg-content a:hover {
    color: #fff; /* White on hover for user messages */
}

/* Specific Link Button Styles */
.chat-booking-link, .chat-pdf-link {
    display: inline-block;
    margin-top: 10px;
    padding: 8px 15px;
    background-color: var(--accent-color);
    color: var(--white-color) !important; /* Override default link color */
    text-decoration: none !important; /* Override default link underline */
    border-radius: var(--border-radius-main);
    font-weight: 600;
    font-size: 0.9rem;
    transition: background-color 0.2s, transform 0.1s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.chat-booking-link:hover, .chat-pdf-link:hover {
    background-color: #C0904D;
    transform: translateY(-1px);
}

.chat-calendar-links { margin-top: 12px; display: flex; gap: 10px; flex-wrap: wrap;}
.chat-calendar-link {
    display: inline-block;
    padding: 6px 12px;
    font-size: 0.85rem;
    font-weight: 500;
    background-color: #f0f0f0;
    color: var(--primary-color) !important;
    text-decoration: none !important;
    border-radius: var(--border-radius-main);
    border: 1px solid #ddd;
    transition: background-color 0.2s, box-shadow 0.1s ease;
}
.chat-calendar-link:hover { background-color: #e0e0e0; box-shadow: 0 1px 2px rgba(0,0,0,0.1); }

/* Chat Feedback Buttons */
.chat-feedback {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    margin-left: 54px; /* Align with message content */
}
.feedback-btn {
    background: #e0e0e0;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s, transform 0.1s ease;
}
.feedback-btn:hover {
    background: #ccc;
    transform: scale(1.1);
}
.feedback-btn:disabled {
    cursor: default;
    opacity: 0.7;
}
.feedback-btn.selected {
    background-color: var(--secondary-color);
    color: white;
}


/* Chat Input Area */
.chat-input-container {
    display: flex;
    align-items: center; /* Vertically align items */
    padding: 12px 15px;
    background-color: var(--white-color);
    border-top: 1px solid #ddd;
    flex-shrink: 0;
}

#chat-input {
    flex-grow: 1;
    border: 1px solid #ccc;
    border-radius: 22px;
    padding: 12px 18px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-size: 1rem;
    margin-right: 10px; /* Space between input and mic */
}
#chat-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 90, 91, 0.2);
}

/* Microphone button styles */
#chat-mic-btn {
    border: none;
    background: none;
    padding: 0;
    margin: 0 8px 0 0; /* Space between mic and send */
    cursor: pointer;
    color: var(--secondary-color); /* Match link color */
    width: 44px; /* Match send button size */
    height: 44px; /* Match send button size */
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease, color 0.2s ease;
}
#chat-mic-btn:hover {
    background-color: #f0f0f0; /* Light hover background */
}
#chat-mic-btn.recording { /* Style when actively recording */
    background-color: #ffebee; /* Light red background */
    color: #c62828; /* Red icon */
    animation: pulse-mic 1.5s infinite ease-in-out;
}
@keyframes pulse-mic {
    0% { box-shadow: 0 0 0 0 rgba(229, 57, 53, 0.4); } /* Red with transparency */
    70% { box-shadow: 0 0 0 10px rgba(229, 57, 53, 0); }
    100% { box-shadow: 0 0 0 0 rgba(229, 57, 53, 0); }
}
#chat-mic-btn svg {
    width: 22px; /* Slightly larger icon */
    height: 22px;
    fill: currentColor;
}


#chat-send {
    border: none;
    background-color: var(--primary-color);
    color: var(--white-color);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s, transform 0.1s ease;
    flex-shrink: 0; /* Prevent button shrinking */
}
#chat-send:hover {
    background-color: var(--secondary-color);
    transform: scale(1.05);
}
#chat-send svg {
     width: 20px; height: 20px; fill: currentColor;
}


/* --- Back to Top Button --- */
/* This is intentionally left in chatbot.css because its position
   is relative to the chat bubble. */
#back-to-top {
    position: fixed;
    bottom: 25px;
    right: 100px; /* Adjust if needed based on bubble size */
    background-color: rgba(0, 122, 124, 0.8); /* Use secondary, slightly transparent */
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 24px;
    cursor: pointer;
    z-index: 1002;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0s 0.3s linear, transform 0.3s ease, background-color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}
#back-to-top.visible {
     opacity: 1;
     visibility: visible;
     transition: opacity 0.3s ease, visibility 0s 0s linear, transform 0.3s ease, background-color 0.2s ease;
 }
#back-to-top:hover { background-color: var(--primary-color); transform: scale(1.1); }

/* --- Chatbot-specific Responsive Adjustments --- */
@media (max-width: 900px) { /* Tablet and smaller */
     #back-to-top { right: 90px; } /* Adjust position relative to bubble */
}

@media (max-width: 768px) { /* Mobile */
    /* Chat responsive */
    .chatbot-container { right: 15px; bottom: 15px; } /* Adjust position */
    #chat-window {
        width: calc(100% - 30px);
        height: calc(85% - 80px); /* Adjust height */
        max-width: 400px;
        max-height: 600px; /* Increase max height */
        bottom: 80px; /* Position above bubble */
        right: 15px;
        left: 15px;
        margin: 0 auto;
        transform-origin: bottom center;
    }
     #chat-bubble { width: 60px; height: 60px; font-size: 28px; bottom: 15px; right: 15px; }
     #back-to-top { right: 85px; bottom: 15px; width: 45px; height: 45px; }
     .chat-context-text { display: none; } /* Hide context text on mobile */

}

@media (max-width: 480px) { /* Small mobile */
     #back-to-top { display: none; }
     #chat-window {
         height: calc(100% - 80px); /* Taller on small screens */
         max-height: none;
         bottom: 70px; /* Closer to bubble */
         border-radius: 10px 10px 0 0; /* Adjust radius */
     }
     #chat-bubble { width: 55px; height: 55px; font-size: 26px; }
}

/* --- STYLES FOR HERO IMAGE --- */
/* This is NOT a chatbot style, but it was at the end of your
   file with the chatbot styles, so I've moved it here.
   If your hero image breaks, move this back to styles.css */
.hero-image-container {
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-image {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Ensures the image covers the square area */
}