/* ============================================
   HOTELA CHAT WIDGET - LIVECHAT STYLE
   ============================================ */

.chat-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 99999;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Eye-Catcher Popup */
.chat-eye-catcher {
    position: absolute;
    bottom: 72px;
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.15);
    padding: 16px 20px;
    display: none;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    animation: eyeCatcherSlide 0.4s ease;
    min-width: 240px;
    max-width: 280px;
    width: max-content;
}
.chat-eye-catcher.visible {
    display: flex;
    flex-direction: row;
}
.chat-eye-catcher:hover {
    box-shadow: 0 6px 30px rgba(0,0,0,0.2);
}
@keyframes eyeCatcherSlide {
    from { opacity: 0; transform: translateY(10px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.chat-eye-catcher .eye-catcher-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #1a1a1a 0%, #333 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.chat-eye-catcher .eye-catcher-icon svg {
    width: 24px;
    height: 24px;
    fill: white;
}
.chat-eye-catcher .eye-catcher-text {
    flex: 1;
}
.chat-eye-catcher .eye-catcher-text strong {
    display: block;
    font-size: 0.95em;
    color: #1a1a1a;
    margin-bottom: 2px;
}
.chat-eye-catcher .eye-catcher-text span {
    font-size: 0.8em;
    color: #666;
}
.chat-eye-catcher .eye-catcher-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 20px;
    height: 20px;
    border: none;
    background: #f0f0f0;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #999;
    line-height: 1;
}
.chat-eye-catcher .eye-catcher-close:hover {
    background: #e0e0e0;
    color: #666;
}

/* Chat Toggle Button */
.chat-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1a1a1a 0%, #333 100%);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
}
.chat-toggle:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 30px rgba(0,0,0,0.4);
}
.chat-toggle .chat-icon,
.chat-toggle .close-icon {
    width: 28px;
    height: 28px;
    fill: white;
    transition: transform 0.3s, opacity 0.3s;
}
.chat-toggle .close-icon {
    position: absolute;
    opacity: 0;
    transform: rotate(-90deg);
}
.chat-toggle.active .chat-icon {
    opacity: 0;
    transform: rotate(90deg);
}
.chat-toggle.active .close-icon {
    opacity: 1;
    transform: rotate(0);
}
.chat-toggle .unread-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    background: #ef4444;
    border-radius: 11px;
    color: white;
    font-size: 12px;
    font-weight: 600;
    display: none;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
}
.chat-toggle .unread-badge.visible {
    display: flex;
    animation: badgePop 0.3s ease;
}
@keyframes badgePop {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}
.chat-toggle .online-dot {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 14px;
    height: 14px;
    background: #22c55e;
    border-radius: 50%;
    border: 2px solid white;
}

/* Chat Box Container */
.chat-box {
    position: absolute;
    bottom: 72px;
    right: 0;
    width: 380px;
    height: 560px;
    max-height: calc(100vh - 120px);
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 60px rgba(0,0,0,0.25);
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: chatBoxOpen 0.3s ease;
}
.chat-box.open {
    display: flex;
}
@keyframes chatBoxOpen {
    from { opacity: 0; transform: translateY(20px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Chat Header */
.chat-header {
    padding: 20px;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    color: white;
    position: relative;
}
.chat-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.chat-header-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}
.chat-header-logo {
    width: 36px;
    height: 36px;
    background: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    color: #1a1a1a;
}
.chat-header-brand h4 {
    font-size: 1.1em;
    font-weight: 600;
    margin: 0;
}
.chat-header-actions {
    display: flex;
    gap: 8px;
}
.chat-header-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255,255,255,0.1);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.chat-header-btn:hover {
    background: rgba(255,255,255,0.2);
}
.chat-header-btn svg {
    width: 18px;
    height: 18px;
    fill: white;
}
.chat-header-agents {
    display: flex;
    align-items: center;
    gap: 8px;
}
.chat-header-avatars {
    display: flex;
}
.chat-header-avatars .avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid #1a1a1a;
    margin-left: -8px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    color: white;
}
.chat-header-avatars .avatar:first-child {
    margin-left: 0;
}
.chat-header-avatars .avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}
.chat-header-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8em;
    opacity: 0.9;
}
.chat-header-status .status-dot {
    width: 8px;
    height: 8px;
    background: #22c55e;
    border-radius: 50%;
}

/* Welcome Screen */
.chat-welcome {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 24px 20px;
    background: #f8f9fa;
    overflow-y: auto;
}
.chat-welcome.hidden {
    display: none;
}
.chat-welcome-hero {
    text-align: center;
    margin-bottom: 24px;
}
.chat-welcome-hero h3 {
    font-size: 1.4em;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 8px 0;
}
.chat-welcome-hero p {
    font-size: 0.9em;
    color: #666;
    margin: 0;
}
.chat-welcome-cta {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    margin-bottom: 16px;
}
.chat-welcome-cta-btn {
    width: 100%;
    padding: 14px 20px;
    background: #1a1a1a;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: background 0.2s, transform 0.2s;
}
.chat-welcome-cta-btn:hover {
    background: #333;
    transform: translateY(-1px);
}
.chat-welcome-cta-btn svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}
.chat-quick-questions {
    margin-top: auto;
}
.chat-quick-questions h5 {
    font-size: 0.75em;
    font-weight: 600;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 12px 0;
}
.chat-quick-btn {
    display: block;
    width: 100%;
    padding: 12px 16px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    font-size: 0.9em;
    color: #1a1a1a;
    text-align: left;
    cursor: pointer;
    margin-bottom: 8px;
    transition: all 0.2s;
}
.chat-quick-btn:hover {
    background: #f8f9fa;
    border-color: #1a1a1a;
    transform: translateX(4px);
}
.chat-quick-btn:last-child {
    margin-bottom: 0;
}

