/* ═══════════════════════════════════════════════════════════
   Trishuli Resort Chatbot Widget — Luxury Theme
   ═══════════════════════════════════════════════════════════ */

:root {
    --chatbot-primary: #2c5530;
    --chatbot-bg: #ffffff;
    --chatbot-msg-bg: #f0f4f0;
    --chatbot-user-bg: linear-gradient(135deg, #2c5530, #3d7a45);
    --chatbot-text: #333333;
    --chatbot-text-light: #888888;
    --chatbot-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    --chatbot-radius: 16px;
}

/* ─── Trigger Button ────────────────────────────────────── */
#chatbot-trigger {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10000;
    box-shadow: 0 4px 20px rgba(44, 85, 48, 0.4);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s;
}

#chatbot-trigger:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 28px rgba(44, 85, 48, 0.5);
}

.trigger-icon {
    font-size: 1.5rem;
    line-height: 1;
}

.trigger-pulse {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: inherit;
    opacity: 0;
    animation: chatbotPulse 2s ease-out infinite;
}

@keyframes chatbotPulse {
    0% {
        transform: scale(1);
        opacity: 0.4;
    }

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

/* ─── Chat Window ───────────────────────────────────────── */
#chatbot-window {
    position: fixed;
    bottom: 100px;
    right: 24px;
    width: 380px;
    max-height: 600px;
    background: var(--chatbot-bg);
    border-radius: var(--chatbot-radius);
    box-shadow: var(--chatbot-shadow);
    z-index: 10001;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: chatWindowSlide 0.3s ease;
}

@keyframes chatWindowSlide {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }

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

.chatbot-hidden {
    display: none !important;
}

/* ─── Header ────────────────────────────────────────────── */
.chatbot-header {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: white;
    backdrop-filter: blur(10px);
}

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

.bot-avatar {
    font-size: 2rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
}

.bot-name {
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.3px;
}

.bot-status {
    font-size: 0.7rem;
    opacity: 0.85;
}

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

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

/* ─── Messages Container ───────────────────────────────── */
.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 400px;
    scroll-behavior: smooth;
}

.chatbot-messages::-webkit-scrollbar {
    width: 4px;
}

.chatbot-messages::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

/* ─── Welcome ───────────────────────────────────────────── */
.welcome-container {
    text-align: center;
    padding: 16px 0;
}

.welcome-avatar {
    font-size: 2.5rem;
    margin-bottom: 8px;
}

.welcome-text {
    font-size: 0.9rem;
    color: var(--chatbot-text);
    line-height: 1.5;
    padding: 0 8px;
}

/* ─── Quick Actions ─────────────────────────────────────── */
.quick-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 4px 0;
}

.quick-btn {
    padding: 10px 12px;
    background: var(--chatbot-msg-bg);
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    color: var(--chatbot-text);
}

.quick-btn:hover {
    background: var(--chatbot-primary);
    color: white;
    border-color: var(--chatbot-primary);
    transform: translateY(-1px);
}

/* ─── Chat Messages ─────────────────────────────────────── */
.chat-msg {
    display: flex;
    gap: 8px;
    max-width: 85%;
    animation: msgFadeIn 0.3s ease;
}

@keyframes msgFadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

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

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

.chat-msg.bot-msg {
    align-self: flex-start;
}

.msg-avatar {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 4px;
}

.msg-content {
    display: flex;
    flex-direction: column;
}

.msg-bubble {
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 0.88rem;
    line-height: 1.5;
    word-wrap: break-word;
}

.bot-msg .msg-bubble {
    background: var(--chatbot-msg-bg);
    color: var(--chatbot-text);
    border-bottom-left-radius: 4px;
}

.user-msg .msg-bubble {
    background: var(--chatbot-user-bg);
    color: white;
    border-bottom-right-radius: 4px;
}

/* ─── Rating ────────────────────────────────────────────── */
.msg-rating {
    display: flex;
    gap: 4px;
    margin-top: 4px;
    opacity: 0;
    transition: opacity 0.3s;
}

.chat-msg:hover .msg-rating,
.msg-rating:focus-within {
    opacity: 1;
}

.rate-btn {
    background: none;
    border: none;
    font-size: 0.75rem;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 10px;
    transition: background 0.2s;
    opacity: 0.6;
}

.rate-btn:hover {
    opacity: 1;
    background: #f0f0f0;
}

.rated {
    font-size: 0.75rem;
    color: var(--chatbot-text-light);
}

/* ─── Options Buttons ───────────────────────────────────── */
.chat-options {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0 36px;
}

.quick-options {
    padding: 0 8px;
}

.option-btn {
    padding: 7px 14px;
    background: white;
    border: 1.5px solid var(--chatbot-primary);
    border-radius: 20px;
    color: var(--chatbot-primary);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.option-btn:hover {
    background: var(--chatbot-primary);
    color: white;
    transform: translateY(-1px);
}

/* ─── Date Picker ───────────────────────────────────────── */
.chat-date-picker {
    display: flex;
    gap: 8px;
    padding: 0 36px;
}

.date-input {
    padding: 8px 12px;
    border: 1.5px solid #ddd;
    border-radius: 8px;
    font-size: 0.85rem;
    flex: 1;
}

.date-input:focus {
    border-color: var(--chatbot-primary);
    outline: none;
}

.date-submit {
    padding: 8px 16px;
    background: var(--chatbot-primary);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    white-space: nowrap;
    transition: opacity 0.2s;
}

.date-submit:hover {
    opacity: 0.9;
}

/* ─── Room List ─────────────────────────────────────────── */
.room-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 4px 36px 4px;
    width: calc(100% - 36px);
}

