:root {
  --aic-primary-color: #0073aa;
  --aic-primary-dark: #005a87;
  --aic-primary-light: #4a9cc7;
  --aic-bg-color: #ffffff;
  --aic-text-color: #333333;
  --aic-border-radius: 16px;
  --aic-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  --aic-gradient: linear-gradient(135deg, var(--aic-primary-color) 0%, var(--aic-primary-light) 100%);
  --aic-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#aic-chatbot-launcher {
    position: fixed;
    bottom: calc(var(--aic-position-bottom) + 10px);
    right: calc(var(--aic-position-right) + 10px);
    width: 70px;
    height: 70px;
    background: var(--aic-gradient);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--aic-shadow);
    z-index: 9998;
    transition: var(--aic-transition);
    border: 3px solid white;
    animation: pulse 2s infinite;
}

#aic-chatbot-launcher:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 12px 40px rgba(0, 115, 170, 0.3);
}

#aic-chatbot-launcher img {
    width: 70%;
    height: 70%;
    border-radius: 50%;
    object-fit: cover;
    transition: var(--aic-transition);
}

#aic-chatbot {
    position: fixed;
    bottom: var(--aic-position-bottom);
    right: var(--aic-position-right);
    width: var(--aic-width, 380px);
    max-width: calc(100% - 40px);
    border: none;
    background: var(--aic-bg-color);
    font-family: var(--aic-font-family, 'Segoe UI', system-ui, sans-serif);
    box-shadow: var(--aic-shadow);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    height: var(--aic-height, 600px);
    max-height: 70vh;
    border-radius: var(--aic-border-radius, 16px);
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px) scale(0.9);
    transition: var(--aic-transition);
}

#aic-chatbot.show {
    opacity: 1;
    transform: translateY(0) scale(1);
}

#aic-chatbot-custom-footer {
    padding: 12px 16px;
    text-align: center;
    font-size: 11px;
    color: var(--aic-footer-text-color, #888888);
    border-top: 1px solid #f0f0f0;
    background: #fafafa;
    letter-spacing: 0.5px;
}

#aic-chatbot-header {
    background: var(--aic-gradient);
    color: #fff;
    padding: 20px 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.aic-chatbot-close-button {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--aic-transition);
}

.aic-chatbot-close-button:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

#aic-chatbot-header::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #4ade80;
    border-radius: 50%;
    animation: status-pulse 2s infinite;
}

#aic-chatbot-body {
    flex-grow: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f8fafc;
    scrollbar-width: thin;
    scrollbar-color: var(--aic-primary-light) transparent;
}

#aic-chatbot-body::-webkit-scrollbar {
    width: 4px;
}

#aic-chatbot-body::-webkit-scrollbar-track {
    background: transparent;
}

#aic-chatbot-body::-webkit-scrollbar-thumb {
    background: var(--aic-primary-light);
    border-radius: 2px;
}

#aic-chatbot-footer {
    border-top: 1px solid #f0f0f0;
    display: flex;
    padding: 16px;
    background: white;
    gap: 8px;
}

#aic-chatbot-input {
    flex-grow: 1;
    border: 2px solid #e2e8f0;
    padding: 12px 16px;
    border-radius: 25px;
    font-size: 14px;
    transition: var(--aic-transition);
    outline: none;
    background: #f8fafc;
}

#aic-chatbot-input:focus {
    border-color: var(--aic-primary-light);
    background: white;
    box-shadow: 0 0 0 3px rgba(74, 156, 199, 0.1);
}

#aic-chatbot-send {
    background: var(--aic-gradient);
    padding: 12px 20px;
    border: none;
    color: white;
    cursor: pointer;
    border-radius: 25px;
    transition: var(--aic-transition);
    font-weight: 600;
    min-width: 60px;
}

#aic-chatbot-send:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 115, 170, 0.3);
}

#aic-chatbot-messages {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.aic-chatbot-message {
    margin-bottom: 0;
    max-width: 85%;
    animation: messageSlide 0.3s ease-out;
}

.aic-chatbot-message .message-content {
    padding: 14px 18px;
    border-radius: 18px;
    line-height: 1.5;
    font-size: 14px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    position: relative;
    word-wrap: break-word;
}

.aic-chatbot-message.user {
    align-self: flex-end;
    text-align: right;
}

.aic-chatbot-message.bot {
    align-self: flex-start;
}

.aic-chatbot-message.bot .message-content {
    background: white;
    color: var(--aic-text-color);
    border-bottom-left-radius: 6px;
}

.aic-chatbot-message.user .message-content {
    background: var(--aic-gradient);
    color: #fff;
    border-bottom-right-radius: 6px;
}

.aic-chatbot-message.typing .message-content {
    background: white;
    padding: 16px 20px;
}

.typing-indicator span {
    height: 10px;
    width: 10px;
    background-color: var(--aic-primary-light);
    border-radius: 50%;
    display: inline-block;
    animation: bounce 1.3s infinite;
    margin: 0 2px;
}

.aic-quick-replies {
    order: 2;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    padding: 12px 16px;
    border-top: 1px solid #f0f0f0;
    background: white;
    gap: 8px;
}

.aic-quick-replies button {
    background: transparent;
    border: 2px solid var(--aic-primary-color);
    color: var(--aic-primary-color);
    border-radius: 20px;
    padding: 10px 18px;
    cursor: pointer;
    font-size: 13px;
    transition: var(--aic-transition);
    font-weight: 500;
}

.aic-quick-replies button:hover {
    background: var(--aic-primary-color);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 115, 170, 0.2);
}

/* Animations */
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes status-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

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

@keyframes bounce {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 768px) {
    #aic-chatbot {
        width: 100%;
        height: 100%;
        max-height: 100%;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        border-radius: 0;
        max-width: 100%;
    }

    #aic-chatbot-launcher {
        bottom: 20px;
        right: 20px;
        width: 60px;
        height: 60px;
    }

    #aic-chatbot-body {
        padding: 16px;
    }

    .aic-chatbot-message {
        max-width: 90%;
    }

    .aic-chatbot-message .message-content {
        font-size: 15px;
    }

    #aic-chatbot-input {
        padding: 14px 18px;
        font-size: 15px;
    }

    #aic-chatbot-header {
        padding: 16px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --aic-bg-color: #1a1a1a;
        --aic-text-color: #ffffff;
    }

    #aic-chatbot-body {
        background: #2d2d2d;
    }

    #aic-chatbot-input {
        background: #3d3d3d;
        border-color: #4d4d4d;
        color: white;
    }

    .aic-chatbot-message.bot .message-content {
        background: #3d3d3d;
        color: white;
    }

    #aic-chatbot-custom-footer {
        background: #2d2d2d;
        border-top-color: #3d3d3d;
    }
}
