@keyframes pop-in {
    0% {
        transform: scale(0.96);
        opacity: 0;
    }
    70% {
        transform: scale(1.01);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes typing {
    0% { opacity: 0.6; }
    100% { opacity: 0.6; }
}

@keyframes smooth-appear {
    0% { 
        opacity: 0;
        transform: translateY(8px); /* Slightly larger initial offset */
    }
    100% { 
        opacity: 1;
        transform: translateY(0);
    }
    /* DEBUG LOG: Adjusted smooth-appear animation translateY */
}

@keyframes subtle-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.03); }
    100% { transform: scale(1); }
}

@keyframes typing-cursor {
    0%, 100% { opacity: 0.2; transform: translateY(0); }
    50% { opacity: 1; transform: translateY(-1px); }
}

@keyframes smooth-text-appear {
    0% { 
        opacity: 0;
        transform: translateY(1px);
    }
    100% { 
        opacity: 1;
        transform: translateY(0);
    }
}

/* Enhanced typing indicator animations */
@keyframes bubble-pulse {
    0% { 
        transform: scale(0.6);
        opacity: 0.6; 
    }
    50% { 
        transform: scale(1);
        opacity: 1; 
    }
    100% { 
        transform: scale(0.6);
        opacity: 0.6; 
    }
}

@keyframes fade-out {
    0% { opacity: 1; }
    100% { opacity: 0; }
}

:root {
    /* Monochromatic silver/gray Apple-inspired color scheme */
    --primary-color: #8e8e93; /* Apple silver/gray */
    --primary-dark: #636366; /* Darker gray for hover/active states */
    --primary-light: #f2f2f7; /* Light gray for backgrounds/highlights */
    --secondary-color: #f5f5f7; /* Apple-like light gray */
    --secondary-dark: #e5e5e7; /* Border color */
    --secondary-light: #fbfbfd; /* Apple-like off-white for backgrounds */
    --accent-color: #06c; /* Apple blue for links and critical actions only */
    --text-light: #ffffff;
    --text-dark: #1d1d1f; /* Apple-like dark color */
    --text-gray: #86868b; /* Apple-like secondary text */
    
    /* Refined shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 2px 4px rgba(0, 0, 0, 0.05), 0 1px 10px rgba(0, 0, 0, 0.02);
    --shadow-lg: 0 10px 20px rgba(0, 0, 0, 0.04), 0 2px 6px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.05), 0 3px 10px rgba(0, 0, 0, 0.06);
    
    /* Refined border radius */
    --border-radius-sm: 8px;
    --border-radius-md: 12px;
    --border-radius-lg: 16px;
    --border-radius-xl: 20px;
    
    /* Transitions */
    --transition-fast: 160ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --transition-smooth: 300ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --transition-elastic: 400ms cubic-bezier(0.34, 1.56, 0.64, 1);

    /* Define the standard chat content width */
    --chat-content-width: 800px;

    /* Enhanced typography variables */
    --font-primary: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Inter', 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    --font-display: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Inter', 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    --font-mono: 'SF Mono', SFMono-Regular, ui-monospace, 'Cascadia Mono', 'Segoe UI Mono', 'Ubuntu Mono', 'Roboto Mono', Menlo, Monaco, Consolas, monospace;
    
    /* Line heights */
    --line-height-tight: 1.3;
    --line-height-normal: 1.5;
    --line-height-relaxed: 1.7;
    
    /* Letter spacing */
    --letter-spacing-tighter: -0.03em;
    --letter-spacing-tight: -0.015em;
    --letter-spacing-normal: 0;
    --letter-spacing-loose: 0.01em;
    
    /* Font weights */
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    /* Prevent text selection for better UX */
    -webkit-tap-highlight-color: transparent;
}

html {
    font-family: var(--font-primary);
    font-size: 16px;
    line-height: var(--line-height-normal);
    color: var(--text-dark);
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    letter-spacing: var(--letter-spacing-tight);
}

body {
    background-color: #ffffff;
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
}

/* Mode-specific display rules */
.widget-only {
    display: none;
}

body.widget-mode .widget-only {
    display: block;
}

/* Chat bubble for widget mode */
#chat-bubble {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: linear-gradient(to bottom, #757579, var(--primary-dark));
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1000;
    color: var(--text-light);
    font-size: 24px;
    transition: transform var(--transition-elastic), box-shadow var(--transition-smooth);
    animation: subtle-pulse 3s infinite;
    border: none;
}

#chat-bubble:hover {
    background: linear-gradient(to bottom, #8a8a8f, var(--primary-color));
    box-shadow: 0 4px 12px rgba(0,0,0,0.18);
    transform: scale(1.05);
}

#chat-bubble:active {
    background: linear-gradient(to bottom, #5c5c5f, #4c4c4f);
    transform: scale(0.95);
}

/* Widget mode specific styles */
body.widget-mode #chat-box {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 380px;
    height: 600px;
    background: #ffffff;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-xl);
    display: none;
    flex-direction: column;
    z-index: 1001;
    overflow: hidden;
    transition: all var(--transition-smooth);
    transform-origin: bottom right;
}

/* Full-page mode specific styles */
#chat-box.fullpage-mode {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100vh;
    max-width: none;
    margin: 0;
    border-radius: 0;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow: hidden;
    z-index: 1000;
    background-color: #f8f8fa;
}

/* Centering the chat content properly */
#chat-content {
    flex: 1;
    padding: 0;
    overflow-y: auto;
    background-color: #ffffff;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: var(--chat-content-width);
    position: relative;
    z-index: 1010;
    margin: 0 auto 68px auto;
    height: calc(100vh - 68px);
    overflow-x: hidden; /* Prevent horizontal scroll */
}

.fullpage-mode #chat-content {
    max-width: var(--chat-content-width);
    width: var(--chat-content-width);
    margin: 0 auto 68px auto;
    border-left: 1px solid rgba(0,0,0,0.05);
    border-right: 1px solid rgba(0,0,0,0.05);
    height: calc(100vh - 68px);
    overflow-y: auto;
    position: relative;
    background-color: #ffffff;
    box-shadow: 0 0 30px rgba(0,0,0,0.03);
}

/* Fix input container alignment to match chat content precisely */
.chat-input-container {
    display: flex;
    padding: 12px 0;
    background-color: rgba(250, 250, 252, 0.92);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-top: 1px solid rgba(0,0,0,0.06);
    align-items: center;
    width: 100%;
    position: fixed;
    bottom: 0;
    z-index: 1010;
    height: 68px;
    justify-content: center;
    left: 0;
    right: 0;
    box-shadow: 0 -1px 0 rgba(0,0,0,0.05);
}

/* Make input wrapper match chat content width exactly */
.input-wrapper {
    display: flex;
    width: var(--chat-content-width);
    max-width: var(--chat-content-width);
    padding: 0 20px;
    margin: 0 auto;
    align-items: center;
    height: 100%;
    box-sizing: border-box;
    border-left: 1px solid rgba(0,0,0,0.05);
    border-right: 1px solid rgba(0,0,0,0.05);
}

#chat-input {
    flex: 1;
    border: 1px solid rgba(0,0,0,0.15);
    border-radius: var(--border-radius-lg);
    padding: 12px 18px;
    font-family: var(--font-primary);
    font-size: 15px;
    outline: none;
    transition: all 180ms ease;
    background: white;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.03);
    height: 44px;
    color: var(--text-dark);
    letter-spacing: var(--letter-spacing-normal);
}

.fullpage-mode #chat-input {
    font-size: 15px;
    padding: 14px 18px;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.03);
    height: 44px;
}

#chat-input:focus {
    border-color: rgba(0,0,0,0.2);
    box-shadow: 0 0 0 3px rgba(142, 142, 147, 0.1);
    background: #ffffff;
}

#send-button {
    background: #8e8e93;
    color: var(--text-light);
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    margin-left: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

#send-button:hover {
    background: #757579;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.12);
}

#send-button:active {
    background: #636366;
    transform: translateY(1px);
    box-shadow: 0 1px 1px rgba(0,0,0,0.15);
}

#send-button i {
    font-size: 16px;
}