/* Pre-Chat Form */
.chat-prechat-form {
    flex: 1;
    display: none;
    flex-direction: column;
    padding: 24px 20px;
    background: #f8f9fa;
    overflow-y: auto;
}
.chat-prechat-form.visible {
    display: flex;
}
.chat-prechat-form h4 {
    font-size: 1.1em;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 4px 0;
}
.chat-prechat-form > p {
    font-size: 0.85em;
    color: #666;
    margin: 0 0 20px 0;
}
.chat-form-group {
    margin-bottom: 16px;
}
.chat-form-group label {
    display: block;
    font-size: 0.85em;
    font-weight: 500;
    color: #374151;
    margin-bottom: 6px;
}
.chat-form-group input,
.chat-form-group textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    font-size: 0.95em;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}
.chat-form-group input:focus,
.chat-form-group textarea:focus {
    border-color: #1a1a1a;
    box-shadow: 0 0 0 3px rgba(26,26,26,0.1);
}
.chat-form-group textarea {
    resize: none;
    height: 80px;
}
.chat-form-submit {
    margin-top: auto;
    padding: 14px 20px;
    background: #1a1a1a;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.chat-form-submit:hover {
    background: #333;
}
.chat-form-submit:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Chat Messages Area */
.chat-messages {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    background: #f8f9fa;
    display: none;
    flex-direction: column;
}
.chat-messages.visible {
    display: flex;
}
.chat-message {
    margin-bottom: 16px;
    display: flex;
    gap: 10px;
    animation: messageSlide 0.3s ease;
}
@keyframes messageSlide {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.chat-message.sales {
    flex-direction: row;
}
.chat-message.visitor {
    flex-direction: row-reverse;
}
.chat-message .avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    color: white;
    flex-shrink: 0;
}
.chat-message .avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}
.chat-message.visitor .avatar {
    background: #1a1a1a;
}
.chat-message .message-content {
    max-width: 75%;
    display: flex;
    flex-direction: column;
}
.chat-message.visitor .message-content {
    align-items: flex-end;
}
.chat-message .sender-name {
    font-size: 0.75em;
    font-weight: 600;
    color: #666;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Sender badges (Bot/Human) */
.sender-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.85em;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.sender-badge.bot {
    background: #e0e7ff;
    color: #4f46e5;
}
.sender-badge.human {
    background: #d1fae5;
    color: #059669;
}

/* Responder badge in header */
.responder-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.9em;
    font-weight: 500;
    margin-right: 6px;
}
.responder-badge.bot {
    background: rgba(79, 70, 229, 0.2);
    color: #c7d2fe;
}
.responder-badge.human {
    background: rgba(5, 150, 105, 0.2);
    color: #6ee7b7;
}

/* Bot indicator at start of conversation */
.bot-indicator {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 12px 16px;
    margin: 0 0 12px 0;
    background: #f0f9ff;
    border-radius: 12px;
    border: 1px solid #bae6fd;
    font-size: 0.8em;
    color: #0369a1;
    line-height: 1.4;
}
.bot-indicator svg {
    width: 16px;
    height: 16px;
    fill: #0ea5e9;
    flex-shrink: 0;
    margin-top: 2px;
}
.chat-message .bubble {
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 0.9em;
    line-height: 1.5;
    word-wrap: break-word;
}
.chat-message.sales .bubble {
    background: white;
    color: #1a1a1a;
    border-radius: 18px 18px 18px 4px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}
.chat-message.visitor .bubble {
    background: #1a1a1a;
    color: white;
    border-radius: 18px 18px 4px 18px;
}
.chat-message .time {
    font-size: 0.7em;
    color: #999;
    margin-top: 4px;
}

/* System Messages (errors, notifications) */
.chat-message.system {
    justify-content: center;
    margin: 12px 0;
}
.chat-message.system .message-content {
    max-width: 90%;
    align-items: center;
}
.chat-message.system .bubble {
    background: #f3f4f6;
    color: #6b7280;
    border-radius: 12px;
    font-size: 0.85em;
    padding: 10px 16px;
    text-align: center;
    border: 1px solid #e5e7eb;
}
.chat-message.system .bubble.error {
    background: #fef2f2;
    color: #dc2626;
    border-color: #fecaca;
}

/* Quick Reply Buttons (Contextual Buttons) */
.chat-quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 16px 16px 52px;
    animation: quickRepliesSlide 0.3s ease;
}
@keyframes quickRepliesSlide {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
.quick-reply-btn {
    padding: 10px 16px;
    background: white;
    border: 1.5px solid #1a1a1a;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 500;
    color: #1a1a1a;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}
.quick-reply-btn:hover {
    background: #1a1a1a;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.quick-reply-btn:active {
    transform: translateY(0);
}

/* Typing Indicator */
.chat-typing {
    display: none;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
}
.chat-typing.visible {
    display: flex;
}
.chat-typing .avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    color: white;
}
.chat-typing .dots {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: white;
    border-radius: 18px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}
.chat-typing .dots span {
    width: 8px;
    height: 8px;
    background: #ccc;
    border-radius: 50%;
    animation: typingDot 1.4s infinite ease-in-out;
}
.chat-typing .dots span:nth-child(2) { animation-delay: 0.2s; }
.chat-typing .dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingDot {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.5; }
    40% { transform: scale(1); opacity: 1; }
}

