/* ===================================
   Help Chat Widget Styles
   Travel Agency Theme - Modern & Clean
   =================================== */

/* CSS Variables for easy theming */
:root {
    --chat-primary: #0a2d63;
    --chat-primary-dark: #0b5ed7;
    --chat-secondary: #6c757d;
    --chat-success: #198754;
    --chat-warning: #ffc107;
    --chat-danger: #dc3545;
    --chat-bg: #ffffff;
    --chat-header-bg: linear-gradient(135deg, #0a2d63 0%, #0f3f86 100%);
    --chat-message-user: #0a2d63;
    --chat-message-bot: #f8f9fa;
    --chat-message-admin: #198754;
    --chat-border-radius: 20px;
    --chat-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

/* Floating Chat Button */
.help-chat-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--chat-header-bg);
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    box-shadow: var(--chat-shadow);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    animation: pulse-btn 2s infinite;
}

.help-chat-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.25);
}

.chat-btn-pulse {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: inherit;
    animation: pulse-ring 1.5s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
    z-index: -1;
}

@keyframes pulse-ring {
    0% {
        transform: scale(0.9);
        opacity: 0.8;
    }

    100% {
        transform: scale(1.4);
        opacity: 0;
    }
}

@keyframes pulse-btn {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

/* Chat Container */
.help-chat-container {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 400px;
    max-width: calc(100vw - 40px);
    height: 580px;
    max-height: calc(100vh - 150px);
    background: var(--chat-bg);
    border-radius: var(--chat-border-radius);
    box-shadow: var(--chat-shadow);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease-out;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Chat Header */
.help-chat-header {
    background: var(--chat-header-bg);
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: white;
    flex-shrink: 0;
}

.chat-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-avatar {
    width: 45px;
    height: 45px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.chat-title h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.chat-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    opacity: 0.9;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.status-dot.online {
    background-color: #4ade80;
    box-shadow: 0 0 8px #4ade80;
}

.status-dot.offline {
    background-color: #f87171;
}

.status-dot.connecting {
    background-color: #fbbf24;
    animation: blink 1s infinite;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.3;
    }
}

.chat-header-actions {
    display: flex;
    gap: 8px;
}

.chat-action-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.chat-action-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Mode Toggle Tabs */
.chat-mode-tabs {
    display: flex;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    flex-shrink: 0;
}

.mode-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    border: none;
    background: transparent;
    color: #6c757d;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.mode-tab:hover {
    background: #e9ecef;
}

.mode-tab.active {
    color: #0a2d63;
    background: white;
}

.mode-tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(135deg, #0a2d63 0%, #0f3f86 100%);
}

.mode-tab.highlight {
    animation: tab-highlight 1s ease-in-out infinite;
}

@keyframes tab-highlight {

    0%,
    100% {
        background: white;
    }

    50% {
        background: #fff3cd;
    }
}

/* Chat Messages */
.help-chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.chat-message {
    display: flex;
    gap: 10px;
    max-width: 85%;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.chat-message.bot,
.chat-message.admin,
.chat-message.system {
    align-self: flex-start;
}

.chat-message.system {
    align-self: center;
    max-width: 90%;
}

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 16px;
}

.chat-message.user .message-avatar {
    background: var(--chat-message-user);
    color: white;
}

.chat-message.bot .message-avatar {
    background: #e9ecef;
    color: #6c757d;
}

.chat-message.admin .message-avatar {
    background: var(--chat-message-admin);
    color: white;
}

.chat-message.system .message-avatar {
    background: #17a2b8;
    color: white;
}

.message-content {
    background: white;
    padding: 12px 16px;
    border-radius: 18px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.chat-message.user .message-content {
    background: var(--chat-message-user);
    color: white;
    border-bottom-right-radius: 4px;
}

.chat-message.bot .message-content {
    background: white;
    border-bottom-left-radius: 4px;
}

.chat-message.admin .message-content {
    background: #d1fae5;
    border-bottom-left-radius: 4px;
}

.chat-message.system .message-content {
    background: #e2e3e5;
    color: #666;
    font-style: italic;
    font-size: 13px;
    text-align: center;
}

.message-content p {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

.message-time {
    display: block;
    font-size: 11px;
    opacity: 0.7;
    margin-top: 5px;
    text-align: right;
}

.chat-message.user .message-time {
    color: rgba(255, 255, 255, 0.8);
}

/* Message Attachments */
.message-attachment {
    margin-top: 10px;
}

.message-attachment.image-attachment img,
.chat-image {
    max-width: 200px;
    max-height: 150px;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s;
}

.message-attachment.image-attachment img:hover,
.chat-image:hover {
    transform: scale(1.02);
}

.message-attachment.file-attachment a,
.file-download-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 8px;
    color: inherit;
    text-decoration: none;
    font-size: 13px;
}

.chat-message.user .message-attachment.file-attachment a {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

/* Typing Indicator */
.typing-indicator-container {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 20px;
    font-size: 12px;
    color: #666;
    font-style: italic;
}

.chat-message.typing .message-content {
    padding: 15px 20px;
}

.typing-dots {
    display: flex;
    gap: 4px;
}

.typing-dots span {
    width: 8px;
    height: 8px;
    background: #adb5bd;
    border-radius: 50%;
    animation: typingDot 1.4s infinite ease-in-out;
}

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

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

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

@keyframes typingDot {

    0%,
    60%,
    100% {
        transform: translateY(0);
    }

    30% {
        transform: translateY(-5px);
    }
}

/* Chat Input */
.help-chat-input {
    padding: 15px 20px;
    background: white;
    border-top: 1px solid #e9ecef;
    flex-shrink: 0;
}

.chat-form {
    display: flex;
    gap: 10px;
    align-items: center;
}

.chat-file-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #f8f9fa;
    color: #6c757d;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.chat-file-btn:hover {
    background: #e9ecef;
    color: #0a2d63;
}

.chat-input {
    flex: 1;
    padding: 12px 18px;
    border: 2px solid #e9ecef;
    border-radius: 25px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s;
}

.chat-input:focus {
    border-color: var(--chat-primary);
}

.chat-input::placeholder {
    color: #adb5bd;
}

.chat-send-btn {
    width: 45px;
    height: 45px;
    border: none;
    background: var(--chat-header-bg);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.chat-send-btn:hover {
    transform: scale(1.1);
}

/* File Preview */
.file-preview-container {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    background: #fff3cd;
    border-top: 1px solid #ffc107;
}

.file-preview-content {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
}

.file-preview-content img {
    max-width: 60px;
    max-height: 60px;
    border-radius: 8px;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.file-info i {
    color: #0a2d63;
}

.remove-file-btn {
    width: 30px;
    height: 30px;
    border: none;
    background: #dc3545;
    color: white;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Image Lightbox */
.image-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
}

.lightbox-content {
    position: relative;
    z-index: 1;
    max-width: 90%;
    max-height: 90%;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 85vh;
    border-radius: 8px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
    position: absolute;
    top: -45px;
    right: 0;
    background: none;
    border: none;
    color: white;
    font-size: 36px;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.lightbox-close:hover {
    opacity: 1;
}

/* Scrollbar styling */
.help-chat-messages::-webkit-scrollbar {
    width: 6px;
}

.help-chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.help-chat-messages::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.help-chat-messages::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Mobile Responsiveness */
@media (max-width: 480px) {
    .help-chat-btn {
        bottom: 16px;
        right: 14px;
        width: 46px;
        height: 46px;
        font-size: 19px;
    }

    .help-chat-container {
        bottom: 0;
        right: 0;
        width: 100%;
        max-width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
    }

    .chat-avatar {
        width: 40px;
        height: 40px;
    }

    .chat-title h4 {
        font-size: 15px;
    }

    .mode-tab {
        font-size: 12px;
        padding: 10px;
    }
}

/* RTL Support */
[dir="rtl"] .help-chat-btn {
    right: auto;
    left: 30px;
}
@media (max-width: 480px) {
    [dir="rtl"] .help-chat-btn { left: 14px; }
}

[dir="rtl"] .help-chat-container {
    right: auto;
    left: 30px;
}

[dir="rtl"] .chat-message.user {
    flex-direction: row;
}

[dir="rtl"] .chat-message.bot,
[dir="rtl"] .chat-message.admin {
    flex-direction: row-reverse;
}

[dir="rtl"] .chat-message.user .message-content {
    border-bottom-right-radius: 18px;
    border-bottom-left-radius: 4px;
}

[dir="rtl"] .chat-message.bot .message-content,
[dir="rtl"] .chat-message.admin .message-content {
    border-bottom-left-radius: 18px;
    border-bottom-right-radius: 4px;
}

@media (max-width: 480px) {
    [dir="rtl"] .help-chat-btn {
        left: 20px;
    }

    [dir="rtl"] .help-chat-container {
        left: 0;
    }
}
/* ---- LilBooking : quick topics + brand accents ---- */
.help-chat-container, .help-chat-container *:not(i) { font-family: 'Poppins', 'Heebo', sans-serif; }
.chat-quick { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 12px; border-top: 1px solid #e9ecef; background: #f4f7fb; }
.chat-quick button { border: 1px solid #d8e1ee; background: #fff; color: #0a2d63; border-radius: 999px; padding: 5px 11px;
    font-size: 12.5px; font-weight: 500; cursor: pointer; line-height: 1.2; transition: all .15s; }
.chat-quick button:hover { border-color: #8cbf1f; background: #8cbf1f; color: #fff; }
.chat-quick button.live { border-color: #8cbf1f; color: #5d8a0c; }
.chat-quick button.live:hover { color: #fff; }
.help-chat-header .chat-title h4 { color: #fff !important; }
.help-chat-header .chat-status { color: rgba(255,255,255,.85); }
.chat-form .chat-input { min-width: 0; }
.chat-form .chat-send-btn, .chat-form .chat-attach-btn, .chat-form label { flex-shrink: 0; }
.help-chat-btn { background: #8cbf1f; box-shadow: 0 10px 24px rgba(140,191,31,.45); }
.help-chat-btn:hover { background: #78a614; }
/* buttons under a robot answer (pages of the site, other questions, advisor) */
.chat-choices { display: flex; flex-wrap: wrap; gap: 6px; margin: -4px 0 12px 46px; }
[dir="rtl"] .chat-choices { margin: -4px 46px 12px 0; }
.chat-choice { border: 1px solid #d8e1ee; background: #fff; color: #0a2d63 !important; border-radius: 999px; padding: 5px 12px;
    font-size: 12.5px; font-weight: 500; cursor: pointer; line-height: 1.25; text-decoration: none !important; transition: all .15s; }
.chat-choice:hover { border-color: #0a2d63; }
.chat-choice.link { background: #0a2d63; border-color: #0a2d63; color: #fff !important; font-weight: 600; }
.chat-choice.link:hover { background: #12428c; }
.chat-choice.human { border-color: #8cbf1f; color: #5d8a0c !important; }
.chat-choice.human:hover { background: #8cbf1f; color: #fff !important; }
html[data-theme="dark"] .chat-choice { background: #131c2e; border-color: #3a4763; color: #cfe0ff !important; }
html[data-theme="dark"] .chat-choice.link { background: #8cbf1f; border-color: #8cbf1f; color: #0b1424 !important; }
html[data-theme="dark"] .chat-choice.human { color: #a9e05a !important; border-color: #8cbf1f; }
/* visitor without account: name + phone before talking to an advisor */
.chat-guest { background: #fff; border: 1px solid #dbe3ef; border-radius: 14px; padding: 12px; margin: 4px 6px 12px; display: flex; flex-direction: column; gap: 8px; }
.chat-guest p { margin: 0; font-size: 13px; color: #16213b; }
.chat-guest input { border: 1.5px solid #cfd8e6; border-radius: 10px; padding: 9px 11px; font-size: 14px; }
.chat-guest input:focus { outline: none; border-color: #0a2d63; }
.chat-guest button { background: #8cbf1f; color: #fff; border: 0; border-radius: 10px; padding: 10px; font-weight: 600; cursor: pointer; }
.chat-guest small { color: #c62828; font-size: 12px; min-height: 0; }
html[data-theme="dark"] .chat-guest { background: #131c2e; border-color: #3a4763; }
html[data-theme="dark"] .chat-guest p { color: #e6ebf5; }
html[data-theme="dark"] .chat-guest input { background: #0f1726; color: #e6ebf5; border-color: #3a4763; }