.message {
    padding: 18px 22px;
    margin: 8px 0; /* Add vertical spacing between messages */
    width: calc(100% - 2px); /* Account for border width */
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
    line-height: var(--line-height-relaxed); /* More relaxed line height for better readability */
    font-size: 15px;
    position: relative;
    border-bottom: none; /* Remove the previous bottom border */
    border: 1px solid rgba(0,0,0,0.06); /* Add subtle border around all messages */
    border-radius: 6px; /* Add soft rounded corners */
    animation: smooth-appear 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    max-width: 100%;
    letter-spacing: var(--letter-spacing-normal); /* More natural spacing for message content */
    box-shadow: 0 1px 2px rgba(0,0,0,0.02); /* Very subtle shadow for depth */
    /* DEBUG LOG: Added message frames with subtle border, rounded corners, and spacing */
}

/* Fix for long links and words */
.message a {
    word-break: break-all;
    color: var(--accent-color);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.message a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.message pre {
    overflow-x: auto;
    max-width: 100%;
    background-color: var(--secondary-color);
    padding: 12px;
    border-radius: var(--border-radius-sm);
    margin: 10px 0;
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.4;
    white-space: pre-wrap;
}

.message code {
    font-family: var(--font-mono);
    background-color: var(--secondary-color);
    padding: 2px 4px;
    border-radius: 4px;
    font-size: 0.9em;
}

.message img,
.message video {
    max-width: 100%;
    height: auto;
    border-radius: var(--border-radius-sm);
    margin: 10px 0; /* Keep margin */
}

.user-message {
    background: white; /* Keep user messages white */
    position: relative;
    /* DEBUG LOG: Maintained white background for user messages */
    font-weight: var(--font-weight-medium); /* Slightly bolder for user messages */
    /* DEBUG LOG: Added medium font weight to user messages */
}

.agent-message {
    background: #f5f5f7; /* Maintain the agent background color */
    position: relative;
    border-left: 3px solid #e8e8ed; /* Keep the left accent border */
    padding-left: 19px; /* Keep the adjusted padding */
    /* DEBUG LOG: Maintained agent message styling with left border */
    font-weight: var(--font-weight-normal); /* Keep normal weight for agent */
    /* DEBUG LOG: Maintained normal font weight for agent messages */
}

.agent-name {
    display: none;
}

.welcome-message {
    display: flex;
    flex-direction: column;
    align-items: center; /* Center content horizontally */
    justify-content: center; /* Center content vertically */
    padding: 40px 28px; /* Increased padding */
    color: var(--text-dark);
    margin: 25px 15px;
    width: calc(100% - 30px);
    animation: pop-in 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.2s forwards; 
    opacity: 0; /* Start hidden for animation */
    background: white;
    box-shadow: 0 2px 12px rgba(0,0,0,0.05), 0 0 1px rgba(0,0,0,0.08);
    border-radius: 12px;
    border: none;
    min-height: 300px; /* Ensure minimum height */
    /* DEBUG LOG: Changed welcome message to flex centered column */
}

/* Remove old h1, p, ul styles as they are no longer present */
.welcome-message h1,
.welcome-message p,
.welcome-message ul {
    display: none;
}

/* Animation Container - Setup for canvas */
.welcome-animation-container {
    width: 100%;
    height: 200px; /* Taller for better visual effect */
    position: relative;
    margin: 0 auto; /* Center */
    border-radius: 8px; /* Rounded corners */
    overflow: hidden; /* Keep animation inside container */
    box-shadow: 0 4px 12px rgba(0,0,0,0.08); /* Subtle shadow for depth */
    background-color: rgba(248, 248, 250, 0.5); /* Very light gray background */
    /* DEBUG LOG: Updated container for canvas animation */
}

/* Canvas fills the container */
#welcome-canvas {
    width: 100%;
    height: 100%;
    display: block;
    /* DEBUG LOG: Added canvas styles */
}

/* --- End Welcome Screen Enhancements --- */

.message-container {
    display: flex;
    flex-direction: column;
    width: 100%;
    min-height: min-content;
}

.chat-box-hidden {
    display: none;
}

.chat-box-shown {
    display: flex !important;
    animation: pop-in 0.4s forwards;
}

/* Enhanced typing indicator styling */
.typing-indicator {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 12px 22px;
    background: var(--secondary-color);
    border: 1px solid rgba(0,0,0,0.06); /* Match message border */
    border-radius: 6px; /* Match message border radius */
    margin: 8px 0; /* Match message margin */
    animation: smooth-appear 0.3s forwards;
    transition: opacity 0.3s ease;
    /* DEBUG LOG: Updated typing indicator to match framed message style */
}

.typing-indicator.fade-out {
    animation: fade-out 0.3s forwards;
}

.typing-label {
    font-size: 13px;
    color: var(--text-gray);
    margin-bottom: 6px;
    font-weight: var(--font-weight-medium);
    letter-spacing: var(--letter-spacing-tight);
    /* DEBUG LOG: Enhanced typing indicator typography */
}

.typing-bubble-container {
    display: flex;
    align-items: center;
}

.typing-bubble {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--primary-color);
    margin: 0 2px;
    animation: bubble-pulse 1.4s infinite;
    opacity: 0.6;
}

.typing-bubble:nth-child(1) { 
    animation-delay: 0s; 
}

.typing-bubble:nth-child(2) { 
    animation-delay: 0.2s; 
}

.typing-bubble:nth-child(3) { 
    animation-delay: 0.4s; 
}

/* Remove old typing indicator styling */
.typing-indicator span {
    display: none;
}

/* Mobile First Approach */
@media (max-width: 768px) {
    /* Reset all input positioning to a moderate state */
    .chat-input-container {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        display: flex !important;
        width: 100% !important;
        min-height: 68px !important;
        background: white !important;
        border-top: 1px solid #ddd !important;
        z-index: 2147483647 !important; /* Maximum possible z-index */
        padding: 12px !important;  /* standard padding */
        box-shadow: 0 -1px 10px rgba(0,0,0,0.05) !important;
        transform: none !important; /* removed aggressive translation */
        margin-bottom: 0 !important; /* removed extra margin */
    }

    /* Remove previously added spacer element */
    body::after {
        content: none;
    }

    /* Reset input field styling remains unchanged */
    #chat-input {
        flex: 1 !important;
        height: 44px !important;
        font-size: 16px !important;
        border: 1px solid #ddd !important;
        border-radius: 22px !important;
        padding: 0 16px !important;
    }

    /* Reset send button styling */
    #send-button {
        width: 44px !important;
        height: 44px !important;
        margin-left: 8px !important;
    }

    /* Adjust chat content area spacing so it doesn't overlap the input */
    .fullpage-mode #chat-content {
        padding-bottom: 68px !important;
        height: calc(100vh - 68px) !important;
    }

    /* Ensure panels remain behind the input */
    .visual-panel, .map-panel {
        z-index: 2147483646 !important;
    }

    /* ... other mobile styles ... */
    
    .message {
        padding: 16px 20px; /* Keep the base mobile padding */
        margin: 6px 0; /* Slightly less vertical spacing on mobile */
        border-radius: 5px; /* Slightly tighter border radius on mobile */
        /* DEBUG LOG: Adjusted message frames for mobile */
    }

    /* Adjust agent message padding specifically for mobile */
    .agent-message {
        padding-left: 17px; /* Keep the mobile padding adjustment */
    }
    
    /* ... other mobile styles ... */
}

/* Alternative position approach as fallback */
@media screen and (max-width: 768px) {
    /* Alternative approach using position from top instead of bottom */
    .chat-input-container {
        top: auto !important; /* Reset top if set */
        bottom: 40px !important; /* Position higher up from bottom */
        position: fixed !important;
        transform: none !important; /* Use explicit positioning instead */
    }
}

/* Ultra-aggressive Android fallback - position from window height */
@media screen and (max-width: 768px) {
    /* Last resort positioning based on viewport height */
    .chat-input-container {
        position: fixed !important;
        top: calc(100vh - 130px) !important; /* Position from top instead of bottom */
        bottom: auto !important; /* Reset bottom */
        transform: none !important; /* No transform needed */
    }
}