/* Chat Input Area */
.chat-input-area {
    padding: 16px;
    border-top: 1px solid #e5e7eb;
    display: none;
    flex-direction: column;
    gap: 12px;
    background: white;
}
.chat-input-area.visible {
    display: flex;
}
.chat-input-row {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

/* Menu Button */
.chat-menu-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #f3f4f6;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}
.chat-menu-btn:hover {
    background: #e5e7eb;
}
.chat-menu-btn.active {
    background: #1a1a1a;
}
.chat-menu-btn.active svg {
    fill: white;
}
.chat-menu-btn svg {
    width: 20px;
    height: 20px;
    fill: #6b7280;
}

/* Chat Menu */
.chat-menu {
    display: none;
    flex-direction: column;
    background: white;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 4px 20px rgba(0,0,0,0.12);
    margin-bottom: 8px;
    overflow: hidden;
    animation: menuSlide 0.2s ease;
}
.chat-menu.visible {
    display: flex;
}
@keyframes menuSlide {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
.chat-menu-header {
    padding: 12px 16px 8px;
    font-size: 0.7em;
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.chat-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: none;
    border: none;
    font-size: 0.9em;
    color: #374151;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s;
}
.chat-menu-item:hover {
    background: #f9fafb;
}
.chat-menu-item svg {
    width: 18px;
    height: 18px;
    fill: #6b7280;
    flex-shrink: 0;
}
.chat-menu-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 4px 0;
}
.chat-input-wrapper {
    flex: 1;
    position: relative;
}
.chat-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 24px;
    font-size: 0.95em;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
    resize: none;
    max-height: 120px;
    min-height: 44px;
}
.chat-input:focus {
    border-color: #1a1a1a;
    box-shadow: 0 0 0 3px rgba(26,26,26,0.08);
}
.chat-input::placeholder {
    color: #9ca3af;
}
.chat-send {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #1a1a1a;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.2s;
    flex-shrink: 0;
}
.chat-send:hover {
    background: #333;
    transform: scale(1.05);
}
.chat-send:active {
    transform: scale(0.95);
}
.chat-send svg {
    width: 20px;
    height: 20px;
    fill: white;
}
.chat-powered-by {
    text-align: center;
    font-size: 0.7em;
    color: #9ca3af;
}
.chat-powered-by a {
    color: #6b7280;
    text-decoration: none;
}

