:root {
    --chat-primary: #ee272d; /* Logo Red */
    --chat-secondary: #6c757d;
    --chat-bg: rgba(255, 255, 255, 0.98);
    --chat-header: #000000; /* Logo Black */
    --chat-text: #2d3436;
    --chat-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
    --chat-radius: 20px;
    --chat-accent: #ffffff;
}

/* Chatbot Floating Button */
.chatbot-trigger {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 65px;
    height: 65px;
    background: linear-gradient(135deg, var(--chat-primary), #9c1a1e);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 8px 25px rgba(238, 39, 45, 0.4);
    cursor: pointer;
    z-index: 9999;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 3px solid white;
}

.chatbot-trigger:hover {
    transform: scale(1.1) translateY(-5px);
    box-shadow: 0 12px 30px rgba(238, 39, 45, 0.4);
}

.chatbot-trigger .trigger-notification {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff4757;
    color: white;
    font-size: 12px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
    font-weight: bold;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.chatbot-trigger svg {
    width: 30px;
    height: 30px;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.chatbot-trigger.active {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.8);
}

/* Chat Window */
.chatbot-window {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 400px;
    max-width: calc(100vw - 60px);
    height: 650px;
    max-height: calc(100vh - 150px);
    background: var(--chat-bg);
    backdrop-filter: blur(15px);
    border-radius: var(--chat-radius);
    box-shadow: var(--chat-shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 9998;
    transform: translateY(30px) scale(0.9);
    opacity: 0;
    pointer-events: none;
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

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

/* Header */
.chat-header {
    background: var(--chat-header);
    padding: 20px 25px;
    color: white;
    display: flex;
    align-items: center;
    gap: 15px;
    position: relative;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-avatar-container {
    position: relative;
}

.chat-avatar {
    width: 45px;
    height: 45px;
    background: transparent;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 22px;
    color: white;
    overflow: hidden;
}

.chat-avatar img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.online-indicator {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 14px;
    height: 14px;
    background: #2ed573;
    border-radius: 50%;
    border: 3px solid var(--chat-header);
}

.chat-info h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.chat-info .status-text {
    font-size: 12px;
    opacity: 0.7;
    display: flex;
    align-items: center;
    gap: 5px;
}

.close-chat {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.2s;
}

.close-chat:hover {
    opacity: 1;
}

/* Chat Body (Messages) */
.chat-body {
    flex: 1;
    padding: 25px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
    scroll-behavior: smooth;
    background: linear-gradient(to bottom, #f8f9fa, #ffffff);
}

.chat-body::-webkit-scrollbar {
    width: 5px;
}

.chat-body::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
}

.message {
    max-width: 85%;
    padding: 14px 18px;
    border-radius: 20px;
    font-size: 14.5px;
    line-height: 1.6;
    position: relative;
    white-space: pre-wrap;
    word-wrap: break-word;
    animation: messageEntry 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes messageEntry {
    from { opacity: 0; transform: translateY(15px) scale(0.9); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.message.bot {
    align-self: flex-start;
    background: white;
    color: var(--chat-text);
    border-bottom-left-radius: 5px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border: 1px solid #eee;
}

.chat-link {
    color: var(--chat-primary);
    text-decoration: underline;
    font-weight: 600;
    transition: color 0.2s;
}

.chat-link:hover {
    color: var(--chat-accent);
}

.message.user {
    align-self: flex-end;
    background: var(--chat-primary);
    color: white;
    border-bottom-right-radius: 5px;
    box-shadow: 0 4px 15px rgba(238, 39, 45, 0.2);
}

.beta-tag {
    background: var(--chat-primary);
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 8px;
    vertical-align: middle;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.beta-disclaimer {
    font-size: 11px;
    color: var(--chat-secondary);
    text-align: center;
    padding: 8px 15px;
    background: rgba(0, 0, 0, 0.03);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    font-style: italic;
}

/* Typing Indicator */
.typing-indicator {
    padding: 12px 18px;
    background: white;
    border-radius: 20px;
    align-self: flex-start;
    display: none;
    gap: 5px;
    border: 1px solid #eee;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: #cbd5e0;
    border-radius: 50%;
    animation: typing 1s infinite alternate;
}

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

@keyframes typing {
    from { transform: translateY(0); opacity: 0.4; }
    to { transform: translateY(-7px); opacity: 1; }
}

.quick-actions {
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
    padding: 15px 25px;
    background: white;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    overflow-x: auto;
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}

.quick-actions::-webkit-scrollbar {
    display: none; /* Chrome, Safari and Opera */
}

.action-btn {
    padding: 8px 16px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 25px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    color: #495057;
    white-space: nowrap;
    flex-shrink: 0;
}

.action-btn:hover {
    background: var(--chat-primary);
    color: white;
    border-color: var(--chat-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(238, 39, 45, 0.2);
}

/* Input Area */
.chat-input-area {
    padding: 20px 25px;
    background: white;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    gap: 12px;
}

.chat-input {
    flex: 1;
    border: 2px solid #f1f3f5;
    background: #f8f9fa;
    padding: 12px 20px;
    border-radius: 30px;
    outline: none;
    font-size: 15px;
    transition: all 0.3s;
}

.chat-input:focus {
    border-color: var(--chat-primary);
    background: white;
    box-shadow: 0 0 0 4px rgba(238, 39, 45, 0.1);
}

.send-btn {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--chat-primary), #9c1a1e);
    color: white;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 6px 15px rgba(238, 39, 45, 0.4);
    flex-shrink: 0;
}

.send-btn:hover {
    transform: scale(1.05) translateY(-2px);
    background: #9c1a1e;
    box-shadow: 0 6px 15px rgba(238, 39, 45, 0.5);
}

.send-btn:active {
    transform: scale(0.95);
}

.send-btn svg {
    width: 22px;
    height: 22px;
    margin-left: 2px; /* Slight adjustment for visual centering of the send icon */
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .chatbot-window {
        --chat-bg: #1e1e1e;
        --chat-text: #f1f2f6;
        --chat-header: #121212;
    }
    .chat-header h3 {
        color: white !important;
    }
    .chat-header .status-text {
        color: rgba(255, 255, 255, 0.7) !important;
    }
    .chat-body {
        background: linear-gradient(to bottom, #18191a, #121212);
    }
    .message.bot {
        background: #2d2d2d;
        border-color: #3d3d3d;
        color: #f1f2f6;
    }
    .chat-input-area, .quick-actions {
        background: #18191a;
        border-color: #333;
    }
    .chat-input {
        background: #2d2d2d !important;
        border-color: #444 !important;
        color: white !important;
    }
    .chat-input::placeholder {
        color: rgba(255, 255, 255, 0.5);
    }
    .action-btn {
        background: #2d2d2d;
        border-color: #3d3d3d;
        color: #f1f2f6;
    }
    .typing-indicator {
        background: #2d2d2d;
        border-color: #3d3d3d;
    }
}

/* Mobile Adjustments */
@media (max-width: 480px) {
    .chatbot-window {
        width: 100%;
        height: 100%;
        bottom: 0;
        right: 0;
        max-width: 100%;
        max-height: 100%;
        border-radius: 0;
    }
    .chatbot-trigger {
        bottom: 20px;
        right: 20px;
    }
}