/* Debug Log: Added hardware acceleration to prevent input disappearing */
/* Debug Log: Applied multiple positioning techniques for Android compatibility */
/* Debug Log: Added iOS-specific fixes using safe area insets */
/* Debug Log: Created spacer element to ensure proper scrolling */
/* Debug Log: Fixed body overflow issues that could cause positioning problems */
/* Debug Log: Added support for keyboard appearance adjustments */
/* Debug Log: Applied extremely high z-index to ensure input stays on top */
/* Debug Log: Added multiple fallback approaches for different Android versions */
/* Debug Log: EXTREME - Updated with much more aggressive transform (-40px) */
/* Debug Log: EXTREME - Added 50px padding at bottom of input container */
/* Debug Log: EXTREME - Created larger spacer element (70px) at bottom of page */
/* Debug Log: EXTREME - Added alternative positioning methods as fallbacks */
/* Debug Log: EXTREME - Added position from top calculation as last resort */
/* Debug Log: EXTREME - Increased content bottom padding to 120px */

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.001ms !important;
        transition-duration: 0.001ms !important;
    }
}

/* Customize scrollbar for a more refined look */
#chat-content::-webkit-scrollbar {
    width: 8px;
}

#chat-content::-webkit-scrollbar-track {
    background: transparent;
}

#chat-content::-webkit-scrollbar-thumb {
    background: #d1d1d6;
    border-radius: 4px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

#chat-content::-webkit-scrollbar-thumb:hover {
    background: #c7c7cc;
    border: 2px solid transparent;
    background-clip: padding-box;
}

/* Firefox scrollbar */
#chat-content {
    scrollbar-width: thin;
    scrollbar-color: #dadada transparent;
}

/* Agent typing animation - modified for better UX */
.agent-message.typing-animation {
    white-space: normal;
}

.agent-message .typing-word {
    opacity: 0;
    animation: smooth-text-appear 180ms ease-out forwards;
    will-change: opacity, transform; /* Performance hint for browser */
}

.agent-message .typing-word.hidden {
    display: none;
}

.agent-message.typing-animation::after {
    content: '|';
    position: relative;
    display: inline-block;
    color: var(--primary-dark);
    font-weight: normal;
    animation: typing-cursor 1s ease-in-out infinite;
    margin-left: 1px;
    vertical-align: middle;
    opacity: 0.7;
    will-change: opacity, transform; /* Performance hint for browser */
}

/* Debug Log: Enhanced typing animation with better performance settings */
/* Debug Log: Added will-change properties for smoother animations */
/* Debug Log: Modified animation to continue in background tabs */

/* Visual Panel Styles - Enhanced */
.visual-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: calc(50% - var(--chat-content-width)/2);
    height: 100%;
    background-color: #ffffff;
    box-shadow: -5px 0 25px rgba(0,0,0,0.05);
    z-index: 1003;
    transition: transform var(--transition-smooth);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-left: 1px solid rgba(0,0,0,0.05);
    transform: translateX(100%);
}

.visual-panel.active {
    transform: translateX(0);
}

.visual-panel-header {
    display: none;
}

.close-panel-button {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(55, 55, 60, 0.7);
    border: none;
    color: white;
    cursor: pointer;
    font-size: 0.95em;
    transition: all 180ms ease;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    opacity: 0.9;
    z-index: 1005;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.close-panel-button:hover {
    opacity: 1;
    background-color: rgba(65, 65, 70, 0.9);
    transform: scale(1.05);
}

.visual-panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 25px;
    background-color: #f8f8fa;
    padding-top: 60px; /* Add space for the floating close button */
}

/* Hotel card styles for visual panel - Enhanced for Apple-like design */
.hotel-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06), 0 0 1px rgba(0,0,0,0.08);
    overflow: hidden;
    margin-bottom: 25px;
    transform: translateZ(0); /* Hardware acceleration */
    will-change: transform, box-shadow; /* Optimize animations */
    animation: card-appear 0.4s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    opacity: 0;
    transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), 
                box-shadow 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
    width: 100%; /* Ensure cards take full width */
}

.hotel-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.07);
}

@keyframes card-appear {
    0% {
        opacity: 0;
        transform: translateY(15px) scale(0.98);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.hotel-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.hotel-details {
    padding: 16px;
}

.hotel-name {
    font-size: 1.1em;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-dark);
    letter-spacing: -0.01em;
}

.hotel-price {
    font-size: 1.05em;
    color: #434343;
    margin-bottom: 10px;
    font-weight: 500;
}

.hotel-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.hotel-rating {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
}

.hotel-rating i {
    color: #ffc107;
    font-size: 0.9em;
    margin-right: 1px;
}

.hotel-rating span {
    margin-left: 5px;
    font-size: 0.9em;
    color: var(--text-gray);
}

.hotel-location {
    color: var(--text-gray);
    font-size: 0.9em;
    margin-top: 5px;
}

.hotel-discount, .hotel-id {
    font-size: 0.85em;
    color: var(--text-gray);
    margin-top: 5px;
    border-top: 1px solid var(--secondary-dark);
    padding-top: 5px;
}

/* Fix the "with visual panel" layout */
.fullpage-mode #chat-box.with-visual-panel #chat-content {
    margin-right: calc(50% - var(--chat-content-width)/2);
    transition: margin-right var(--transition-smooth);
}

/* Map Panel Styles - Refined for Apple-like design */
.map-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: calc(50% - var(--chat-content-width)/2); /* Exact calculation to match left area */
    height: calc(100vh - 68px); /* Explicit viewport height minus input bar */
    min-width: 300px; /* Minimum width */
    background-color: #ffffff;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    z-index: 1003; /* Below chat input (1010) */
    border: none; /* Removed border-bottom-right-radius */
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(-105%); /* Start fully hidden */
    transition: transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94); /* Smoother transition */
    will-change: transform; /* Optimize animation */
}

.map-panel.active {
    transform: translateY(0); /* Slide down into view */
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.map-panel-header {
    display: none;
}

.close-map-button {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(55, 55, 60, 0.7);
    border: none;
    color: white;
    cursor: pointer;
    font-size: 0.95em;
    transition: all 180ms ease;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    opacity: 0.9;
    z-index: 1005;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.close-map-button:hover {
    opacity: 1;
    background-color: rgba(65, 65, 70, 0.9);
    transform: scale(1.05);
}

.map-container {
    width: 100%; /* Ensure it fills the panel width */
    height: 100%; /* Make the map container fill the panel's height */
    overflow: hidden; /* Prevent map controls from overflowing */
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
    opacity: 0;
    visibility: hidden;
    background-color: #e0e0e0; /* Placeholder background */
    position: relative; /* Needed for placeholder positioning */
}

.map-panel.active .map-container {
    opacity: 1;
    visibility: visible;
}

.map-placeholder {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--text-color-secondary);
    font-size: 1em;
    text-align: center;
}

/* Hotel marker popup styles */
.hotel-marker-popup {
    max-width: 280px;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
}

.hotel-marker-popup img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 8px;
}

.hotel-marker-popup h4 {
    margin: 0 0 5px 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
    letter-spacing: -0.01em;
}

.hotel-marker-popup p {
    margin: 3px 0;
    font-size: 12px;
    color: var(--text-gray);
}

.hotel-marker-popup .price {
    font-weight: 500;
    color: var(--primary-dark);
}

/* Custom map marker styles */
.custom-map-marker {
    position: relative;
    z-index: 5; /* Base z-index */
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), z-index 0s 0.2s; /* Elastic transform, delay z-index change */
    transform-origin: 50% 100%; /* Scale from bottom center */
}

/* Highlight state for the marker */
.custom-map-marker.highlighted {
    transform: scale(1.15); /* Scale up */
    z-index: 15; /* Bring to front */
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), z-index 0s 0s; /* Apply z-index immediately */
}

.marker-price {
    background: var(--primary-dark);
    color: white;
    padding: 2px 5px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
    box-shadow: var(--shadow-sm);
}

/* Panel notification in messages - Apple-like design */
.panel-notification {
    background-color: var(--primary-light);
    border-left: 3px solid var(--primary-dark);
    padding: 12px 16px;
    margin-bottom: 16px;
    border-radius: var(--border-radius-sm);
    font-size: 0.95em;
    color: var(--primary-dark);
    animation: smooth-appear 0.4s forwards;
}