/* Post-Chat Rating */
.chat-rating {
    display: none;
    flex-direction: column;
    align-items: center;
    padding: 24px 20px;
    background: white;
    border-top: 1px solid #e5e7eb;
    animation: ratingSlide 0.3s ease;
}
.chat-rating.visible {
    display: flex;
}
@keyframes ratingSlide {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.chat-rating p {
    font-size: 0.9em;
    color: #374151;
    margin: 0 0 16px 0;
    font-weight: 500;
}
.chat-rating-btns {
    display: flex;
    gap: 16px;
}
.chat-rating-btn {
    width: 56px;
    height: 56px;
    border: 2px solid #e5e7eb;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.chat-rating-btn:hover {
    transform: scale(1.1);
}
.chat-rating-btn.positive:hover {
    border-color: #22c55e;
    background: #f0fdf4;
}
.chat-rating-btn.negative:hover {
    border-color: #ef4444;
    background: #fef2f2;
}
.chat-rating-btn.selected.positive {
    border-color: #22c55e;
    background: #22c55e;
}
.chat-rating-btn.selected.negative {
    border-color: #ef4444;
    background: #ef4444;
}
.chat-rating-btn.selected svg {
    fill: white;
}
.chat-rating-btn svg {
    width: 28px;
    height: 28px;
    fill: #9ca3af;
    transition: fill 0.2s;
}
.chat-rating-btn.positive svg { fill: #22c55e; }
.chat-rating-btn.negative svg { fill: #ef4444; }
.chat-rating-thanks {
    display: none;
    text-align: center;
    padding: 16px;
    color: #22c55e;
    font-weight: 500;
}
.chat-rating-thanks.visible {
    display: block;
}

/* Mobile Responsive - Tablets */
@media (max-width: 768px) {
    .chat-box {
        width: 340px;
        height: 500px;
    }
}

/* Mobile Responsive - Phones */
@media (max-width: 480px) {
    .chat-widget {
        bottom: 16px;
        right: 16px;
    }

    /* Full-screen chat on mobile */
    .chat-box {
        position: fixed;
        top: 0;
        bottom: 0;
        right: 0;
        left: 0;
        width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
        /* Safe area for notch/home indicator */
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
    }

    /* Smaller toggle button */
    .chat-toggle {
        width: 54px;
        height: 54px;
    }
    .chat-toggle .chat-icon,
    .chat-toggle .close-icon {
        width: 24px;
        height: 24px;
    }

    /* Reposition eye-catcher */
    .chat-eye-catcher {
        right: 0;
        left: auto;
        bottom: 72px;
        min-width: 200px;
        max-width: calc(100vw - 90px);
        padding: 12px 16px;
        flex-direction: row;
    }
    .chat-eye-catcher .eye-catcher-icon {
        width: 40px;
        height: 40px;
    }
    .chat-eye-catcher .eye-catcher-icon svg {
        width: 20px;
        height: 20px;
    }

    /* Compact header on mobile */
    .chat-header {
        padding: 16px;
        padding-top: calc(16px + env(safe-area-inset-top));
    }
    .chat-header-top {
        margin-bottom: 8px;
    }
    .chat-header-logo {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }
    .chat-header-brand h4 {
        font-size: 1em;
    }
    .chat-header-avatars .avatar {
        width: 28px;
        height: 28px;
        font-size: 11px;
    }
    .chat-header-status {
        font-size: 0.75em;
    }

    /* Welcome screen adjustments */
    .chat-welcome {
        padding: 20px 16px;
    }
    .chat-welcome-hero h3 {
        font-size: 1.25em;
    }
    .chat-welcome-cta {
        padding: 16px;
    }
    .chat-welcome-cta-btn {
        padding: 12px 16px;
        font-size: 0.95em;
    }

    /* Larger touch targets for quick buttons */
    .chat-quick-btn {
        padding: 14px 16px;
        font-size: 0.9em;
        min-height: 48px;
    }

    /* Pre-chat form adjustments */
    .chat-prechat-form {
        padding: 20px 16px;
    }
    .chat-form-group input,
    .chat-form-group textarea {
        padding: 14px 16px;
        font-size: 16px; /* Prevents iOS zoom on focus */
        min-height: 48px;
    }
    .chat-form-submit {
        padding: 14px 20px;
        min-height: 48px;
    }

    /* Messages area */
    .chat-messages {
        padding: 12px;
    }
    .chat-message .avatar {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }
    .chat-message .bubble {
        padding: 10px 14px;
        font-size: 0.9em;
    }

    /* Input area with safe area */
    .chat-input-area {
        padding: 12px 16px;
        padding-bottom: calc(12px + env(safe-area-inset-bottom));
    }
    .chat-input {
        padding: 12px 16px;
        font-size: 16px; /* Prevents iOS zoom on focus */
        min-height: 44px;
    }
    .chat-send {
        width: 44px;
        height: 44px;
    }
    .chat-send svg {
        width: 18px;
        height: 18px;
    }

    /* Rating buttons - larger touch targets */
    .chat-rating {
        padding: 20px 16px;
        padding-bottom: calc(20px + env(safe-area-inset-bottom));
    }
    .chat-rating-btn {
        width: 52px;
        height: 52px;
    }
    .chat-rating-btn svg {
        width: 24px;
        height: 24px;
    }
}

/* Very small phones */
@media (max-width: 360px) {
    .chat-widget {
        bottom: 12px;
        right: 12px;
    }
    .chat-toggle {
        width: 50px;
        height: 50px;
    }
    .chat-eye-catcher {
        left: auto;
        right: 0;
        min-width: 180px;
        max-width: calc(100vw - 80px);
        flex-direction: row;
    }
    .chat-header {
        padding: 12px;
        padding-top: calc(12px + env(safe-area-inset-top));
    }
    .chat-welcome {
        padding: 16px 12px;
    }
    .chat-prechat-form {
        padding: 16px 12px;
    }
}

/* Landscape mode on phones */
@media (max-height: 500px) and (max-width: 900px) {
    .chat-box {
        height: 100%;
        max-height: 100vh;
    }
    .chat-header {
        padding: 10px 16px;
        padding-top: calc(10px + env(safe-area-inset-top));
    }
    .chat-header-top {
        margin-bottom: 4px;
    }
    .chat-header-agents {
        display: none; /* Hide avatars in landscape to save space */
    }
    .chat-welcome {
        padding: 12px 16px;
    }
    .chat-welcome-hero {
        margin-bottom: 12px;
    }
    .chat-welcome-hero h3 {
        font-size: 1.1em;
        margin-bottom: 4px;
    }
    .chat-welcome-cta {
        padding: 12px;
        margin-bottom: 10px;
    }
    .chat-quick-btn {
        padding: 10px 14px;
        margin-bottom: 6px;
    }
}

/* =====================================================
   WEBRTC CALL & PRESENTATION UI
   ===================================================== */

/* Guide Cursor (Presentation Mode) */
.hotela-guide-cursor {
    position: fixed;
    display: none;
    pointer-events: none;
    z-index: 999999;
    transform: translate(-2px, -2px);
}

.hotela-guide-cursor svg {
    width: 24px;
    height: 24px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.guide-cursor-label {
    position: absolute;
    top: 24px;
    left: 12px;
    background: #0066CC;
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Incoming Call Overlay */
/* ============================================
   INCOMING CALL - FaceTime Style
   Full screen with blur background
   ============================================ */

.hotela-call-incoming {
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, rgba(26, 26, 46, 0.95) 0%, rgba(22, 33, 62, 0.95) 100%);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 999998;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    animation: fadeInCall 0.3s ease;
}

.hotela-call-incoming.visible {
    display: flex;
}

.call-incoming-modal {
    text-align: center;
    max-width: 400px;
    padding: 40px;
    animation: scaleIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes scaleIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.call-incoming-modal .caller-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    margin: 0 auto 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 42px;
    font-weight: 600;
    color: white;
    box-shadow: 0 8px 40px rgba(102, 126, 234, 0.4);
    animation: incoming-pulse 2s ease-in-out infinite;
}

@keyframes incoming-pulse {
    0%, 100% {
        box-shadow: 0 8px 40px rgba(102, 126, 234, 0.4);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 8px 60px rgba(102, 126, 234, 0.6), 0 0 0 20px rgba(102, 126, 234, 0.1);
        transform: scale(1.02);
    }
}

.call-incoming-modal .caller-avatar svg {
    width: 48px;
    height: 48px;
    fill: none;
    stroke: white;
    stroke-width: 2;
}

.call-incoming-modal h3 {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 8px;
    color: white;
    letter-spacing: -0.5px;
}

.call-incoming-modal p {
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 48px;
    font-size: 16px;
}

.call-incoming-modal .call-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    color: white;
    font-size: 13px;
    margin-bottom: 16px;
}

.call-incoming-modal .call-type-badge svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
}

.call-actions {
    display: flex;
    gap: 48px;
    justify-content: center;
}

.call-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 0;
    background: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.call-btn:hover {
    transform: scale(1.08);
}

.call-btn .btn-circle {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.call-btn svg {
    width: 28px;
    height: 28px;
    fill: none;
    stroke: white;
    stroke-width: 2;
}

.call-btn .btn-label {
    font-size: 13px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
}

.call-btn.decline .btn-circle {
    background: #ef4444;
    box-shadow: 0 4px 20px rgba(239, 68, 68, 0.4);
}

.call-btn.decline:hover .btn-circle {
    background: #dc2626;
    box-shadow: 0 6px 25px rgba(239, 68, 68, 0.5);
}

.call-btn.accept .btn-circle {
    background: #22c55e;
    box-shadow: 0 4px 20px rgba(34, 197, 94, 0.4);
}

.call-btn.accept:hover .btn-circle {
    background: #16a34a;
    box-shadow: 0 6px 25px rgba(34, 197, 94, 0.5);
}

/* In-Call Banner (Voice) */
.hotela-in-call-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: #22c55e;
    color: white;
    padding: 12px 24px;
    display: none;
    align-items: center;
    justify-content: center;
    gap: 12px;
    z-index: 999997;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 0.9em;
}

.hotela-in-call-banner.visible {
    display: flex;
}

.hotela-in-call-banner .call-pulse {
    width: 10px;
    height: 10px;
    background: white;
    border-radius: 50%;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.2); }
}

