/* ==============================================================================
   PARAMOUNT DISPATCH SOLUTIONS - SLEEK DARK MODE AI CHATBOT
   Brand Palette: Crimson Red (#FF131D, #D8000B), Dark Navy (#0e1017, #151821, #1e222d), White (#ffffff)
   ============================================================================== */

/* Floating Launcher Button */
.paramount-chatbot-launcher {
    position: fixed;
    bottom: 26px;
    right: 26px;
    z-index: 999999;
    cursor: pointer;
    font-family: 'DM Sans', sans-serif;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    -webkit-tap-highlight-color: transparent;
}

.paramount-chatbot-launcher:hover {
    transform: translateY(-3px) scale(1.04);
}

.chatbot-launcher-btn {
    width: 62px;
    height: 62px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FF131D 0%, #B8000A 100%);
    box-shadow: 0 8px 25px rgba(255, 19, 29, 0.45), 0 0 0 0 rgba(255, 19, 29, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 26px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    position: relative;
    cursor: pointer;
    animation: paramountPulse 3s infinite;
}

@keyframes paramountPulse {
    0% {
        box-shadow: 0 8px 25px rgba(255, 19, 29, 0.45), 0 0 0 0 rgba(255, 19, 29, 0.5);
    }
    70% {
        box-shadow: 0 8px 25px rgba(255, 19, 29, 0.45), 0 0 0 16px rgba(255, 19, 29, 0);
    }
    100% {
        box-shadow: 0 8px 25px rgba(255, 19, 29, 0.45), 0 0 0 0 rgba(255, 19, 29, 0);
    }
}

.chatbot-launcher-btn i {
    transition: transform 0.3s ease;
}

.chatbot-launcher-badge {
    position: absolute;
    top: 0px;
    right: 0px;
    width: 16px;
    height: 16px;
    background: #00E676;
    border: 2.5px solid #0d0e13;
    border-radius: 50%;
}

/* Chatbot Main Container - Sleek Dark Theme */
.paramount-chatbot-container {
    position: fixed;
    bottom: 98px;
    right: 26px;
    width: 400px;
    max-width: calc(100vw - 32px);
    height: 620px;
    max-height: calc(100vh - 120px);
    background: #0e1017 !important;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 22px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 19, 29, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 999999;
    font-family: 'DM Sans', sans-serif;
    transform: translateY(20px) scale(0.96);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease, visibility 0.25s ease;
}

.paramount-chatbot-container.active {
    transform: translateY(0) scale(1);
    opacity: 1;
    visibility: visible;
}

/* Chatbot Header */
.chatbot-header {
    background: linear-gradient(135deg, #151821 0%, #0d0e13 100%) !important;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    flex-shrink: 0;
}

.chatbot-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #FF131D, rgba(255, 19, 29, 0.3), transparent);
}

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

.chatbot-avatar {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: #1e222d;
    border: 1.5px solid rgba(255, 19, 29, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.chatbot-avatar i {
    font-size: 19px;
    color: #FF131D;
}

.chatbot-header-info h4 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 6px;
}

.chatbot-status-tag {
    font-size: 11.5px;
    color: #00E676;
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 2px;
    font-weight: 500;
}

.chatbot-status-tag .status-indicator {
    width: 6.5px;
    height: 6.5px;
    background: #00E676;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 6px #00E676;
}

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

.chatbot-header-btn {
    background: rgba(255, 255, 255, 0.06);
    border: none;
    color: #a0a6b5;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all 0.2s ease;
}

.chatbot-header-btn:hover {
    background: rgba(255, 19, 29, 0.2);
    color: #ffffff;
}

/* Chatbot Messages Scroll Area */
.chatbot-messages-wrap {
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
    overflow-y: auto !important;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding: 18px 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    background: radial-gradient(circle at 50% 0%, #151821 0%, #0e1017 75%) !important;
    scroll-behavior: smooth;
    touch-action: pan-y;
}

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

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

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

.chatbot-messages-wrap::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Message Bubbles */
.chat-msg {
    display: flex;
    gap: 10px;
    max-width: 88%;
    animation: msgIn 0.25s ease-out;
    flex-shrink: 0;
}

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

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

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

.msg-avatar {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: #1c202a;
    border: 1px solid rgba(255, 19, 29, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #FF131D;
    flex-shrink: 0;
}

.chat-msg.user .msg-avatar {
    background: #2b303d;
    border-color: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

.msg-bubble {
    padding: 12px 15px;
    border-radius: 16px;
    font-size: 13.8px;
    line-height: 1.5;
    color: #e4e7ee !important;
    position: relative;
    word-break: break-word;
}

.chat-msg.bot .msg-bubble {
    background: #161922 !important;
    color: #e4e7ee !important;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-top-left-radius: 4px;
}

.chat-msg.user .msg-bubble {
    background: linear-gradient(135deg, #FF131D 0%, #d1000b 100%) !important;
    color: #ffffff !important;
    border-top-right-radius: 4px;
    box-shadow: 0 4px 15px rgba(255, 19, 29, 0.3);
}

.msg-bubble strong {
    color: #ffffff !important;
    font-weight: 700;
}

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

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

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

.chat-msg.user .msg-bubble a {
    color: #ffffff;
}

.msg-time {
    font-size: 10px;
    color: #72798c;
    margin-top: 3px;
    text-align: right;
}

.chat-msg.bot .msg-time {
    text-align: left;
}

/* Quick Action Chips */
.chatbot-chips-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 8px;
}

.chat-chip {
    background: rgba(255, 19, 29, 0.08);
    border: 1px solid rgba(255, 19, 29, 0.28);
    color: #ffb8bb;
    padding: 6px 12px;
    border-radius: 18px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.chat-chip:hover {
    background: #FF131D;
    color: #ffffff;
    border-color: #FF131D;
    transform: translateY(-1px);
}

/* Typing Indicator Box */
.typing-indicator-box {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 11px 16px;
    background: #161922 !important;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    border-top-left-radius: 4px;
    width: fit-content;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background: #FF131D;
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out both;
}

.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes typingBounce {
    0%, 80%, 100% { transform: scale(0); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}

/* Chat Input Footer */
.chatbot-footer {
    padding: 12px 16px;
    background: #12141c !important;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    gap: 7px;
    flex-shrink: 0;
}

.chatbot-input-row {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #1b1e28;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 26px;
    padding: 4px 5px 4px 16px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.chatbot-input-row:focus-within {
    border-color: #FF131D;
    box-shadow: 0 0 0 3px rgba(255, 19, 29, 0.15);
}

.chatbot-input-field {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #ffffff;
    font-size: 13.5px;
    font-family: inherit;
}

.chatbot-input-field::placeholder {
    color: #6a7182;
}

.chatbot-send-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #FF131D;
    border: none;
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.chatbot-send-btn:hover:not(:disabled) {
    background: #d1000b;
    transform: scale(1.05);
}

.chatbot-send-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.chatbot-footer-caption {
    font-size: 10.5px;
    color: #5c6273;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

/* Mobile Responsive */
@media (max-width: 576px) {
    .paramount-chatbot-launcher {
        bottom: 18px;
        right: 18px;
    }

    .chatbot-launcher-btn {
        width: 56px;
        height: 56px;
        font-size: 22px;
    }

    .paramount-chatbot-container {
        bottom: 84px;
        right: 12px;
        left: 12px;
        width: calc(100vw - 24px);
        height: 75vh;
        max-height: 560px;
    }
}