/* Debug Log: Updated colors to monochromatic silver/gray Apple-inspired scheme */
/* Debug Log: Fixed text blinking issue during typing animation */
/* Debug Log: Refined text appearance animations for a smoother feel */
/* Debug Log: Updated all UI components to maintain cohesive design language */
/* Debug Log: Added subtle gradients for a premium look */
/* Debug Log: Refined input and button states for a more tactile feel */
/* Debug Log: Improved scrollbar design to match Apple's aesthetic */
/* Debug Log: Enhanced welcome message with a subtle gradient background */
/* Debug Log: Added backdrop-filter blur effects for a modern feel */
/* Debug Log: Fixed typing animation to eliminate blinking effect */
/* Debug Log: Enhanced text appearance with smoother animations */
/* Debug Log: Refined background colors and gradients for a more cohesive look */
/* Debug Log: Added subtle Apple-like details and textures */
/* Debug Log: Improved visual hierarchy with refined shadows and borders */
/* Debug Log: Refined typography with system fonts for a more professional look */
/* Debug Log: Improved header styling with subtle backdrop blur and proper opacity */
/* Debug Log: Fixed map panel positioning and dimensions */
/* Debug Log: Aligned input container and wrapper properly */
/* Debug Log: Refined hotel cards with proper spacing and shadows */
/* Debug Log: Enhanced responsive behavior for better mobile layout */

/* Better typography for headings and content */
.hotel-name, .map-panel-header h3, .visual-panel-header h3 {
    font-family: var(--font-display);
    letter-spacing: var(--letter-spacing-tighter);
    /* DEBUG LOG: Applied display font to important UI headings */
}

/* Ensure map panel looks good with backdrop-filter */
.map-panel {
    backdrop-filter: blur(0); /* Fix rendering issues with map */
    -webkit-backdrop-filter: blur(0);
}

/* Make chat box appear more refined */
#chat-box.fullpage-mode {
    background-color: #f8f8fa;
}

/* Fix mobile layout and spacing */
@media (max-width: 768px) {
    .welcome-message {
        margin: 15px 10px;
        width: calc(100% - 20px);
        padding: 22px;
    }
    
    .message {
        padding: 16px 20px;
    }
    
    /* Ensure input container has proper spacing */
    .input-wrapper {
        padding: 0 15px;
    }
    
    /* Fix panel heights */
    .visual-panel-content {
        padding: 20px;
    }
    
    /* Fix shadows on mobile */
    .chat-input-container {
        box-shadow: 0 -1px 5px rgba(0,0,0,0.04);
    }
    
    .map-panel {
        width: 100%;
        max-width: none;
        min-width: auto;
        height: 40%;
        max-height: 40vh;
        min-height: auto;
    }
}

/* Debug Log: Removed code duplication and cleaned up the stylesheet */
/* Debug Log: Ensured consistent styling across all elements */
/* Debug Log: Applied hardware acceleration for smoother animations */
/* Debug Log: Enhanced typography and spacing for a professional look */

/* Handle full width when map is shown */
.fullpage-mode #chat-content.with-map {
    margin-left: calc(50% - var(--chat-content-width)/2); /* Use the exact space calculation */
    width: var(--chat-content-width);
    max-width: var(--chat-content-width);
}

/* Mobile adjustments */
@media (max-width: 1600px) {
    .map-panel {
        width: calc(50% - var(--chat-content-width)/2);
    }
    
    .fullpage-mode #chat-content.with-map,
    .fullpage-mode #chat-content.chat-content-with-map {
        margin-left: calc(50% - var(--chat-content-width)/2);
        width: var(--chat-content-width);
    }
    
    .chat-content-with-map {
        margin-left: calc(50% - var(--chat-content-width)/2) !important;
    }
}

@media (max-width: 1400px) {
    :root {
        --chat-content-width: 750px;
    }
}

@media (max-width: 1200px) {
    .map-panel {
        width: calc(50% - var(--chat-content-width)/2);
    }
    
    .fullpage-mode #chat-content.with-map,
    .fullpage-mode #chat-content.chat-content-with-map {
        margin-left: calc(50% - var(--chat-content-width)/2);
        width: var(--chat-content-width);
    }
    
    .chat-content-with-map {
        margin-left: calc(50% - var(--chat-content-width)/2) !important;
    }
}

@media (max-width: 992px) {
    .fullpage-mode #chat-box.with-map {
        width: 100%;
        margin-left: 0;
    }
    
    .map-panel {
        width: 100%;
        height: 40vh;
    }
    
    .fullpage-mode #chat-content.with-map,
    .fullpage-mode #chat-content.chat-content-with-map {
        margin-left: 0;
        padding-top: 40vh;
    }
    
    .close-map-button {
        top: auto;
        bottom: 15px;
        right: 15px;
    }
    
    /* Navigation arrows for card carousel - Improved for consistent visibility */
    .card-nav-arrow {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        width: 36px;
        height: 36px;
        background: rgba(55, 55, 60, 0.7);
        border-radius: 50%;
        display: flex !important; /* Force display */
        align-items: center;
        justify-content: center;
        color: white;
        cursor: pointer;
        z-index: 1010;
        opacity: 0.8;
        transition: opacity 0.2s ease, background-color 0.2s ease;
        visibility: visible !important;
        pointer-events: auto !important;
    }
    
    .card-nav-arrow:hover {
        opacity: 1;
        background: rgba(65, 65, 70, 0.9);
    }
    
    .card-nav-arrow.prev {
        left: 8px; /* Reduced from 10px */
    }
    
    .card-nav-arrow.next {
        right: 8px; /* Reduced from 10px */
    }
    
    /* Card indicator dots */
    .card-indicator-dots {
        position: absolute;
        bottom: 8px; /* Reduced from 10px */
        left: 0;
        right: 0;
        display: flex;
        justify-content: center;
        gap: 8px;
        z-index: 1005;
    }
    
    .card-indicator-dot {
        width: 6px; /* Reduced from 8px */
        height: 6px; /* Reduced from 8px */
        border-radius: 50%;
        background: rgba(142, 142, 147, 0.4);
        transition: background 0.2s ease;
    }
    
    .card-indicator-dot.active {
        background: var(--primary-dark);
    }
    
    /* Adjust chat content to account for cards when present */
    .fullpage-mode #chat-content.with-cards {
        padding-top: 280px; /* Reduced from 320px */
    }
    
    /* Chat content when cards are peeking */
    .fullpage-mode #chat-content.with-cards-peek {
        padding-top: 40px; /* Just enough to show the handle */
    }
    
    /* When there are no cards, full height chat */
    .fullpage-mode #chat-content:not(.with-cards):not(.with-cards-peek) {
        height: calc(100vh - 68px);
    }
}

/* Debug Log: Fixed map panel width to 400px instead of 50% */
/* Debug Log: Corrected input wrapper alignment to match chat content */
/* Debug Log: Updated chat content positioning with visible map */
/* Debug Log: Added responsive adjustments for different screen sizes */
/* Debug Log: Ensured consistent borders and alignment across elements */

/* Add JavaScript-added class to position chat better with visible map */
.chat-content-with-map {
    margin-left: calc(50% - var(--chat-content-width)/2) !important;
    border-left: none !important;
}

/* Ensure chat content adjusts properly with map */
.fullpage-mode #chat-content.chat-content-with-map {
    margin-left: calc(50% - var(--chat-content-width)/2);
    max-width: var(--chat-content-width);
    width: var(--chat-content-width);
}

/* Refine panel positions */
.map-panel.active {
    transform: translateY(0);
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

/* Higher z-index for close buttons */
.close-map-button, .close-panel-button {
    z-index: 1010;
}

/* Fix visual panel positioning */
.visual-panel {
    height: 100%;
    top: 0;
    bottom: 0;
}

/* Override small mobile styles */
@media (max-width: 992px) {
    /* Hide map panel on mobile - Let's keep it hidden for now to simplify */
    .map-panel {
        display: none !important;
    }

    /* Reset padding that was added for map */
    .fullpage-mode #chat-content.with-map,
    .fullpage-mode #chat-content.chat-content-with-map {
        padding-top: 0 !important;
        margin-left: 0;
        max-width: 100%;
        width: 100%;
    }
    /* ... rest of mobile styles ... */
}

/* Additional media query for very large screens */
@media (min-width: 1800px) {
    .fullpage-mode #chat-content.chat-content-with-map {
        max-width: 900px;
    }
}

