/* ============================================
   TRAVELA AI CHATBOT WIDGET
   Premium floating chat widget with glassmorphism
   ============================================ */

/* --- Chatbot Toggle Button --- */
.chatbot-toggle {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 62px;
    height: 62px;
    border-radius: 50%;
    background: linear-gradient(135deg, #e8604c 0%, #c0392b 100%);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 30px rgba(232, 96, 76, 0.45);
    z-index: 9998;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    animation: chatbot-pulse 2.5s infinite;
}

.chatbot-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 35px rgba(232, 96, 76, 0.55);
}

.chatbot-toggle.active {
    animation: none;
    transform: rotate(90deg);
    background: linear-gradient(135deg, #636e72 0%, #2d3436 100%);
    box-shadow: 0 6px 25px rgba(45, 52, 54, 0.4);
}

.chatbot-toggle svg {
    width: 28px;
    height: 28px;
    fill: #fff;
    transition: transform 0.35s ease;
}

@keyframes chatbot-pulse {
    0%, 100% { box-shadow: 0 6px 30px rgba(232, 96, 76, 0.45); }
    50% { box-shadow: 0 6px 45px rgba(232, 96, 76, 0.7); }
}

/* --- Chat Window --- */
.chatbot-window {
    position: fixed;
    bottom: 105px;
    right: 30px;
    width: 400px;
    max-height: 560px;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18), 0 0 0 1px rgba(0,0,0,0.04);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(25px) scale(0.95);
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.chatbot-window.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* --- Chat Header --- */
.chatbot-header {
    background: linear-gradient(135deg, #e8604c 0%, #c0392b 60%, #a93226 100%);
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    position: relative;
    overflow: hidden;
}

.chatbot-header::before {
    content: '';
    position: absolute;
    top: -30px;
    right: -30px;
    width: 100px;
    height: 100px;
    background: rgba(255,255,255,0.07);
    border-radius: 50%;
}

.chatbot-header::after {
    content: '';
    position: absolute;
    bottom: -20px;
    left: -15px;
    width: 60px;
    height: 60px;
    background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.chatbot-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255,255,255,0.3);
}

.chatbot-avatar svg {
    width: 24px;
    height: 24px;
    fill: #fff;
}

.chatbot-header-info {
    flex: 1;
    z-index: 1;
}

.chatbot-header-info h4 {
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 3px 0;
    font-family: 'Outfit', sans-serif;
}

.chatbot-header-info span {
    color: rgba(255,255,255,0.82);
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.chatbot-header-info .status-dot {
    width: 7px;
    height: 7px;
    background: #2ecc71;
    border-radius: 50%;
    display: inline-block;
    animation: status-blink 2s infinite;
}

@keyframes status-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.chatbot-close {
    background: rgba(255,255,255,0.15);
    border: none;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.25s;
    z-index: 1;
}

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

/* --- Chat Messages --- */
.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    background: #f8f9fb;
    min-height: 300px;
    max-height: 360px;
}

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

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

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

/* Message Bubbles */
.chatbot-msg {
    display: flex;
    gap: 10px;
    max-width: 88%;
    animation: msg-appear 0.3s ease-out;
}

@keyframes msg-appear {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

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

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

.chatbot-msg-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 14px;
}

.chatbot-msg.bot .chatbot-msg-avatar {
    background: linear-gradient(135deg, #e8604c, #c0392b);
    color: #fff;
}

.chatbot-msg.user .chatbot-msg-avatar {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
}

.chatbot-msg-bubble {
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.55;
    font-family: 'Outfit', sans-serif;
    word-wrap: break-word;
}

.chatbot-msg.bot .chatbot-msg-bubble {
    background: #fff;
    color: #2d3436;
    border: 1px solid #e9ecef;
    border-bottom-left-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.chatbot-msg.user .chatbot-msg-bubble {
    background: linear-gradient(135deg, #e8604c, #c0392b);
    color: #fff;
    border-bottom-right-radius: 6px;
    box-shadow: 0 3px 12px rgba(232, 96, 76, 0.25);
}

.chatbot-msg-bubble p {
    margin: 0 0 8px 0;
}

.chatbot-msg-bubble p:last-child {
    margin-bottom: 0;
}

.chatbot-msg-bubble ul, .chatbot-msg-bubble ol {
    margin: 6px 0;
    padding-left: 20px;
}

.chatbot-msg-bubble li {
    margin-bottom: 3px;
}

.chatbot-msg-bubble strong {
    font-weight: 600;
}

.chatbot-msg-bubble a {
    color: #e8604c;
    text-decoration: underline;
}

.chatbot-msg.user .chatbot-msg-bubble a {
    color: #fff;
}

/* --- Typing Indicator --- */
.chatbot-typing {
    display: none;
    align-self: flex-start;
    padding: 0 16px;
}

.chatbot-typing.show {
    display: flex;
}

.chatbot-typing-dots {
    display: flex;
    align-items: center;
    gap: 5px;
    background: #fff;
    border: 1px solid #e9ecef;
    padding: 12px 18px;
    border-radius: 18px;
    border-bottom-left-radius: 6px;
    margin-left: 42px;
}

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

.chatbot-typing-dots span:nth-child(1) { animation-delay: 0s; }
.chatbot-typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.chatbot-typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing-bounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}

/* --- Chat Input --- */
.chatbot-input-area {
    padding: 14px 16px;
    border-top: 1px solid #eef0f2;
    display: flex;
    gap: 10px;
    align-items: center;
    background: #fff;
}

.chatbot-input {
    flex: 1;
    border: 2px solid #e9ecef;
    border-radius: 25px;
    padding: 11px 18px;
    font-size: 14px;
    font-family: 'Outfit', sans-serif;
    outline: none;
    transition: border-color 0.25s;
    background: #f8f9fb;
    color: #2d3436;
}

.chatbot-input:focus {
    border-color: #e8604c;
    background: #fff;
}

.chatbot-input::placeholder {
    color: #b2bec3;
}

.chatbot-send-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #e8604c 0%, #c0392b 100%);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s;
    flex-shrink: 0;
}

.chatbot-send-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 4px 15px rgba(232, 96, 76, 0.4);
}

.chatbot-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.chatbot-send-btn svg {
    width: 20px;
    height: 20px;
    fill: #fff;
}

/* --- Welcome Message Suggestion Chips --- */
.chatbot-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.chatbot-suggestion-chip {
    background: linear-gradient(135deg, rgba(232,96,76,0.08), rgba(192,57,43,0.08));
    border: 1px solid rgba(232,96,76,0.2);
    color: #e8604c;
    padding: 7px 14px;
    border-radius: 20px;
    font-size: 12.5px;
    cursor: pointer;
    transition: all 0.25s;
    font-family: 'Outfit', sans-serif;
}

.chatbot-suggestion-chip:hover {
    background: linear-gradient(135deg, #e8604c, #c0392b);
    color: #fff;
    border-color: transparent;
    transform: translateY(-1px);
}

/* --- Responsive --- */
@media (max-width: 480px) {
    .chatbot-window {
        right: 10px;
        left: 10px;
        bottom: 90px;
        width: auto;
        max-height: 75vh;
    }

    .chatbot-toggle {
        bottom: 20px;
        right: 20px;
        width: 56px;
        height: 56px;
    }
}

@media (min-width: 481px) and (max-width: 768px) {
    .chatbot-window {
        width: 370px;
        right: 15px;
    }
}
