/* Cyber-Luxury Chatbot Styles - Deep Purple Edition */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --cb-bg: rgba(26, 1, 21, 0.95);
    /* Aarchi's deep purple logo color */
    --cb-gold: #d4a437;
    /* website metallic-gold */
    --cb-green: #2ecc71;
    --cb-blue: #007bff;
    --cb-magenta: #c20aaa;
    --cb-text: #ffffff;
    /* white text for dark theme */
    --cb-text-muted: rgba(255, 255, 255, 0.7);
    --cb-glass: blur(20px);
    --cb-border: 1px solid rgba(212, 164, 55, 0.3);
}

.chatbot-widget {
    position: fixed;
    bottom: 25px;
    right: 25px;
    z-index: 10000;
    font-family: 'Inter', sans-serif;
    color: var(--cb-text);
    pointer-events: none;
    /* Prevent blocking clicks */
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInPremium {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes bounce {

    0%,
    80%,
    100% {
        transform: scale(0);
    }

    40% {
        transform: scale(1.0);
    }
}

@keyframes floatBubble {

    0%,
    100% {
        transform: translateY(-50%) translateX(0);
    }

    50% {
        transform: translateY(-55%) translateX(5px);
    }
}

@keyframes glowBorder {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

@keyframes shimmer {
    to {
        background-position: 200% center;
    }
}

/* Chat Container */
.chatbot-container {
    position: fixed;
    bottom: 95px;
    right: 25px;
    width: 380px;
    height: 580px;
    background: var(--cb-bg);
    border-radius: 24px;
    display: none;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4);
    backdrop-filter: var(--cb-glass);
    -webkit-backdrop-filter: var(--cb-glass);
    z-index: 10000;
    animation: slideInPremium 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.1);
    border: 1px solid rgba(212, 164, 55, 0.2);
    pointer-events: auto;
    /* Re-enable clicks for the chat window */
}

.chatbot-container.active {
    display: flex;
}

.chatbot-container::before {
    content: '';
    position: absolute;
    inset: -1px;
    background: linear-gradient(45deg, var(--cb-gold), transparent, var(--cb-green), transparent, var(--cb-gold));
    background-size: 400% 400%;
    z-index: -1;
    border-radius: 25px;
    animation: glowBorder 8s linear infinite;
    opacity: 0.4;
}

/* Header */
.chatbot-header {
    padding: 18px 20px;
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid rgba(212, 164, 55, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chatbot-header-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chatbot-header-logo {
    width: 30px;
    height: 30px;
    object-fit: contain;
    filter: drop-shadow(0 0 5px var(--cb-gold));
}

.shimmer-text {
    background: linear-gradient(90deg, #fff 0%, var(--cb-gold) 50%, #fff 100%);
    background-size: 200% auto;
    color: transparent !important;
    -webkit-background-clip: text;
    background-clip: text;
    animation: shimmer 3s linear infinite;
    font-weight: 700;
    font-size: 15px;
    margin: 0;
}

.chatbot-close {
    background: none;
    border: none;
    color: var(--cb-gold);
    /* Visible contrast! */
    cursor: pointer;
    font-size: 28px;
    padding: 0;
    line-height: 1;
    display: flex;
    align-items: center;
    transition: transform 0.2s ease, color 0.2s ease;
}

.chatbot-close:hover {
    transform: scale(1.2);
    color: #fff;
}

/* Messages Area */
.chatbot-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: radial-gradient(circle at top right, rgba(212, 164, 55, 0.05), transparent);
}

.chatbot-messages::-webkit-scrollbar {
    width: 6px;
}

.chatbot-messages::-webkit-scrollbar-thumb {
    background: rgba(212, 164, 55, 0.3);
    border-radius: 10px;
}

.message-container {
    display: flex;
    gap: 12px;
    max-width: 90%;
    animation: fadeIn 0.3s ease forwards;
}

.bot-container {
    align-self: flex-start;
}

.user-container {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.bot-avatar-inner {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1.5px solid var(--cb-green);
    background: var(--cb-bg);
    padding: 2px;
    flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.message {
    padding: 12px 18px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.5;
    position: relative;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    color: #fff;
}

.user-message {
    background: linear-gradient(135deg, rgba(212, 164, 55, 0.2), rgba(212, 164, 55, 0.1));
    border: 1px solid rgba(212, 164, 55, 0.3);
    border-top-right-radius: 4px;
}

.bot-message {
    background: linear-gradient(135deg, rgba(46, 204, 113, 0.15), rgba(46, 204, 113, 0.05));
    border: 1px solid rgba(46, 204, 113, 0.2);
    border-top-left-radius: 4px;
}

/* Typing Indicator */
.typing-container {
    opacity: 0.8;
}

.typing {
    display: flex;
    gap: 5px;
    padding: 10px 14px;
}

.dot {
    width: 6px;
    height: 6px;
    background: var(--cb-green);
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}

.dot:nth-child(1) {
    animation-delay: -0.32s;
}

.dot:nth-child(2) {
    animation-delay: -0.16s;
}

/* Input Area */
.chatbot-input-area {
    padding: 18px;
    border-top: 1px solid rgba(212, 164, 55, 0.2);
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    gap: 12px;
}

.chatbot-input-area input {
    flex: 1;
    min-width: 0;
    /* Allows input to shrink below default size */
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(212, 164, 55, 0.2);
    border-radius: 14px;
    padding: 12px 16px;
    color: #fff;
    font-size: 14px;
    outline: none;
    transition: all 0.3s ease;
}

.chatbot-input-area input:focus {
    border-color: var(--cb-gold);
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 10px rgba(212, 164, 55, 0.1);
}

.chatbot-send-btn {
    background: linear-gradient(135deg, var(--cb-gold), #b38a2c);
    color: #000;
    border: none;
    border-radius: 12px;
    padding: 0 20px;
    cursor: pointer;
    font-weight: 700;
    transition: all 0.3s ease;
    flex-shrink: 0;
    /* Prevents button from being squashed */
    white-space: nowrap;
    /* Prevents text wrapping */
}

.chatbot-send-btn:hover {
    box-shadow: 0 0 15px var(--cb-gold);
    transform: translateY(-2px);
}

@media screen and (max-width: 480px) {
    .chatbot-widget {
        bottom: 15px;
        right: 15px;
    }

    .chatbot-container {
        bottom: 80px;
        right: 10px;
        width: calc(100vw - 20px);
        height: calc(100dvh - 100px);
        border-radius: 20px;
    }

    .chatbot-messages {
        padding: 15px;
    }

    .message {
        font-size: 15px;
        padding: 10px 14px;
        max-width: 85%;
    }

    .chatbot-input-area {
        padding: 12px;
        gap: 8px;
    }

    .chatbot-input-area input {
        font-size: 16px;
        padding: 10px 14px;
    }

    .chatbot-send-btn {
        padding: 0 15px;
    }

    .chatbot-header {
        padding: 15px;
    }
}