/* Debug Log: Added chat-content-with-map class for JavaScript to apply */
/* Debug Log: Enhanced positioning for map and chat areas */
/* Debug Log: Improved mobile layout with map visible */
/* Debug Log: Fixed z-index issues for close buttons */

/* Further refinements to ensure perfect alignment */

/* Ensure full chat width properties are consistently applied */
.fullpage-mode #chat-content {
    max-width: var(--chat-content-width);
    width: var(--chat-content-width);
    margin: 0 auto 68px auto;
    border-left: 1px solid rgba(0,0,0,0.05);
    border-right: 1px solid rgba(0,0,0,0.05);
    height: calc(100vh - 68px);
    overflow-y: auto;
    position: relative;
    background-color: #ffffff;
    box-shadow: 0 0 30px rgba(0,0,0,0.03);
}

/* Fix input wrapper to exactly match chat content */
.fullpage-mode .chat-input-container {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    padding: 12px 0;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 -1px 10px rgba(0,0,0,0.05);
    z-index: 1010;
    justify-content: center;
    border-top: 1px solid rgba(0,0,0,0.05);
}

/* Ensure visual panel occupies exactly the right space and animates properly */
.visual-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: calc(50% - var(--chat-content-width)/2);
    height: 100%;
    background-color: #ffffff;
    box-shadow: -5px 0 25px rgba(0,0,0,0.05);
    z-index: 1003;
    transition: transform var(--transition-smooth);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-left: 1px solid rgba(0,0,0,0.05);
    transform: translateX(100%);
}

.visual-panel.active {
    transform: translateX(0);
}

/* Ensure hotel cards fill the visual panel properly */
.hotel-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06), 0 0 1px rgba(0,0,0,0.08);
    overflow: hidden;
    margin-bottom: 25px;
    transform: translateZ(0); /* Hardware acceleration */
    will-change: transform, box-shadow; /* Optimize animations */
    animation: card-appear 0.4s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    opacity: 0;
    transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), 
                box-shadow 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
    width: 100%; /* Ensure cards take full width */
}

/* Fix media queries for consistent responsiveness */
@media (max-width: 1600px) {
    :root {
        --chat-content-width: 800px;
    }
    
    .visual-panel {
        width: calc(50% - var(--chat-content-width)/2);
    }
    
    .map-panel {
        width: calc(50% - var(--chat-content-width)/2);
    }
}

@media (max-width: 1400px) {
    :root {
        --chat-content-width: 750px;
    }
}

@media (max-width: 1200px) {
    :root {
        --chat-content-width: 700px;
    }
}

@media (max-width: 992px) {
    :root {
        --chat-content-width: 100%;
    }
    
    .visual-panel {
        width: 100%;
        transform: translateX(100%);
    }
    
    .map-panel {
        width: 100%;
        height: 40vh;
    }
    
    .fullpage-mode #chat-content,
    .fullpage-mode #chat-content.with-map,
    .fullpage-mode #chat-content.chat-content-with-map {
        width: 100%;
        max-width: 100%;
        margin-left: 0;
        margin-right: 0;
        border-left: none;
        border-right: none;
    }
    
    .chat-content-with-map {
        margin-left: 0 !important;
    }
    
    .fullpage-mode #chat-box.with-visual-panel #chat-content {
        margin-right: 0;
    }
    
    .input-wrapper {
        max-width: 100%;
        width: 100%;
        padding: 0 15px;
        border-left: none;
        border-right: none;
    }
}

/* Refine map panel appearance when active */
.map-panel.active {
    transform: translateY(0);
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

/* Update chat content with map to use correct calculations */
.chat-content-with-map {
    margin-left: calc(50% - var(--chat-content-width)/2) !important;
    width: var(--chat-content-width) !important;
    max-width: var(--chat-content-width) !important;
    border-left: none !important;
}

/* Ensure alignment with map is exactly correct */
.fullpage-mode #chat-content.with-map {
    margin-left: calc(50% - var(--chat-content-width)/2);
    width: var(--chat-content-width);
    max-width: var(--chat-content-width);
}

/* Mobile Specific Enhancements - Updated for drag behavior */
@media (max-width: 992px) {
    /* Hide map panel on mobile */
    .map-panel {
        display: none !important;
    }
    
    /* Reset padding that was added for map */
    .fullpage-mode #chat-content.with-map,
    .fullpage-mode #chat-content.chat-content-with-map {
        padding-top: 0 !important;
        margin-left: 0;
        max-width: 100%;
        width: 100%;
    }
    
    /* Visual panel cards for mobile - single card carousel with drag behavior */
    .visual-panel {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        width: 100%;
        height: auto;
        max-height: 280px; /* Reduced from 320px to show more chat content */
        z-index: 1003;
        transform: translateY(-100%);
        transition: transform 0.3s cubic-bezier(0.2, 0.9, 0.3, 1);
        will-change: transform;
    }
    
    .visual-panel.active {
        transform: translateY(0);
    }
    
    /* Add states for drag gesture */
    .visual-panel.dragging {
        transition: none;
    }
    
    .visual-panel.peek {
        transform: translateY(-240px); /* Show just 40px at the bottom */
    }
    
    /* Add pull indicator */
    .pull-indicator {
        position: absolute;
        bottom: 2px;
        left: 50%;
        transform: translateX(-50%);
        width: 40px;
        height: 4px;
        border-radius: 2px;
        background-color: rgba(142, 142, 147, 0.3);
        z-index: 1010;
    }
    
    .visual-panel-content {
        padding: 12px; /* Reduced from 15px */
        display: flex;
        overflow-x: hidden;
        overflow-y: hidden;
        flex-direction: row;
        position: relative;
        padding-top: 45px; /* Reduced from 50px to make card more compact */
        height: 100%;
    }
    
    /* Card carousel container */
    .hotel-cards-container {
        display: flex;
        transition: transform 0.3s ease;
        width: 100%;
    }
    
    /* Hotel cards in carousel - optimized size */
    .hotel-card {
        min-width: 100%;
        width: 100%;
        flex: 0 0 100%;
        margin-right: 15px;
        margin-bottom: 0;
        box-sizing: border-box;
        display: flex;
        flex-direction: column;
    }
    
    /* Optimize mobile hotel card appearance */
    .hotel-card .hotel-image {
        height: 140px; /* Reduced from 180px */
    }
    
    .hotel-card .hotel-details {
        padding: 12px; /* Reduced from 16px */
        display: flex;
        flex-direction: column;
        flex: 1;
    }
    
    .hotel-card .hotel-name {
        font-size: 1em; /* Reduced from 1.1em */
        margin-bottom: 6px; /* Reduced from 10px */
    }
    
    /* Modified price and discount display for mobile */
    .hotel-card .hotel-price-container {
        display: flex;
        align-items: center;
        flex-wrap: wrap;
        margin-bottom: 6px; /* Reduced from 10px */
    }
    
    .hotel-card .hotel-price {
        font-size: 0.95em; /* Reduced from 1.05em */
        margin-bottom: 0; /* Changed from 6px */
        margin-right: 8px;
    }
    
    /* Mobile-specific discount badge next to price */
    .hotel-card .discount-badge {
        display: inline-flex;
        align-items: center;
        font-size: 0.8em;
        background-color: #f8f8fa;
        color: #636366;
        padding: 2px 6px;
        border-radius: 4px;
        font-weight: 500;
        border: 1px solid #e5e5e7;
    }
    
    /* Hide the orange discount div on mobile */
    .hotel-card .discount-div {
        display: none;
    }
    
    .hotel-card .hotel-info {
        margin-bottom: 6px; /* Reduced from 10px */
    }
    
    .hotel-card:last-child {
        margin-right: 0;
    }
    
    /* Navigation arrows for card carousel - Fixed to always show */
    .card-nav-arrow {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        width: 36px; /* Reduced from 40px */
        height: 36px; /* Reduced from 40px */
        background: rgba(55, 55, 60, 0.7);
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        color: white;
        cursor: pointer;
        z-index: 1010;
        opacity: 0.8;
        transition: opacity 0.2s ease, background-color 0.2s ease;
        /* These ensure the buttons are always visible and tappable */
        pointer-events: auto !important;
        visibility: visible !important;
        touch-action: auto !important;
    }
    
    .card-nav-arrow:hover {
        opacity: 1;
        background: rgba(65, 65, 70, 0.9);
    }
    
    .card-nav-arrow.prev {
        left: 8px; /* Reduced from 10px */
    }
    
    .card-nav-arrow.next {
        right: 8px; /* Reduced from 10px */
    }
    
    /* Card indicator dots */
    .card-indicator-dots {
        position: absolute;
        bottom: 8px; /* Reduced from 10px */
        left: 0;
        right: 0;
        display: flex;
        justify-content: center;
        gap: 8px;
        z-index: 1005;
    }
    
    .card-indicator-dot {
        width: 6px; /* Reduced from 8px */
        height: 6px; /* Reduced from 8px */
        border-radius: 50%;
        background: rgba(142, 142, 147, 0.4);
        transition: background 0.2s ease;
    }
    
    .card-indicator-dot.active {
        background: var(--primary-dark);
    }
    
    /* Adjust chat content to account for cards when present */
    .fullpage-mode #chat-content.with-cards {
        padding-top: 280px; /* Reduced from 320px */
    }
    
    /* Chat content when cards are peeking */
    .fullpage-mode #chat-content.with-cards-peek {
        padding-top: 40px; /* Just enough to show the handle */
    }
    
    /* When there are no cards, full height chat */
    .fullpage-mode #chat-content:not(.with-cards):not(.with-cards-peek) {
        height: calc(100vh - 68px);
    }
}

