/* Chatbot Widget Styling */

:root {
    --chatbot-primary: #ef4444;
    --chatbot-secondary: #991b1b;
    --chatbot-gradient: linear-gradient(135deg, #ef4444, #991b1b);
    --chatbot-bg: #1a1a1a;
    --chatbot-surface: #2a2a2a;
    --chatbot-border: rgba(255, 255, 255, 0.1);
    --chatbot-text: #ffffff;
    --chatbot-text-secondary: #94a3b8;
}

/* Chatbot Button - Floating */
.chatbot-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: var(--chatbot-gradient);
    border-radius: 50%;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(239, 68, 68, 0.4);
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: pulse-bot 2s ease-in-out infinite;
}

.chatbot-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(239, 68, 68, 0.6);
}

.chatbot-button svg {
    width: 28px;
    height: 28px;
    fill: white;
}

.chatbot-button.active {
    transform: scale(0.9);
}

@keyframes pulse-bot {

    0%,
    100% {
        box-shadow: 0 4px 20px rgba(239, 68, 68, 0.4);
    }

    50% {
        box-shadow: 0 4px 30px rgba(239, 68, 68, 0.6);
    }
}

/* Notification Badge */
.chatbot-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #22c55e;
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    border: 2px solid var(--chatbot-bg);
}

/* Chatbot Window */
.chatbot-window {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 380px;
    height: 600px;
    background: var(--chatbot-bg);
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: none;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--chatbot-border);
    animation: slideIn 0.3s ease-out;
}

.chatbot-window.active {
    display: flex;
}

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

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

/* Chatbot Header */
.chatbot-header {
    background: var(--chatbot-gradient);
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

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

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

.chatbot-title h3 {
    font-size: 16px;
    font-weight: 700;
    color: white;
    margin: 0;
}

.chatbot-title p {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
    margin: 0;
}

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

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

/* Chat Messages Area */
.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: var(--chatbot-bg);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

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

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

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

/* Message Bubble */
.message {
    display: flex;
    gap: 10px;
    animation: messageAppear 0.3s ease-out;
}

@keyframes messageAppear {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

.message.bot {
    flex-direction: row;
}

.message.user {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--chatbot-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.message.user .message-avatar {
    background: #475569;
}

.message-content {
    max-width: 75%;
}

.message-bubble {
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--chatbot-text);
}

.message.bot .message-bubble {
    background: var(--chatbot-surface);
    border-bottom-left-radius: 4px;
}

.message.user .message-bubble {
    background: var(--chatbot-gradient);
    border-bottom-right-radius: 4px;
}

.message-time {
    font-size: 11px;
    color: var(--chatbot-text-secondary);
    margin-top: 4px;
    padding: 0 4px;
}

/* Quick Replies */
.quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.quick-reply-btn {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--chatbot-primary);
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.quick-reply-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: var(--chatbot-primary);
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: var(--chatbot-text-secondary);
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

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

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

@keyframes typing {

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

    30% {
        opacity: 1;
        transform: translateY(-8px);
    }
}

/* Email Form */
.chatbot-email-form {
    background: var(--chatbot-surface);
    padding: 16px;
    border-radius: 12px;
    margin-top: 8px;
}

.chatbot-email-form input {
    width: 100%;
    padding: 10px 14px;
    background: var(--chatbot-bg);
    border: 1px solid var(--chatbot-border);
    border-radius: 8px;
    color: var(--chatbot-text);
    font-size: 14px;
    margin-bottom: 10px;
}

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

.chatbot-email-form button {
    width: 100%;
    padding: 10px;
    background: var(--chatbot-gradient);
    border: none;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.chatbot-email-form button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

/* Chat Input Area */
.chatbot-input-area {
    padding: 16px;
    background: var(--chatbot-surface);
    border-top: 1px solid var(--chatbot-border);
    display: flex;
    gap: 10px;
}

.chatbot-input {
    flex: 1;
    padding: 12px 16px;
    background: var(--chatbot-bg);
    border: 1px solid var(--chatbot-border);
    border-radius: 24px;
    color: var(--chatbot-text);
    font-size: 14px;
    font-family: 'Outfit', sans-serif;
}

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

.chatbot-input::placeholder {
    color: var(--chatbot-text-secondary);
}

.chatbot-send-btn {
    width: 44px;
    height: 44px;
    background: var(--chatbot-gradient);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.chatbot-send-btn:hover {
    transform: scale(1.05);
}

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

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

/* Mobile Responsive */
@media (max-width: 768px) {
    .chatbot-window {
        bottom: 0;
        right: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        border-radius: 0;
        max-height: 100vh;
    }

    .chatbot-button {
        bottom: 15px;
        right: 15px;
        width: 56px;
        height: 56px;
    }

    .chatbot-button svg {
        width: 24px;
        height: 24px;
    }
}