.room-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: white;
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    padding: 12px;
    transition: all 0.2s;
}

.room-card:hover {
    border-color: var(--chatbot-primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.room-thumb {
    width: 56px;
    height: 56px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}

.room-thumb-placeholder {
    width: 56px;
    height: 56px;
    border-radius: 8px;
    background: var(--chatbot-msg-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.room-info {
    flex: 1;
    min-width: 0;
}

.room-name {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--chatbot-text);
}

.room-price {
    font-size: 0.9rem;
    color: var(--chatbot-primary);
    font-weight: 700;
    margin-top: 2px;
}

.room-price span {
    font-size: 0.7rem;
    color: var(--chatbot-text-light);
    font-weight: 400;
}

.room-book-btn {
    padding: 6px 14px;
    background: var(--chatbot-primary);
    color: white;
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.78rem;
    font-weight: 500;
    white-space: nowrap;
    transition: opacity 0.2s;
}

.room-book-btn:hover {
    opacity: 0.9;
}

/* ─── Activity List ────────────────────────────────────── */
.activity-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 4px 36px 4px;
    width: calc(100% - 36px);
}

.activity-card-mini {
    display: flex;
    align-items: center;
    gap: 10px;
    background: white;
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    padding: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.activity-card-mini:hover {
    border-color: #c9a84c;
    box-shadow: 0 2px 8px rgba(201, 168, 76, 0.15);
    transform: translateX(2px);
}

.activity-thumb {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}

.activity-thumb-placeholder {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    background: linear-gradient(135deg, #f0f4f0, #e8ece8);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

.activity-info {
    flex: 1;
    min-width: 0;
}

.activity-name {
    font-weight: 600;
    font-size: 0.82rem;
    color: var(--chatbot-text);
}

.activity-price {
    font-size: 0.75rem;
    color: #c9a84c;
    font-weight: 600;
    margin-top: 1px;
}

.activity-desc {
    font-size: 0.7rem;
    color: var(--chatbot-text-light);
    margin-top: 2px;
    line-height: 1.3;
}

/* ─── Package List ─────────────────────────────────────── */
.package-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 4px 36px 4px;
    width: calc(100% - 36px);
}

.package-card-mini {
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #fffdf5, #fff9e6);
    border: 1px solid #ffe699;
    border-radius: 12px;
    padding: 10px;
    transition: all 0.2s;
}

.package-card-mini:hover {
    border-color: #c9a84c;
    box-shadow: 0 2px 8px rgba(201, 168, 76, 0.15);
}

.package-thumb {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}

.package-thumb-placeholder {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    background: linear-gradient(135deg, #ffe699, #ffd966);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

.package-info {
    flex: 1;
    min-width: 0;
}

.package-name {
    font-weight: 600;
    font-size: 0.82rem;
    color: var(--chatbot-text);
}

.package-price {
    font-size: 0.78rem;
    color: #c9a84c;
    font-weight: 600;
    margin-top: 1px;
}

.package-view-btn {
    padding: 5px 12px;
    background: #c9a84c;
    color: white;
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
    transition: opacity 0.2s;
}

.package-view-btn:hover {
    opacity: 0.85;
}

/* ─── Escalation Card ──────────────────────────────────── */
.escalation-card {
    background: linear-gradient(135deg, #fff9e6, #fff3cc);
    border: 1px solid #ffe699;
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    margin: 4px 36px;
}

.escalation-icon {
    font-size: 2rem;
    margin-bottom: 8px;
}

.escalation-text {
    font-size: 0.85rem;
    color: #555;
    margin-bottom: 12px;
}

.escalation-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.esc-btn {
    padding: 8px 16px;
    background: var(--chatbot-primary);
    color: white;
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.8rem;
    transition: opacity 0.2s;
}

.esc-btn:hover {
    opacity: 0.85;
}

.esc-whatsapp {
    background: #25D366;
}

/* ─── Typing Indicator ─────────────────────────────────── */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 20px;
    align-items: center;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: #ccc;
    border-radius: 50%;
    animation: typingBounce 1.2s infinite;
}

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

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

@keyframes typingBounce {

    0%,
    80%,
    100% {
        transform: translateY(0);
        opacity: 0.3;
    }

    40% {
        transform: translateY(-5px);
        opacity: 1;
    }
}

/* ─── Input Area ────────────────────────────────────────── */
.chatbot-input-area {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid #f0f0f0;
    background: white;
}

#chatbot-input {
    flex: 1;
    padding: 10px 14px;
    border: 1.5px solid #e0e0e0;
    border-radius: 12px;
    font-size: 0.88rem;
    outline: none;
    transition: border-color 0.2s;
    background: #f9f9f9;
}

#chatbot-input:focus {
    border-color: var(--chatbot-primary);
    background: white;
}

#chatbot-send {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, opacity 0.2s;
    flex-shrink: 0;
}

#chatbot-send:hover {
    transform: scale(1.05);
    opacity: 0.9;
}

/* ─── Mobile Responsive ─────────────────────────────────── */
@media (max-width: 480px) {
    #chatbot-window {
        width: calc(100vw - 16px);
        right: 8px;
        bottom: 80px;
        max-height: calc(100vh - 120px);
        border-radius: 12px;
    }

    #chatbot-trigger {
        bottom: 16px;
        right: 16px;
        width: 52px;
        height: 52px;
    }

    .room-list {
        padding: 4px 8px;
    }

    .chat-options {
        padding: 0 8px;
    }

    .escalation-card {
        margin: 4px 8px;
    }

    .chat-date-picker {
        padding: 0 8px;
    }
}