/* FlexTime Luxury AI Assistant Chatbot & Motion-Animated Welcome Popup Styles */

:root {
    --ft-primary: #ea2a33;
    --ft-primary-hover: #ff3842;
    --ft-primary-glow: rgba(234, 42, 51, 0.45);
    --ft-bg-dark: rgba(14, 8, 8, 0.94);
    --ft-border: rgba(255, 255, 255, 0.1);
    --ft-border-hover: rgba(234, 42, 51, 0.4);
}

/* ==========================================================
   1. Floating Trigger Bubble
   ========================================================== */
.chatbot-bubble {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ea2a33 0%, #a81c22 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 10px 30px var(--ft-primary-glow), 0 0 25px rgba(234, 42, 51, 0.25);
    z-index: 1000;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.chatbot-bubble:hover {
    transform: scale(1.1) rotate(6deg);
    box-shadow: 0 15px 35px rgba(234, 42, 51, 0.7), 0 0 30px rgba(234, 42, 51, 0.5);
}

.chatbot-bubble.attention-pulse {
    animation: bubbleWiggle 4s infinite ease-in-out;
}

@keyframes bubbleWiggle {
    0%, 80%, 100% { transform: scale(1) rotate(0deg); }
    85% { transform: scale(1.12) rotate(-8deg); }
    90% { transform: scale(1.12) rotate(8deg); }
    95% { transform: scale(1.08) rotate(-4deg); }
}

.chatbot-badge-pulse {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 14px;
    height: 14px;
    background: #22c55e;
    border-radius: 50%;
    border: 2px solid #0e0808;
    box-shadow: 0 0 10px #22c55e;
    animation: badgePulse 2s infinite ease-in-out;
}

@keyframes badgePulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.3); opacity: 0.8; }
}

/* ==========================================================
   2. Motion-Animated Welcome Popup Teaser
   ========================================================== */
.chatbot-teaser {
    position: fixed;
    bottom: 105px;
    right: 30px;
    width: 330px;
    max-width: calc(100vw - 40px);
    background: var(--ft-bg-dark);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(234, 42, 51, 0.35);
    border-radius: 20px;
    padding: 16px 18px;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.7), 0 0 30px rgba(234, 42, 51, 0.2);
    z-index: 998;
    opacity: 0;
    transform: translateY(20px) scale(0.9);
    pointer-events: none;
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    gap: 14px;
    align-items: flex-start;
}

.chatbot-teaser.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
    animation: teaserFloating 4s ease-in-out infinite alternate;
}

@keyframes teaserFloating {
    0% { transform: translateY(0) scale(1); }
    100% { transform: translateY(-6px) scale(1); }
}

.chatbot-teaser-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.chatbot-teaser-close:hover {
    background: rgba(234, 42, 51, 0.25);
    color: white;
    transform: scale(1.1);
}

.chatbot-teaser-avatar {
    position: relative;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: linear-gradient(135deg, #ea2a33 0%, #91171d 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
    box-shadow: 0 6px 16px rgba(234, 42, 51, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.teaser-pulse {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 10px;
    height: 10px;
    background: #22c55e;
    border-radius: 50%;
    border: 2px solid #0e0808;
    box-shadow: 0 0 6px #22c55e;
}

.chatbot-teaser-body {
    flex: 1;
    padding-right: 12px;
}

.chatbot-teaser-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(34, 197, 94, 0.25);
    color: #4ade80;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 2px 8px;
    border-radius: 12px;
    margin-bottom: 6px;
}

.teaser-live-dot {
    width: 6px;
    height: 6px;
    background: #22c55e;
    border-radius: 50%;
    box-shadow: 0 0 6px #22c55e;
}

.chatbot-teaser-text {
    margin: 0 0 12px 0;
    font-size: 12.5px;
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.9);
}

.chatbot-teaser-text strong {
    color: #ffffff;
}

.chatbot-teaser-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.chatbot-teaser-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition: all 0.25s ease;
    text-decoration: none;
}

.chatbot-teaser-btn.primary {
    background: linear-gradient(135deg, #ea2a33 0%, #c41e25 100%);
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(234, 42, 51, 0.3);
}

.chatbot-teaser-btn.primary:hover {
    background: #ff3842;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(234, 42, 51, 0.5);
}

.chatbot-teaser-btn.secondary {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.85);
}

.chatbot-teaser-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.12);
    color: white;
    border-color: rgba(234, 42, 51, 0.4);
    transform: translateY(-2px);
}

/* ==========================================================
   3. Main Chat Window
   ========================================================== */
.chatbot-window {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 400px;
    height: 600px;
    max-height: 82vh;
    border-radius: 24px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    z-index: 999;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    transform: translateY(25px) scale(0.94);
    opacity: 0;
    pointer-events: none;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), 0 0 40px rgba(234, 42, 51, 0.15);
    background: var(--ft-bg-dark);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid var(--ft-border);
}