.hotela-in-call-banner button {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85em;
    margin-left: auto;
    transition: background 0.2s;
}

.hotela-in-call-banner button:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ============================================
   VIDEO CALL UI - FaceTime Style
   Modern, glassmorphic design
   ============================================ */

/* Video Call Container - Full overlay style */
.hotela-video-container {
    position: fixed;
    inset: 0;
    background: #000;
    z-index: 999996;
    display: none;
    flex-direction: column;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    animation: fadeInCall 0.3s ease;
}

@keyframes fadeInCall {
    from { opacity: 0; }
    to { opacity: 1; }
}

.hotela-video-container.visible {
    display: flex;
}

/* Minimized pip mode */
.hotela-video-container.minimized {
    inset: auto;
    bottom: 100px;
    right: 24px;
    width: 180px;
    height: 240px;
    border-radius: 16px;
    cursor: pointer;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    overflow: hidden;
}

.hotela-video-container.minimized .video-header,
.hotela-video-container.minimized .video-controls-wrapper {
    display: none;
}

.hotela-video-container.minimized .video-area {
    height: 100%;
}

.hotela-video-container.minimized .local-video-pip {
    display: none;
}

/* Header - Glassmorphic overlay at top */
.video-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    background: linear-gradient(to bottom, rgba(0,0,0,0.6) 0%, transparent 100%);
    z-index: 10;
}

.video-header .caller-info {
    display: flex;
    align-items: center;
    gap: 14px;
    color: white;
}

.video-header .caller-avatar {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 600;
    color: white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.video-header .caller-details {
    display: flex;
    flex-direction: column;
}

.video-header .caller-name {
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -0.3px;
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.video-header .call-duration {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 400;
    display: flex;
    align-items: center;
    gap: 6px;
}

.video-header .call-status-dot {
    width: 8px;
    height: 8px;
    background: #34d399;
    border-radius: 50%;
    animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Recording indicator */
.recording-indicator {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: rgba(239, 68, 68, 0.9);
    border-radius: 20px;
    color: white;
    font-size: 13px;
    font-weight: 500;
}

.recording-indicator.active {
    display: flex;
}

.recording-indicator .rec-dot {
    width: 10px;
    height: 10px;
    background: white;
    border-radius: 50%;
    animation: blink-rec 1s infinite;
}

@keyframes blink-rec {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.view-controls {
    display: flex;
    gap: 10px;
}

.view-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.view-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.05);
}

.view-btn svg {
    width: 18px;
    height: 18px;
    fill: white;
}

/* Video Area - Full screen remote video */
.video-area {
    position: relative;
    flex: 1;
    background: linear-gradient(135deg, #0f0f23 0%, #1a1a3e 50%, #2d1b4e 100%);
    background-size: 200% 200%;
    animation: gradientShift 15s ease infinite;
    overflow: hidden;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* Subtle ambient glow effect */
.video-area::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(102, 126, 234, 0.15) 0%, transparent 70%);
    pointer-events: none;
    animation: ambientPulse 4s ease-in-out infinite;
}

@keyframes ambientPulse {
    0%, 100% { opacity: 0.5; transform: translate(-50%, -50%) scale(1); }
    50% { opacity: 0.8; transform: translate(-50%, -50%) scale(1.2); }
}

.video-area #remoteVideoVisitor {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Local video - Picture in Picture style */
.local-video-pip {
    position: absolute;
    top: 80px;
    right: 20px;
    width: 140px;
    height: 200px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    cursor: move;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    z-index: 5;
}

.local-video-pip:hover {
    transform: scale(1.02);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}

.local-video-pip video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1); /* Mirror effect */
}