/* Only modify the appearance of hotel properties by targeting strong tags 
   but leave normal paragraph text intact */
.agent-message br {
  /* Keep normal line breaks for regular text */
  display: inline; 
}

/* Only remove br tags that directly follow strong elements (hotel properties) */
.agent-message strong + br {
  display: none;
}

/* Keep the strong tags inline and add margin */
.agent-message strong {
  display: inline;
  margin-right: 5px;
}

/* Fix spacing after img elements */
.agent-message img {
  display: block;
  margin: 15px 0 10px 0;
}

/* Add proper paragraph separation for normal text */
.agent-message p {
  margin-bottom: 0.8em;
}

/* Add spacing between hotel sections */
.agent-message img + strong {
  display: inline-block;
  margin-top: 10px;
}

/* Feedback controls styling */
.message-feedback {
    display: flex;
    align-items: center;
    margin-top: 12px;
    padding-top: 8px;
    border-top: 1px solid rgba(0,0,0,0.05);
    opacity: 1;
    transition: opacity 0.3s ease;
}

.message-feedback span {
    color: var(--text-gray);
    font-size: 0.85em;
    margin-right: 12px;
    transition: color 0.2s ease;
}

.feedback-button {
    background: transparent;
    border: none;
    color: var(--primary-color);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 4px;
    transition: all 0.2s ease;
    padding: 0;
}

.feedback-button:hover {
    background-color: rgba(142, 142, 147, 0.1);
    color: var(--primary-dark);
}

.feedback-button.selected {
    color: var(--accent-color);
    background-color: rgba(0, 102, 204, 0.1);
}

.feedback-button.disabled {
    opacity: 0.3;
    cursor: default;
    pointer-events: none;
}

/* Thumbs up/down icons */
.feedback-button i {
    font-size: 14px;
    line-height: 1;
}

.thumbs-up.selected i {
    color: #34c759;
}

.thumbs-down.selected i {
    color: #ff3b30;
}

/* Show feedback controls after typing is complete */
.agent-message:not(.typing-animation) .message-feedback {
    display: flex;
}

/* Mobile optimization for feedback controls */
@media (max-width: 768px) {
    .message-feedback {
        padding-top: 8px;
        margin-top: 12px;
    }
    
    .message-feedback span {
        font-size: 0.8em;
        margin-right: 8px;
    }
    
    .feedback-button {
        width: 30px;
        height: 30px;
    }
    
    .feedback-button i {
        font-size: 14px;
    }
}

/* --- Custom Map Marker (Mini Card Overlay) --- */
.custom-marker-minicard {
    background-color: white;
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 10px 12px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Inter', sans-serif;
    font-size: 13px;
    white-space: nowrap;
    cursor: pointer;
    transition: transform 0.1s ease-out, box-shadow 0.1s ease-out;
    min-width: 130px;
    transform-origin: bottom center;
}

.custom-marker-minicard:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.25);
    z-index: 10; /* Bring to front on hover */
}

.minicard-name {
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px; /* Limit width */
}

.minicard-stars {
    color: #f5a623; /* Gold color for stars */
    font-size: 12px;
    margin-bottom: 6px;
    line-height: 1.2;
    display: flex;
    align-items: center;
}

.minicard-stars i { margin-right: 1px; }
.minicard-stars .far { color: #d0d0d0; } /* Empty star color */

.minicard-details {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 12px;
}

.minicard-price {
    font-weight: 500;
    color: #333;
}

.minicard-price.unavailable {
    color: #999;
    font-style: italic;
}

.minicard-discount {
    background-color: #e74c3c; /* Red discount badge */
    color: white;
    font-size: 11px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 5px;
    white-space: nowrap;
}

/* --- Custom InfoWindow Content --- */
.custom-infowindow-content {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Inter', sans-serif;
    color: var(--text-dark);
    max-width: 300px; /* Max width for the info window */
    padding: 5px; /* Reduce default padding slightly */
}

/* Remove default Google Maps InfoWindow padding/border artifacts */
.gm-style-iw-c { /* Outer container */
   padding: 0 !important;
   border-radius: 12px !important; /* Match our style */
}
.gm-style-iw-d { /* Inner content container */
   overflow: hidden !important; /* Prevent scrollbars if content fits */
}
.gm-ui-hover-effect { /* Hide default close button */
    display: none !important;
}

.infowindow-image {
    width: 100%;
    height: 140px;
    object-fit: cover;
    border-radius: 8px 8px 0 0; /* Rounded top corners */
    display: block;
    margin-bottom: 10px;
}
.infowindow-no-image {
    width: 100%;
    height: 100px;
    background-color: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 13px;
    border-radius: 8px 8px 0 0;
    margin-bottom: 10px;
}

.infowindow-details {
    padding: 5px 10px 10px 10px; /* Padding for text content */
}

.infowindow-name {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 5px 0;
    line-height: 1.3;
}

.infowindow-stars {
    color: #f5a623;
    font-size: 13px;
    margin-bottom: 6px;
}
.infowindow-stars i { margin-right: 2px; }
.infowindow-stars .far { color: #d0d0d0; }

.infowindow-reviews {
    font-size: 12px;
    color: var(--text-gray);
    margin-bottom: 8px;
}
.infowindow-reviews .rating {
    font-weight: 500;
    color: var(--text-dark);
    margin-right: 4px;
}
.infowindow-reviews .count {
    margin-left: 2px;
}
.infowindow-reviews.unavailable {
    font-style: italic;
}

.infowindow-pricing {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--secondary-dark);
}

.infowindow-price {
    font-size: 15px;
    font-weight: 600;
    color: #000;
}
.infowindow-price.unavailable {
    font-size: 14px;
    color: #999;
    font-style: italic;
    font-weight: normal;
}

.infowindow-discount {
    background-color: #e74c3c;
    color: white;
    font-size: 11px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 4px;
}

/* Chat Hotel Card Styling */
.chat-hotel-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    overflow: hidden;
    margin: 15px 0;
    border: 1px solid rgba(0,0,0,0.05);
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Inter', sans-serif;
    transition: opacity 0.4s ease-out, transform 0.4s ease-out;
    will-change: opacity, transform;
}

.chat-hotel-card img {
    width: 100%;
    height: auto;
    display: block;
    margin: 0 !important;
    border-radius: 12px 12px 0 0;
}

.chat-hotel-card-content {
    padding: 16px;
}

.chat-hotel-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.chat-hotel-card-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0;
    flex: 1;
}

.chat-hotel-card-stars {
    color: #f5a623;
    font-size: 14px;
    white-space: nowrap;
    margin-left: 8px;
}

.chat-hotel-card-price {
    font-size: 15px;
    font-weight: var(--font-weight-semibold);
    letter-spacing: var(--letter-spacing-tight);
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: baseline;
    gap: 5px 10px;
}

/* Container for price per night */
.chat-hotel-card-price > span:first-child {
    white-space: nowrap;
}

