/* ============================================
   Resort ChatBot Widget Styles
   ============================================ */

/* ===== WhatsApp Floating Button ===== */
.whatsapp-float {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: #25D366;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4);
    z-index: 9998;
    transition: all 0.3s ease;
    text-decoration: none;
}

.whatsapp-float:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.5);
    color: #fff;
}

/* ===== WhatsApp Branch Picker Overlay ===== */
.wa-picker-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 10000;
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    padding: 0 30px 170px 0;
}

.wa-picker-card {
    background: #fff;
    border-radius: 14px;
    width: 280px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.25);
    overflow: hidden;
    animation: waPickerSlide 0.25s ease;
}

@keyframes waPickerSlide {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

.wa-picker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: #25D366;
    color: #fff;
    font-weight: 600;
    font-size: 15px;
}

.wa-picker-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    line-height: 1;
}

.wa-picker-body {
    display: flex;
    flex-direction: column;
    max-height: 280px;
    overflow-y: auto;
}

.wa-branch-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.15s;
}

.wa-branch-item:last-child {
    border-bottom: none;
}

.wa-branch-item:hover {
    background: #e8fbe8;
    color: #25D366;
}

.wa-branch-item i {
    color: #25D366;
    font-size: 20px;
}

/* ===== Floating Button Stack Positions ===== */
/* Chat: 30px → WhatsApp: 100px → Back-to-top: 170px → Language: 240px */
.whatsapp-float {
    bottom: 100px;
}

/* ===== Language Floating Button ===== */
.lang-float {
    position: fixed;
    bottom: 240px;
    right: 30px;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0d6efd, #4a8eff);
    color: #fff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: 0 4px 15px rgba(13, 110, 253, 0.4);
    z-index: 9998;
    transition: all 0.3s ease;
    cursor: pointer;
}

.lang-float:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(13, 110, 253, 0.5);
    color: #fff;
}

/* ===== Language Picker Overlay ===== */
.lang-picker-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 10000;
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    padding: 0 30px 306px 0;
}

.lang-picker-card {
    background: #fff;
    border-radius: 14px;
    width: 240px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.25);
    overflow: hidden;
    animation: langPickerSlide 0.25s ease;
}

@keyframes langPickerSlide {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

.lang-picker-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: linear-gradient(135deg, #0d6efd, #4a8eff);
    color: #fff;
    font-weight: 600;
    font-size: 14px;
}

.lang-picker-card-header i {
    margin-right: 6px;
}

.lang-picker-card-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    line-height: 1;
}

.lang-picker-card-body {
    display: flex;
    flex-direction: column;
}

.lang-picker-card-body .lang-pick-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 12px 18px;
    border: none;
    background: transparent;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background 0.15s;
    gap: 8px;
    border-radius: 0;
}

.lang-picker-card-body .lang-pick-btn:last-child {
    border-bottom: none;
}

.lang-picker-card-body .lang-pick-btn:hover {
    background: rgba(13, 110, 253, 0.06);
}

.lang-picker-card-body .lang-pick-btn.active {
    background: rgba(13, 110, 253, 0.10);
}

.lang-picker-card-body .lang-pick-btn.active .lang-pick-native {
    color: #0d6efd;
}

.lang-picker-card-body .lang-pick-name {
    font-size: 0.82rem;
    color: #6c757d;
}

.lang-picker-card-body .lang-pick-native {
    font-size: 1rem;
    font-weight: 600;
    color: #212529;
}

.chat-widget-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2c5f2d, #4a9e4a);
    color: #fff;
    border: none;
    box-shadow: 0 4px 15px rgba(44, 95, 45, 0.4);
    cursor: pointer;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 24px;
}

.chat-widget-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(44, 95, 45, 0.5);
}

.chat-widget-btn .chat-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: #e74c3c;
    color: #fff;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Chat Window */
.chat-window {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 380px;
    max-height: 520px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: chatSlideUp 0.3s ease;
}

.chat-window.active {
    display: flex;
}

@keyframes chatSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Chat Header */
.chat-header {
    background: linear-gradient(135deg, #2c5f2d, #4a9e4a);
    color: #fff;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chat-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-header-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.chat-header-text h6 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
}

.chat-header-text small {
    opacity: 0.85;
    font-size: 12px;
}

.chat-close-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    padding: 4px;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.chat-close-btn:hover {
    opacity: 1;
}

/* Chat Body */
.chat-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    max-height: 340px;
    min-height: 200px;
    background: #f8f9fa;
}

.chat-message {
    margin-bottom: 12px;
    display: flex;
    gap: 8px;
    animation: msgFade 0.3s ease;
}

@keyframes msgFade {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.chat-message.bot {
    justify-content: flex-start;
}

.chat-message.user {
    justify-content: flex-end;
}

.chat-bubble {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

.chat-message.bot .chat-bubble {
    background: #fff;
    color: #333;
    border: 1px solid #e9ecef;
    border-top-left-radius: 4px;
}

.chat-message.user .chat-bubble {
    background: linear-gradient(135deg, #2c5f2d, #4a9e4a);
    color: #fff;
    border-top-right-radius: 4px;
}

/* Quick suggestion buttons */
.chat-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.chat-suggestions .suggestion-btn {
    background: #e8f5e9;
    color: #2c5f2d;
    border: 1px solid #c8e6c9;
    border-radius: 16px;
    padding: 5px 12px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.chat-suggestions .suggestion-btn:hover {
    background: #2c5f2d;
    color: #fff;
}

/* FAQ result buttons in chat */
.chat-faq-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 6px;
}

.chat-faq-btn {
    background: #f0f7f0;
    border: 1px solid #c8e6c9;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 13px;
    color: #2c5f2d;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s;
}

.chat-faq-btn:hover {
    background: #2c5f2d;
    color: #fff;
}

/* Chat Footer */
.chat-footer {
    padding: 12px 16px;
    border-top: 1px solid #e9ecef;
    display: flex;
    gap: 8px;
    background: #fff;
}

.chat-footer input {
    flex: 1;
    border: 1px solid #dee2e6;
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.chat-footer input:focus {
    border-color: #4a9e4a;
}

.chat-send-btn {
    background: linear-gradient(135deg, #2c5f2d, #4a9e4a);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 16px;
}

.chat-send-btn:hover {
    transform: scale(1.05);
}

.chat-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Typing indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 10px 14px;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #adb5bd;
    animation: typing 1.4s infinite ease-in-out;
}

.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-6px); }
}

/* Responsive */
@media (max-width: 480px) {
    .chat-window {
        right: 10px;
        left: 10px;
        width: auto;
        bottom: 70px;
        max-height: 70vh;
    }

    /* Chat: 16px → WhatsApp: 72px → Back-to-top: 128px → Language: 184px */
    .chat-widget-btn {
        bottom: 16px;
        right: 16px;
        width: 44px;
        height: 44px;
        font-size: 20px;
    }

    .whatsapp-float {
        bottom: 72px;
        right: 16px;
        width: 44px;
        height: 44px;
        font-size: 22px;
    }

    .lang-float {
        bottom: 184px;
        right: 16px;
        width: 44px;
        height: 44px;
        font-size: 20px;
    }

    .wa-picker-overlay {
        padding: 0 16px 128px 0;
    }

    .lang-picker-overlay {
        padding: 0 16px 240px 0;
    }

    .lang-picker-card {
        width: 210px;
    }
}