.local-video-pip .pip-border {
    position: absolute;
    inset: 0;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    pointer-events: none;
}

/* Voice call avatar display */
.voice-call-avatar {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: white;
    z-index: 2;
}

.voice-call-avatar .avatar-circle {
    width: 160px;
    height: 160px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 56px;
    font-weight: 600;
    position: relative;
    margin: 0 auto 20px;
    box-shadow: 0 8px 40px rgba(102, 126, 234, 0.4);
    animation: avatar-pulse 3s ease-in-out infinite;
}

@keyframes avatar-pulse {
    0%, 100% { box-shadow: 0 8px 40px rgba(102, 126, 234, 0.4); }
    50% { box-shadow: 0 8px 60px rgba(102, 126, 234, 0.6); }
}

/* Audio wave rings */
.voice-call-avatar .avatar-circle::before,
.voice-call-avatar .avatar-circle::after {
    content: '';
    position: absolute;
    inset: -20px;
    border-radius: 50%;
    border: 2px solid rgba(102, 126, 234, 0.3);
    animation: audioRing 2s ease-out infinite;
}

.voice-call-avatar .avatar-circle::after {
    animation-delay: 1s;
}

@keyframes audioRing {
    0% { transform: scale(1); opacity: 0.6; }
    100% { transform: scale(1.5); opacity: 0; }
}

.voice-call-avatar .avatar-name {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.voice-call-avatar .avatar-status {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Audio equalizer bars */
.voice-call-avatar .audio-bars {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 3px;
    height: 20px;
    margin-top: 16px;
}

.voice-call-avatar .audio-bar {
    width: 4px;
    background: linear-gradient(to top, #667eea, #a78bfa);
    border-radius: 2px;
    animation: audioBar 0.8s ease-in-out infinite;
}

.voice-call-avatar .audio-bar:nth-child(1) { animation-delay: 0s; height: 8px; }
.voice-call-avatar .audio-bar:nth-child(2) { animation-delay: 0.1s; height: 16px; }
.voice-call-avatar .audio-bar:nth-child(3) { animation-delay: 0.2s; height: 12px; }
.voice-call-avatar .audio-bar:nth-child(4) { animation-delay: 0.15s; height: 20px; }
.voice-call-avatar .audio-bar:nth-child(5) { animation-delay: 0.25s; height: 14px; }
.voice-call-avatar .audio-bar:nth-child(6) { animation-delay: 0.1s; height: 10px; }
.voice-call-avatar .audio-bar:nth-child(7) { animation-delay: 0.2s; height: 6px; }

@keyframes audioBar {
    0%, 100% { transform: scaleY(0.5); }
    50% { transform: scaleY(1.2); }
}

/* Controls - Floating glassmorphic bar */
.video-controls-wrapper {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 30px 24px 40px;
    background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 100%);
    display: flex;
    justify-content: center;
}

.video-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    background: rgba(60, 60, 60, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 28px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.ctrl-btn {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    position: relative;
}

.ctrl-btn svg {
    width: 24px;
    height: 24px;
    stroke: white;
    fill: none;
    stroke-width: 2;
}

.ctrl-btn.mute {
    background: rgba(255, 255, 255, 0.2);
}

.ctrl-btn.mute:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.08);
}

.ctrl-btn.mute.active {
    background: rgba(239, 68, 68, 0.9);
}

.ctrl-btn.mute.active svg {
    stroke: white;
}

/* Slash line for muted state */
.ctrl-btn.mute.active::after {
    content: '';
    position: absolute;
    width: 28px;
    height: 2px;
    background: white;
    transform: rotate(-45deg);
    border-radius: 1px;
}

.ctrl-btn.record {
    background: rgba(255, 255, 255, 0.2);
}

.ctrl-btn.record:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.08);
}

.ctrl-btn.record.active {
    background: rgba(239, 68, 68, 0.9);
    animation: record-pulse 1.5s ease-in-out infinite;
}

@keyframes record-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
    50% { box-shadow: 0 0 0 12px rgba(239, 68, 68, 0); }
}

.ctrl-btn.record svg {
    fill: white;
    stroke: none;
}

.ctrl-btn.end-call {
    background: #ef4444;
    width: 64px;
}

.ctrl-btn.end-call:hover {
    background: #dc2626;
    transform: scale(1.08);
}

.ctrl-btn.end-call svg {
    stroke: white;
}

/* Control button labels on hover */
.ctrl-btn-label {
    position: absolute;
    bottom: -28px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 11px;
    color: rgba(255, 255, 255, 0.8);
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
}

.ctrl-btn:hover .ctrl-btn-label {
    opacity: 1;
}

/* Presentation Mode Indicator */
.hotela-presentation-indicator {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 102, 204, 0.95);
    color: white;
    padding: 12px 24px;
    border-radius: 100px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 14px;
    display: none;
    align-items: center;
    gap: 12px;
    z-index: 999995;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.hotela-presentation-indicator.visible {
    display: flex;
}