/* NEW: Style for "/ night" text */
.price-per-night {
    font-size: 0.8em;
    font-weight: var(--font-weight-normal);
    letter-spacing: var(--letter-spacing-normal);
}

.chat-hotel-card-discount {
    display: inline-block;
    background-color: #e74c3c;
    color: white;
    font-size: 12px;
    font-weight: bold;
    padding: 3px 6px;
    border-radius: 4px;
    white-space: nowrap;
    margin-left: auto;
}

.chat-hotel-card-details {
    display: flex;
    flex-wrap: wrap;
    padding-top: 10px;
    margin-top: 10px;
    border-top: 1px solid rgba(0,0,0,0.05);
    font-size: 13px;
    color: var(--text-gray);
    letter-spacing: var(--letter-spacing-normal);
}

.chat-hotel-card-detail {
    display: flex;
    align-items: center;
    margin-right: 16px;
    margin-bottom: 6px;
}

.chat-hotel-card-detail i {
    margin-right: 4px;
    font-size: 14px;
    color: var(--primary-color);
}

.chat-hotel-card-reviews {
    color: var(--text-dark);
    font-weight: 500;
}

/* Wishlist adjustments: ensure proper behavior and appearance */
#wishlist-container .wishlist-card .wishlist-remove {
    z-index: 100 !important;
    pointer-events: auto !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Make sure the remove button is consistently visible/clickable even on hover */
#wishlist-container .wishlist-card:hover .wishlist-remove {
    display: block !important;
    opacity: 1 !important;
    z-index: 1000 !important;
}

/* Add mobile behavior for wishlist, similar to map panel */
@media (max-width: 992px) {
    /* Hide wishlist when not needed on mobile */
    #wishlist-container {
        transform: translateY(-100%);
    }
    
    /* Show wishlist when active on mobile */
    #wishlist-container.active {
        transform: translateY(0);
    }
    
    /* Ensure cards in wishlist are properly sized on mobile */
    #wishlist-container .chat-hotel-card {
        width: 100% !important;
        max-width: 100% !important;
        margin: 10px 0 !important;
    }
}

/* Override wishlist container so bottom offset does not cover the input container */
#wishlist-container {
    bottom: 68px !important;
    height: calc(100% - 68px) !important;
}

/* AI Insights Panel within Wishlist */
.wishlist-insights {
    background: linear-gradient(to bottom right, rgba(142, 142, 147, 0.05), rgba(142, 142, 147, 0.1));
    border-radius: 12px;
    padding: 16px;
    margin: 0 0 20px 0;
    border: 1px solid rgba(142, 142, 147, 0.1);
}

.insights-header {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    color: var(--text-dark);
}

.insights-header i {
    color: var(--accent-color);
    margin-right: 8px;
    font-size: 16px;
}

.insights-title {
    font-weight: 600;
    font-size: 14px;
    letter-spacing: -0.01em;
}

.insight-item {
    display: flex;
    align-items: flex-start;
    padding: 8px 0;
    font-size: 13px;
    color: var(--text-gray);
    animation: smooth-appear 0.3s forwards;
}

.insight-item i {
    margin-right: 8px;
    color: var(--primary-color);
    font-size: 12px;
    margin-top: 3px;
}

.insight-text {
    flex: 1;
    line-height: 1.4;
}

.insight-highlight {
    color: var(--text-dark);
    font-weight: 500;
}

/* Style for the Compare Pricing button in wishlist */
.compare-pricing-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 500;
    color: var(--accent-color);
    background-color: rgba(0, 102, 204, 0.08); /* Light blue background */
    border: 1px solid rgba(0, 102, 204, 0.2);
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    margin-top: 12px;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
    width: 100%; /* Make it full width */
    box-sizing: border-box;
}

.compare-pricing-button i {
    margin-right: 6px;
}

.compare-pricing-button:hover {
    background-color: rgba(0, 102, 204, 0.15);
    border-color: rgba(0, 102, 204, 0.4);
    color: #0056b3; /* Darker blue on hover */
}

.compare-pricing-button:active {
     background-color: rgba(0, 102, 204, 0.2);
}

/* Ensure button is added below details */
.chat-hotel-card-content > .compare-pricing-button {
    margin-top: 15px; 
    /* Add some space above the button */
}

/* --- Wishlist Insights Refinements --- */
.insight-item .fa-tags { /* Specific icon color for savings */
    color: #28a745; /* Green */
}
.insight-item .fa-robot { /* Specific icon color for AI score */
    color: #6f42c1; /* Purple */
}

/* NEW: Container for the two compare buttons */
.compare-buttons-container {
    display: grid; /* Use grid for easy equal spacing */
    grid-template-columns: repeat(3, 1fr); /* Three equal columns */
    gap: 8px; /* Reduced gap slightly */
    margin-top: 15px;
}

/* Generic style for buttons in the container */
.compare-buttons-container > button {
    /* flex: 1; Remove flex property as grid handles sizing */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    /* Use consistent padding for both buttons */
    padding: 8px 10px;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid; /* Set border style */
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, opacity 0.2s ease; /* Added opacity transition */
    box-sizing: border-box;
    text-align: center;
    white-space: nowrap; /* Prevent wrapping */
    /* Ensure consistent height if needed, though padding usually handles this */
    /* height: 34px; */
}

.compare-buttons-container > button i {
    margin-right: 6px;
    font-size: 1em; /* Match button text size */
    line-height: 1; /* Ensure icon aligns well vertically */
}

/* Style for Compare Prices button (formerly Compare Booking) */
.compare-pricing-button.booking {
    color: #0071c2; /* Booking.com blue */
    background-color: rgba(0, 113, 194, 0.08);
    border-color: rgba(0, 113, 194, 0.3);
}
.compare-pricing-button.booking:hover {
    background-color: rgba(0, 113, 194, 0.15);
    border-color: rgba(0, 113, 194, 0.5);
    color: #005999;
}

/* --- Style for Book button --- */
.book-button {
    /* Using accent color for booking action */
    color: var(--accent-color);
    background-color: rgba(0, 102, 204, 0.08);
    border-color: rgba(0, 102, 204, 0.3);
}
.book-button:hover {
    background-color: rgba(0, 102, 204, 0.15);
    border-color: rgba(0, 102, 204, 0.5);
    color: #0056b3; /* Darker blue on hover */
}
.book-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background-color: rgba(142, 142, 147, 0.1);
    border-color: rgba(142, 142, 147, 0.2);
    color: var(--text-gray);
}
/* --- END Book button style --- */

/* Ensure button container is added below details */
.chat-hotel-card-content > .compare-buttons-container {
    margin-top: 15px;
    /* Add some space above the button container */
}

/* ... existing code ... */

/* Ensure the first message doesn't have a top margin */
#chat-content > .message:first-of-type {
    margin-top: 0;
    /* DEBUG LOG: Removed top margin from first message */
}

/* Package Card Styling - Matching hotel card design language */
.chat-package-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    overflow: hidden;
    margin: 15px 0;
    border: 1px solid rgba(0,0,0,0.05);
    font-family: var(--font-primary);
    transition: opacity 0.4s ease-out, transform 0.4s ease-out;
    will-change: opacity, transform;
    /* DEBUG LOG: Created consistent styling for package cards */
}

.chat-package-card:hover {
    box-shadow: 0 0 8px rgba(0,0,0,0.5);
    transform: scale(1.02);
    transition: all 0.2s;
    /* DEBUG LOG: Added hover effect for package cards */
}

.chat-package-card img {
    width: 100%;
    height: auto;
    max-height: 250px;
    object-fit: cover;
    display: block;
    margin: 0 !important;
    border-radius: 12px 12px 0 0;
    /* DEBUG LOG: Optimized image display in package cards */
}

.chat-package-card-content {
    padding: 16px;
    /* DEBUG LOG: Added proper padding to package card content */
}

.chat-package-card-name {
    font-size: 16px;
    font-weight: var(--font-weight-semibold);
    color: var(--text-dark);
    margin: 0 0 10px 0;
    /* DEBUG LOG: Enhanced room title typography */
}

.chat-package-card-price {
    font-size: 15px;
    font-weight: var(--font-weight-semibold);
    color: var(--text-dark);
    margin: 8px 0;
    display: flex;
    align-items: baseline;
    /* DEBUG LOG: Improved price display */
}

