/* Chatbot Premium Design */
:root {
    --chatbot-primary: #006AE6;
    --chatbot-secondary: #f8f9fa;
    --chatbot-text: #212529;
    --chatbot-bg: rgba(255, 255, 255, 0.95);
    --chatbot-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    --chatbot-radius: 20px;
    --bot-msg-bg: #f0f2f5;
    --user-msg-bg: #006AE6;
}

#chatbot-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

.chatbot-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--chatbot-primary);
    box-shadow: 0 4px 15px rgba(0, 106, 230, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: none;
    color: white;
}

.chatbot-button.shake {
    animation: shake-btn 0.5s cubic-bezier(.36,.07,.19,.97) both;
    animation-iteration-count: 3;
}

@keyframes shake-btn {
    10%, 90% { transform: translate3d(-1px, 0, 0); }
    20%, 80% { transform: translate3d(2px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
    40%, 60% { transform: translate3d(4px, 0, 0); }
}

.chatbot-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 106, 230, 0.4);
}

.chatbot-button svg {
    width: 30px;
    height: 30px;
    fill: currentColor;
}

.chatbot-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    height: 550px;
    background: var(--chatbot-bg);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--chatbot-radius);
    box-shadow: var(--chatbot-shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform-origin: bottom right;
    transform: scale(0);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.chatbot-window.active {
    transform: scale(1);
    opacity: 1;
    visibility: visible;
}

.chatbot-header {
    padding: 20px;
    background: var(--chatbot-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chatbot-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.chatbot-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s;
}

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

.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    background: rgba(255, 255, 255, 0.5);
}

.message {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 0.95rem;
    line-height: 1.4;
    position: relative;
    animation: fadeIn 0.3s ease;
}

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

.message.bot {
    align-self: flex-start;
    background: var(--bot-msg-bg);
    color: var(--chatbot-text);
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
    border: 1px solid rgba(0,0,0,0.05);
}

.message.bot::before {
    content: "Pagefai Bot";
    display: block;
    font-size: 0.7rem;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--chatbot-primary);
    text-transform: uppercase;
}

.message.user {
    align-self: flex-end;
    background: var(--user-msg-bg);
    color: white;
    border-bottom-right-radius: 4px;
    box-shadow: 0 4px 10px rgba(0, 106, 230, 0.2);
}

/* Options/Chips */
.chatbot-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
    animation: fadeIn 0.4s ease;
}

.option-btn {
    background: white;
    border: 1px solid var(--chatbot-primary);
    color: var(--chatbot-primary);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.option-btn:hover {
    background: var(--chatbot-primary);
    color: white;
}

.chatbot-input-area {
    padding: 15px;
    background: white;
    border-top: 1px solid #eee;
    display: flex;
    gap: 10px;
}

.chatbot-input {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 24px;
    padding: 10px 15px;
    outline: none;
    font-size: 0.9rem;
    transition: border-color 0.2s;
}

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

.chatbot-send {
    background: var(--chatbot-primary);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s;
}

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

.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 10px;
    background: white;
    border-radius: 12px;
    width: fit-content;
    margin-bottom: 10px;
}

.typing-indicator span {
    width: 6px;
    height: 6px;
    background: #ccc;
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}

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

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1.0); }
}