.hotela-presentation-indicator .pulse-dot {
    width: 8px;
    height: 8px;
    background: #22c55e;
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}

/* Mobile adjustments for call UI */
@media (max-width: 480px) {
    .hotela-video-container {
        bottom: 80px;
        right: 16px;
        left: 16px;
        width: auto;
    }

    .hotela-video-container.minimized {
        width: 140px;
        height: 100px;
        left: auto;
    }

    .call-incoming-modal {
        margin: 16px;
        padding: 32px 24px;
    }

    .hotela-in-call-banner {
        padding: 10px 16px;
        font-size: 0.85em;
    }

    .hotela-presentation-indicator {
        left: 16px;
        right: 16px;
        transform: none;
        justify-content: center;
    }
}

/* ==========================================================================
   CHAT-LAB PORT (2026-04-15) — iMessage aesthetic applied to the embedded
   widget. Preserves widget structure; overrides surface colors, radii,
   typography, and interactive elements so the whole system feels like the
   chat-lab prototype.
   ========================================================================== */

:root {
    --chat-lab-blue: #007AFF;
    --chat-lab-gray: #e9e9eb;
    --chat-lab-ink: #1a1a1a;
    --chat-lab-muted: #8e8e93;
    --chat-lab-border: #ddd;
    --chat-lab-red: #c0392b;
    --chat-lab-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
}

/* Root typeface */
.chat-widget, .chat-box, .chat-message, .chat-header, .chat-input, .chat-quick-btn {
    font-family: var(--chat-lab-sans) !important;
    -webkit-font-smoothing: antialiased;
}

/* Bot (sales) bubble — iMessage gray, tail bottom-left */
.chat-message.sales .bubble {
    background: var(--chat-lab-gray) !important;
    color: var(--chat-lab-ink) !important;
    border: none !important;
    border-radius: 18px 18px 18px 4px !important;
    padding: 10px 14px !important;
    font-size: 0.95em !important;
    line-height: 1.55 !important;
    max-width: 88% !important;
    box-shadow: none !important;
}

/* User (visitor) bubble — iMessage blue, tail bottom-right */
.chat-message.visitor .bubble {
    background: var(--chat-lab-blue) !important;
    color: #fff !important;
    border: none !important;
    border-radius: 18px 18px 4px 18px !important;
    padding: 10px 14px !important;
    font-size: 0.95em !important;
    line-height: 1.45 !important;
    max-width: 80% !important;
}

/* Images and CTA inside bot bubbles */
.chat-message.sales .bubble img {
    width: 100%;
    border-radius: 12px;
    margin-top: 8px;
    max-height: 160px;
    object-fit: cover;
}
.chat-message.sales .bubble a.cta,
.chat-message.sales .bubble .cta {
    display: inline-block;
    margin-top: 8px;
    padding: 7px 18px;
    background: var(--chat-lab-blue);
    color: #fff;
    border-radius: 16px;
    font-size: 0.85em;
    font-weight: 500;
    text-decoration: none;
    transition: opacity 0.15s;
}
.chat-message.sales .bubble a.cta:hover { opacity: 0.85; }

/* Quick questions + chip rows (pill style from chat-lab) */
.chat-quick-btn,
.quick-reply-btn {
    padding: 7px 14px !important;
    border: 1px solid var(--chat-lab-border) !important;
    border-radius: 16px !important;
    font-family: var(--chat-lab-sans) !important;
    font-size: 0.82em !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    background: #fff !important;
    color: var(--chat-lab-blue) !important;
    transition: all 0.12s ease !important;
}
.chat-quick-btn:hover,
.quick-reply-btn:hover {
    background: var(--chat-lab-blue) !important;
    color: #fff !important;
    border-color: var(--chat-lab-blue) !important;
}