.chat-package-card-price strong {
    color: var(--accent-color);
    margin-left: 5px;
    /* DEBUG LOG: Emphasized price value */
}

.chat-package-card-desc {
    font-size: 13px;
    color: var(--text-gray);
    margin: 8px 0;
    line-height: 1.4;
    /* DEBUG LOG: Improved description readability */
}

.chat-package-card-details {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    padding-top: 10px;
    margin-top: 10px;
    border-top: 1px solid rgba(0,0,0,0.05);
    font-size: 13px;
    color: var(--text-gray);
    /* DEBUG LOG: Added separator and details section */
}

.chat-package-card-details span {
    display: inline-flex;
    align-items: center;
    margin-right: 10px;
    margin-bottom: 6px;
    /* DEBUG LOG: Improved details spacing */
}

.chat-package-card-details span:before {
    content: '•';
    margin-right: 5px;
    color: var(--primary-color);
    /* DEBUG LOG: Added bullet points to details */
}

.chat-package-card-policy {
    font-size: 12px;
    color: #e74c3c; /* Red for important cancellation info */
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(0,0,0,0.05);
    /* DEBUG LOG: Highlighted cancellation policy */
}

.chat-package-card-quote-id {
    font-size: 11px;
    color: var(--text-gray);
    margin-top: 8px;
    opacity: 0.7;
    /* DEBUG LOG: De-emphasized technical quote ID */
}

/* Book button for packages */
.chat-package-card .book-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: var(--font-weight-medium);
    color: white;
    background-color: var(--accent-color);
    border: none;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    margin-top: 12px;
    transition: background-color 0.2s ease;
    width: 100%;
    /* DEBUG LOG: Added Book button for package cards */
}

.chat-package-card .book-button:hover {
    background-color: #0056b3;
    /* DEBUG LOG: Added hover state for Book button */
}

.chat-package-card .book-button i {
    margin-right: 6px;
    /* DEBUG LOG: Added space for button icon */
}

/* Image Gallery Styling */
.image-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    grid-gap: 8px;
    margin: 15px 0;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
}

.image-gallery::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.05);
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
    border-radius: 8px;
}

.image-gallery:hover::after {
    opacity: 1;
}

.image-gallery img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    margin: 0 !important;
    transition: transform 0.2s;
    border-radius: 4px;
}

.image-gallery.single-image {
    display: block;
}

.image-gallery.single-image img {
    height: auto;
    max-height: 400px;
    width: 100%;
    object-fit: contain;
}

.image-gallery.two-images {
    grid-template-columns: repeat(2, 1fr);
}

.image-gallery.three-images {
    grid-template-columns: repeat(3, 1fr);
}

.image-gallery-count {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0,0,0,0.5);
    color: white;
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 12px;
    z-index: 5;
}

/* Gallery Popup */
.gallery-popup {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0,0,0,0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.gallery-popup.active {
    opacity: 1;
    pointer-events: auto;
}

.gallery-popup-content {
    position: relative;
    width: 90%;
    max-width: 1000px;
    max-height: 80vh;
    display: flex;
    justify-content: center;
}

.gallery-popup img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 4px;
}

.gallery-popup-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: rgba(55, 55, 60, 0.7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    font-size: 20px;
    z-index: 2001;
    transition: background-color 0.2s;
}

.gallery-popup-close:hover {
    background: rgba(65, 65, 70, 0.9);
}

.gallery-popup-nav {
    position: absolute;
    top: 50%;
    width: 40px;
    height: 40px;
    background: rgba(55, 55, 60, 0.7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    transform: translateY(-50%);
    z-index: 2001;
    transition: background-color 0.2s;
}

.gallery-popup-nav:hover {
    background: rgba(65, 65, 70, 0.9);
}

.gallery-popup-nav.prev {
    left: 20px;
}

.gallery-popup-nav.next {
    right: 20px;
}

.gallery-popup-counter {
    position: absolute;
    bottom: 20px;
    color: white;
    background: rgba(0,0,0,0.5);
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 14px;
}

/* Mobile Styles for Gallery */
@media (max-width: 768px) {
    .image-gallery {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        grid-gap: 5px;
    }
    
    .image-gallery img {
        height: 120px;
    }
    
    .gallery-popup-nav {
        width: 36px;
        height: 36px;
    }
    
    .gallery-popup-close {
        width: 36px;
        height: 36px;
        top: 15px;
        right: 15px;
    }
}

/* Styles for agent-added images */
.agent-added-image {
    max-width: 100%; /* Ensure image fits container */
    height: auto;
    display: block; /* Prevents inline text wrapping issues */
    margin-top: 5px;
    margin-bottom: 5px;
    border-radius: 4px;
    cursor: pointer; /* Indicate it's clickable */
    border: 1px solid #eee; /* Subtle border */
}

/* Styles for Google Maps link card */
.google-map-link-card {
    display: inline-flex; /* Use inline-flex for better alignment */
    align-items: center; /* Vertically center icon and text */
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 8px 12px;
    margin: 5px 0;
    text-decoration: none;
    color: #333;
    font-size: 0.9em;
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
    max-width: 100%; /* Prevent overflow */
    box-sizing: border-box;
}
.google-map-link-card:hover {
    background-color: #e9ecef;
    text-decoration: none;
    color: #007bff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.google-map-link-card i {
    margin-right: 8px; /* Space between icon and text */
    color: #dc3545; /* Google Maps pin color */
}
.google-map-link-card .map-link-text {
    flex-grow: 1; /* Allow text to take up space */
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis; /* Show ellipsis if text overflows */
}
/* Remove url preview styling, just make it part of the text */

/* === Progress Widget === */
.progress-widget {
    position: fixed;
    top: 14px;
    right: 14px;
    width: 260px;
    max-height: 60vh;
    background: #ffffff;
    border: 1px solid rgba(0,0,0,0.08);
    box-shadow: 0 2px 12px rgba(0,0,0,0.12);
    border-radius: 8px;
    font-size: 13px;
    color: var(--text-dark);
    display: flex;
    flex-direction: column;
    z-index: 1050; /* above chat */
    overflow: hidden;
    opacity: 1;
    transition: opacity 0.3s ease;
}
.progress-widget.hidden {
    opacity: 0;
    pointer-events: none;
}
.progress-title {
    background: var(--secondary-color);
    padding: 8px 10px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}
.progress-body {
    padding: 10px;
    overflow-y: auto;
    flex: 1;
}
.progress-item {
    margin-bottom: 6px;
    line-height: 1.35;
    color: var(--text-gray);
}
.progress-item:last-child {
    margin-bottom: 0;
}

/* === End Progress Widget === */

/* === Progress Message (inline) === */
.progress-message {
    background: #f5f5f7;
    border-left: 3px solid #babac0;
}
.progress-message.collapsed .progress-body {
    display: none;
}
.progress-header {
    display: flex;
    align-items: center;
    cursor: pointer;
    gap: 6px;
}
.progress-header .spinner {
    animation: bubble-pulse 1.4s infinite;
}
.progress-title {
    font-weight: 600;
    flex: 1;
}
.progress-timer {
    font-size: 12px;
    color: var(--text-gray);
}
.progress-toggle {
    transition: transform 0.2s ease;
}
.progress-message.expanded .progress-toggle {
    transform: rotate(90deg);
}
.progress-body {
    margin-top: 8px;
    max-height: 200px;
    overflow-y: auto;
}
/* reuse .progress-item styles from prior widget */
.progress-item {
    margin-bottom: 6px;
    line-height: 1.35;
    color: var(--text-gray);
}
.progress-item:last-child { margin-bottom: 0; }
/* === End Progress Message === */

/* remove fixed widget section if present */
.progress-widget{display:none!important;}

.progress-item details, .progress-item summary{margin:0;padding:0}
.progress-item summary{cursor:pointer;list-style:none;color: var(--primary-color);font-weight: 500;}
.progress-item summary::-webkit-details-marker{display:none;}
.progress-item summary:hover{text-decoration:underline;}
.progress-item details[open] summary{margin-bottom:8px;}

/* === Progress Message (inline) === */
.progress-html {
    max-height: 260px;
    overflow-y: auto;
    padding: 8px;
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    margin-top: 6px;
 }
 .progress-html img { max-width: 100%; height: auto; }