.chatbot-window.active {
    transform: translateY(0) scale(1);
    opacity: 1;
    pointer-events: all;
}

/* Header */
.chatbot-header {
    background: linear-gradient(135deg, rgba(234, 42, 51, 0.95) 0%, rgba(145, 23, 29, 0.95) 100%);
    padding: 16px 20px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

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

.chatbot-avatar {
    position: relative;
    width: 42px;
    height: 42px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.status-indicator {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 10px;
    height: 10px;
    background: #22c55e;
    border: 2px solid #ea2a33;
    border-radius: 50%;
}

.chatbot-title h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.chatbot-title p {
    margin: 2px 0 0 0;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.85);
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}

.online-dot {
    width: 6px;
    height: 6px;
    background: #22c55e;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 6px #22c55e;
}

.chatbot-header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.chatbot-action-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.chatbot-action-btn:hover {
    color: white;
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

/* Messages Area */
.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

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

.chatbot-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
}

/* Individual Message Bubbles */
.message {
    max-width: 86%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 13.5px;
    line-height: 1.55;
    position: relative;
    animation: msgFadeIn 0.3s cubic-bezier(0.165, 0.84, 0.44, 1) forwards;
    word-break: break-word;
}

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

.message.ai {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-bottom-left-radius: 4px;
    color: rgba(255, 255, 255, 0.95);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.message.user {
    align-self: flex-end;
    background: linear-gradient(135deg, #ea2a33 0%, #be1b23 100%);
    color: white;
    border-bottom-right-radius: 4px;
    font-weight: 500;
    box-shadow: 0 4px 15px rgba(234, 42, 51, 0.35);
}

/* Message Markdown Formats */
.message-content strong {
    color: #ffffff;
    font-weight: 700;
}

.message-content em {
    color: rgba(255, 255, 255, 0.85);
    font-style: italic;
}

.chatbot-link {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    color: #ff5e65;
    text-decoration: none;
    font-weight: 600;
    padding: 2px 7px;
    background: rgba(234, 42, 51, 0.12);
    border-radius: 6px;
    border: 1px solid rgba(234, 42, 51, 0.25);
    transition: all 0.2s ease;
    margin: 2px 0;
}

.chatbot-link:hover {
    background: rgba(234, 42, 51, 0.25);
    color: #ffffff;
    border-color: #ea2a33;
    transform: translateY(-1px);
}

.chatbot-link .inline-icon {
    font-size: 11px;
}

.chatbot-list {
    margin: 8px 0 8px 14px;
    padding: 0;
    list-style-type: none;
}

.chatbot-list-item {
    position: relative;
    padding-left: 14px;
    margin-bottom: 6px;
}

.chatbot-list-item::before {
    content: "•";
    position: absolute;
    left: 0;
    color: #ea2a33;
    font-size: 18px;
    line-height: 1;
    top: -1px;
}

/* Chips / Starter Prompts Container */
.chatbot-chips-container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.chatbot-chips-container.dynamic-chips {
    align-self: flex-start;
    max-width: 95%;
    animation: msgFadeIn 0.4s ease forwards;
}

.chat-chip {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.85);
    font-size: 11.5px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: left;
    white-space: nowrap;
}

.chat-chip:hover {
    background: rgba(234, 42, 51, 0.15);
    border-color: rgba(234, 42, 51, 0.5);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(234, 42, 51, 0.2);
}

/* Input Area */
.chatbot-input-area {
    padding: 16px;
    background: rgba(0, 0, 0, 0.35);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    gap: 8px;
    align-items: center;
}

.chatbot-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    padding: 12px 16px;
    color: white;
    font-size: 13.5px;
    outline: none;
    transition: all 0.3s ease;
    font-family: inherit;
}

.chatbot-input::placeholder {
    color: rgba(255, 255, 255, 0.35);
}

.chatbot-input:focus {
    border-color: #ea2a33;
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 12px rgba(234, 42, 51, 0.25);
}

.chatbot-send {
    background: linear-gradient(135deg, #ea2a33 0%, #c41e25 100%);
    color: white;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.25s ease;
    flex-shrink: 0;
    box-shadow: 0 4px 15px rgba(234, 42, 51, 0.3);
}

.chatbot-send:hover {
    background: #ff3842;
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(234, 42, 51, 0.5);
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 5px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    align-self: flex-start;
    width: fit-content;
}

.typing-dot {
    width: 7px;
    height: 7px;
    background: #ea2a33;
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
    opacity: 0.6;
}

.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-5px); opacity: 1; }
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .chatbot-window {
        width: calc(100% - 32px);
        right: 16px;
        left: 16px;
        bottom: 85px;
        height: 75vh;
        border-radius: 20px;
    }
    .chatbot-teaser {
        right: 16px;
        left: 16px;
        width: auto;
        bottom: 90px;
    }
    .chatbot-bubble {
        bottom: 20px;
        right: 20px;
        width: 56px;
        height: 56px;
    }
}