/* Input bar + send button + mic button (chat-lab pill aesthetic) */
.chat-input {
    border-radius: 20px !important;
    border: 1px solid var(--chat-lab-border) !important;
    font-family: var(--chat-lab-sans) !important;
    font-size: 0.95em !important;
    padding: 10px 16px !important;
    background: #fff !important;
}
.chat-input:focus {
    border-color: var(--chat-lab-blue) !important;
    outline: none !important;
}
.chat-send {
    width: 34px !important;
    height: 34px !important;
    border-radius: 50% !important;
    background: var(--chat-lab-blue) !important;
    border: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
}
.chat-mic-btn {
    width: 34px !important;
    height: 34px !important;
    border-radius: 50% !important;
    background: none !important;
    border: 1.5px solid var(--chat-lab-border) !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.15s ease !important;
}
.chat-mic-btn:hover { border-color: var(--chat-lab-blue) !important; }
.chat-mic-btn svg { width: 16px !important; height: 16px !important; fill: var(--chat-lab-muted) !important; }
.chat-mic-btn.listening,
.chat-mic-btn.recording {
    background: var(--chat-lab-red) !important;
    border-color: var(--chat-lab-red) !important;
    animation: chatLabPulse 1s infinite;
}
.chat-mic-btn.listening svg,
.chat-mic-btn.recording svg { fill: #fff !important; }
@keyframes chatLabPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Typing indicator — chat-lab dot animation */
.chat-typing, .typing-indicator {
    background: var(--chat-lab-gray) !important;
    border-radius: 18px 18px 18px 4px !important;
    padding: 10px 14px !important;
    color: var(--chat-lab-muted) !important;
    font-size: 0.85em !important;
}

/* Chat box surface radius — slightly softer to match chat-lab cards */
.chat-box {
    border-radius: 16px !important;
}

/* ==========================================================================
   CHAT-LAB PORT — strip support-desk chrome (2026-04-15)
   Chat-lab is a pure bubble stream: no sender labels, no per-message avatars,
   no timestamps under bubbles, no "Powered by" footer, no version badge.
   ========================================================================== */

/* Remove per-message avatars (the V / H circle beside every bubble) */
.chat-message .avatar { display: none !important; }

/* Remove the "Visitor" / sender name label above each bubble */
.chat-message .sender-name { display: none !important; }

/* Remove timestamp under bubbles (chat-lab doesn't show per-message time) */
.chat-message .time,
.chat-message .bubble + .time,
.chat-message time { display: none !important; }

/* Remove "Powered by HOTELA" footer strip */
.chat-powered-by { display: none !important; }

/* Remove version-number badge (e.g. "v2.6.0") */
.chat-version, [class*="chat-version"] { display: none !important; }

/* Slim the header — hide the "We typically reply in minutes" bar + avatar cluster */
.chat-header-brand [data-i18n="chat_reply_time"],
.chat-header-brand .responder-badge,
.chat-sales-avatars,
.chat-online-sales,
.chat-header-status { display: none !important; }

/* Make message-content fill the row now that the avatar is gone */
.chat-message .message-content { margin-left: 0 !important; margin-right: 0 !important; }
.chat-message { align-items: flex-end !important; }
.chat-message.sales { justify-content: flex-start !important; }
.chat-message.visitor { justify-content: flex-end !important; }

/* Slightly wider bubbles now that avatars are gone */
.chat-message.sales .bubble  { max-width: 92% !important; }
.chat-message.visitor .bubble { max-width: 82% !important; }

/* Tighter vertical rhythm between bubbles (iMessage style) */
.chat-message { margin-bottom: 6px !important; }

/* ==========================================================================
   CHAT-LAB PORT v2 (2026-04-15) — match Kyle's iMessage reference exactly.
   Fixes bubble width collapse + kills remaining S/M avatar cluster.
   ========================================================================== */

/* Hide the "S M" header avatar cluster (the two purple circles) */
.chat-header-avatars,
.chat-sales-status,
.chat-online-indicator { display: none !important; }

/* Row layout — one flex row per message, bubbles flow to the right side
   for the visitor and the left side for the bot. No flex columns. */
.chat-messages .chat-message {
    display: flex !important;
    width: 100% !important;
    margin: 2px 0 !important;
    align-items: flex-end !important;
}
.chat-message.visitor { justify-content: flex-end !important; }
.chat-message.sales   { justify-content: flex-start !important; }

/* The message-content wrapper is what holds the bubble. Let it shrink to
   content width but cap at 75% of the chat panel. */
.chat-message .message-content {
    max-width: 75% !important;
    width: auto !important;
    display: inline-block !important;
    margin: 0 !important;
}

/* Bubble — let text flow to fill naturally within the 75% cap */
.chat-message .bubble {
    display: inline-block !important;
    width: auto !important;
    max-width: 100% !important;
    padding: 9px 14px !important;
    font-size: 15px !important;
    line-height: 1.35 !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    white-space: normal !important;
}

/* iMessage-style bubble colors + corner tail (flat corner on sender side) */
.chat-message.visitor .bubble {
    background: #007AFF !important;
    color: #fff !important;
    border-radius: 22px 22px 4px 22px !important;
    box-shadow: 0 1px 2px rgba(0,0,0,0.08) !important;
}
.chat-message.sales .bubble {
    background: #E9E9EB !important;
    color: #1a1a1a !important;
    border-radius: 22px 22px 22px 4px !important;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04) !important;
}

/* Group consecutive same-sender bubbles tight (remove the tail on non-last) */
.chat-message + .chat-message.visitor .bubble,
.chat-message + .chat-message.sales   .bubble {
    /* keep all four corners rounded when not the last of a group */
    /* (simple approximation — full iMessage grouping needs DOM awareness) */
}

/* The chat-messages container itself — give it a bit more room */
.chat-messages { padding: 12px 14px !important; }

/* ==========================================================================
   CHAT-LAB PORT v3 — cap ALL images returned by the bot (2026-04-15)
   ========================================================================== */

/* Any image inside the message stream — belt + suspenders */
.chat-messages img,
.chat-message img,
.chat-message .bubble img,
.chat-message .message-content img {
    max-width: 100% !important;
    max-height: 180px !important;
    width: auto !important;
    height: auto !important;
    display: block !important;
    border-radius: 12px !important;
    margin-top: 8px !important;
    object-fit: cover !important;
}

/* ==========================================================================
   CHAT-LAB PORT v4 — fix left/right alignment.
   Original widget uses flex-direction: row-reverse on visitor to put the
   avatar on the left; with avatars hidden, row-reverse + justify-content
   fights and pushes visitor bubbles LEFT. Force normal direction.
   ========================================================================== */
.chat-messages .chat-message.visitor { flex-direction: row !important; }
.chat-messages .chat-message.sales   { flex-direction: row !important; }

/* Now the existing justify-content rules apply correctly:
   visitor -> flex-end (right), sales -> flex-start (left). */
