/* Chatbot Widget Styles - Premium Design */

/* Chatbot-specific color variables */
:root {
    --chatbot-bg: #ffffff;
    --chatbot-bg-alt: #f8f9fa;
    --chatbot-border: #e5e7eb;
    --chatbot-text: #1f2937;
    --chatbot-text-light: #6b7280;
    --chatbot-primary: var(--primary-color);
    --chatbot-success: #10b981;
    --chatbot-error: #ef4444;
    --chatbot-warning: #f59e0b;
}

.chatbot-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    font-family: var(--font-family);
    /* Safe area support for devices with notches */
    bottom: max(24px, env(safe-area-inset-bottom, 24px));
    right: max(24px, env(safe-area-inset-right, 24px));
}

.chatbot-button {
    width: 64px;
    height: 64px;
    min-width: 48px;
    min-height: 48px;
    border-radius: 50%;
    background: var(--primary-color);
    color: var(--white);
    border: none;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    transition: var(--transition);
    position: relative;
    /* Ensure touch target is accessible */
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    /* Ensure button can receive touch events */
    pointer-events: auto;
    /* Prevent text selection on touch */
    user-select: none;
    -webkit-user-select: none;
}

.chatbot-button {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.chatbot-button:hover {
    transform: scale(1.1) translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2),
                0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Add subtle pulse when new message arrives */
.chatbot-button.has-notification {
    animation: notificationPulse 2s ease-in-out infinite;
}

@keyframes notificationPulse {
    0%, 100% { 
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15); 
    }
    50% { 
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25), 
                    0 0 0 4px rgba(0, 0, 0, 0.1); 
    }
}

.chatbot-button:active,
.chatbot-button.active-touch {
    transform: scale(0.95);
}

.chatbot-button.active {
    background: var(--primary-accent);
}

.chatbot-button .notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 20px;
    height: 20px;
    min-width: 20px;
    min-height: 20px;
    background: #ef4444;
    border-radius: 50%;
    border: 2px solid var(--white);
    display: none;
}

.chatbot-button.has-notification .notification-badge {
    display: block;
}

.chatbot-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    max-width: calc(100vw - 48px);
    height: 600px;
    max-height: calc(100vh - 120px);
    background: var(--white);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    display: none;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--section-border);
    animation: windowSlideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    /* Ensure proper stacking and safe area handling */
    max-height: calc(100vh - 120px - env(safe-area-inset-bottom, 0px));
    /* Prevent text size adjustment on iOS */
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

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

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

/* Legacy animation - kept for compatibility */

.chatbot-header {
    background: var(--primary-color);
    color: var(--white);
    padding: 1.25rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.chatbot-header h3 {
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.01em;
}

.chatbot-header .status {
    font-size: 0.75rem;
    opacity: 0.9;
    margin-top: 0.25rem;
}

.chatbot-close {
    background: transparent;
    border: none;
    color: var(--white);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: var(--transition);
    /* Ensure touch target is accessible */
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

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

.chatbot-close:active {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(0.95);
}

.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: var(--section-bg-alt);
    /* Smooth scrolling on mobile */
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    /* Prevent pull-to-refresh interference */
    overscroll-behavior-y: contain;
}

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

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

.chatbot-messages::-webkit-scrollbar-thumb {
    background: var(--section-border);
    border-radius: 3px;
}

.chatbot-messages::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}

.message {
    display: flex;
    gap: 0.75rem;
    animation: messageSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.message.user {
    animation: messageSlideInRight 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

@keyframes messageSlideInRight {
    from {
        opacity: 0;
        transform: translateX(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

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

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease;
}

.message-avatar:hover {
    transform: scale(1.05);
}

.message.bot .message-avatar {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-accent) 100%);
    color: var(--white);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.message.user .message-avatar {
    background: linear-gradient(135deg, var(--section-border) 0%, #d1d5db 100%);
    color: var(--primary-color);
    border: 2px solid rgba(0, 0, 0, 0.05);
}

/* Pulse animation for new bot messages */
.message.bot.new-message .message-avatar {
    animation: pulse 0.6s ease-out;
}

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

.message-content {
    max-width: 75%;
    padding: 0.625rem 0.875rem;
    border-radius: 10px;
    line-height: 1.5;
    font-size: 0.8125rem;
    letter-spacing: -0.01em;
    word-wrap: break-word;
    overflow-wrap: break-word;
    position: relative;
}

/* Better spacing for paragraphs in messages */
.message-content p {
    margin: 0.5em 0;
}

.message-content p:first-child {
    margin-top: 0;
}

.message-content p:last-child {
    margin-bottom: 0;
}

/* Better list styling in messages */
.message-content ul,
.message-content ol {
    margin: 0.5em 0;
    padding-left: 1.5em;
}

.message-content li {
    margin: 0.25em 0;
}

/* Bold text styling */
.message-content strong {
    font-weight: 600;
    color: inherit;
}

.message.bot .message-content strong {
    color: var(--primary-color);
}

.message.user .message-content strong {
    color: var(--white);
}

.message.bot .message-content {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    color: var(--text-color);
    border: 1px solid var(--section-border);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08), 
                0 1px 2px rgba(0, 0, 0, 0.04);
}

/* Add subtle left tail/pointer for bot messages */
.message.bot .message-content::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 12px;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 8px 8px 8px 0;
    border-color: transparent #ffffff transparent transparent;
    filter: drop-shadow(-1px 0 1px rgba(0, 0, 0, 0.05));
}

.message.user .message-content {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-accent) 100%);
    color: var(--white);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15),
                0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Add subtle right tail/pointer for user messages */
.message.user .message-content::after {
    content: '';
    position: absolute;
    right: -8px;
    top: 12px;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 8px 0 8px 8px;
    border-color: transparent transparent transparent var(--primary-color);
}

/* Message formatting */
.message-content a {
    color: var(--primary-color);
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: var(--transition-fast);
}

.message.user .message-content a {
    color: var(--white);
    opacity: 0.9;
}

.message-content a:hover {
    opacity: 0.8;
}

.message-content br {
    line-height: 1.6;
}

.message-typing {
    display: flex;
    gap: 0.5rem;
    padding: 0.875rem 1.125rem;
    background: var(--white);
    border-radius: 12px;
    border: 1px solid var(--section-border);
    width: fit-content;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.message-typing span {
    width: 8px;
    height: 8px;
    background: var(--primary-color);
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out;
}

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

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

@keyframes typingBounce {
    0%, 60%, 100% {
        transform: translateY(0) scale(1);
        opacity: 0.5;
    }
    30% {
        transform: translateY(-10px) scale(1.1);
        opacity: 1;
    }
}

.chatbot-captcha-container {
    padding: 1.25rem 1.5rem;
    background: var(--section-bg-alt);
    border-top: 1px solid var(--section-border);
    border-bottom: 1px solid var(--section-border);
}

.chatbot-captcha-message {
    margin-bottom: 1rem;
    color: var(--text-color);
    font-size: 0.875rem;
    text-align: center;
}

.chatbot-captcha-message p {
    margin: 0;
    color: var(--secondary-color);
    font-weight: 500;
}

.chatbot-captcha-container .h-captcha {
    display: flex;
    justify-content: center;
    margin: 0 auto;
}

.chatbot-captcha-check {
    display: block;
    width: 100%;
    margin-top: 0.75rem;
    padding: 0.625rem 1rem;
    background: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.chatbot-captcha-check:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

.chatbot-captcha-check:active {
    transform: translateY(0);
}

.chatbot-input-container {
    padding: 0.75rem 0.875rem;
    background: var(--white);
    border-top: 1px solid var(--section-border);
    transition: opacity 0.3s ease, pointer-events 0.3s ease;
}

.chatbot-input-form {
    display: flex;
    gap: 0.5rem;
    align-items: flex-end;
}

.chatbot-input {
    flex: 1;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--section-border);
    border-radius: 6px;
    font-size: 0.875rem;
    font-family: var(--font-family);
    resize: none;
    max-height: 120px;
    line-height: 1.4;
    transition: var(--transition);
    background: var(--section-bg-alt);
    /* Prevent iOS zoom on focus */
    font-size: 16px;
    /* Better mobile input handling */
    -webkit-appearance: none;
    appearance: none;
    /* Prevent text size adjustment */
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

@media (min-width: 481px) {
    .chatbot-input {
        font-size: 0.9375rem;
    }
}

.chatbot-input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: var(--white);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
}

.chatbot-input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

    .chatbot-send {
        width: 36px;
        height: 36px;
        min-width: 36px;
        min-height: 36px;
        border-radius: 6px;
        background: var(--primary-color);
        color: var(--white);
        border: none;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: var(--transition);
        flex-shrink: 0;
        /* Ensure touch target is accessible */
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
        /* Always visible on mobile */
        position: relative;
        z-index: 2;
    }

.chatbot-send:hover:not(:disabled) {
    background: var(--primary-accent);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.chatbot-send:active:not(:disabled) {
    transform: translateY(0) scale(0.95);
}

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

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

/* Quick actions - Horizontal scroll on mobile, flex on desktop */
.chatbot-quick-actions {
    padding: 0.5rem 0.75rem;
    display: flex;
    gap: 0.375rem;
    background: var(--white);
    border-top: 1px solid var(--section-border);
    /* Enable horizontal scroll on mobile */
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
    /* Prevent wrapping */
    flex-wrap: nowrap;
    /* Position relative for fade indicators */
    position: relative;
}

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

.quick-action-button {
    padding: 0.375rem 0.625rem;
    min-height: 32px;
    background: var(--section-bg-alt);
    border: 1px solid var(--section-border);
    border-radius: 5px;
    font-size: 0.8125rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--text-color);
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Ensure touch target is accessible */
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    /* Better text rendering */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    white-space: nowrap;
    /* Prevent shrinking */
    flex-shrink: 0;
}

.quick-action-button:hover {
    background: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
}

.quick-action-button:active,
.quick-action-button.active-touch {
    transform: scale(0.97);
    background: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
}

/* Mobile responsive */
@media (max-width: 768px) {
    .chatbot-container {
        bottom: max(16px, env(safe-area-inset-bottom, 16px));
        right: max(16px, env(safe-area-inset-right, 16px));
    }

    .chatbot-button {
        width: 56px;
        height: 56px;
        min-width: 48px;
        min-height: 48px;
        font-size: 20px;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
        transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
    }
    
    /* Hide the floating button when chatbot window is open on mobile */
    .chatbot-button.active {
        opacity: 0;
        pointer-events: none;
        transform: scale(0.8);
        visibility: hidden;
    }
    
    /* Add backdrop overlay when chatbot is open */
    .chatbot-container::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.25s ease, visibility 0.25s ease;
        z-index: 9998;
        pointer-events: none;
    }
    
    /* Show backdrop when chatbot is open (class-based for better browser support) */
    .chatbot-container.chatbot-open::before {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    /* Bottom Sheet Style for Mobile - Full Screen */
    .chatbot-window {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        top: auto !important;
        width: 100% !important;
        max-width: 100% !important;
        height: 90vh;
        height: 90dvh; /* Dynamic viewport height for modern iPhones */
        max-height: 90vh;
        max-height: 90dvh;
        border-radius: 16px 16px 0 0;
        box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.15);
        animation: slideUpFromBottom 0.25s cubic-bezier(0.4, 0, 0.2, 1);
        will-change: transform;
        margin: 0 !important;
        z-index: 10000;
    }
    
    /* Drag handle indicator */
    .chatbot-window::before {
        content: '';
        position: absolute;
        top: 8px;
        left: 50%;
        transform: translateX(-50%);
        width: 36px;
        height: 4px;
        background: rgba(255, 255, 255, 0.4);
        border-radius: 2px;
        z-index: 10;
    }
    
    .chatbot-window.swiping::before {
        background: var(--primary-color);
    }
    
    @keyframes slideUpFromBottom {
        from {
            transform: translateY(100%);
        }
        to {
            transform: translateY(0);
        }
    }
    
    .chatbot-window.swiping {
        transition: none;
    }

    .chatbot-header {
        padding: 1.25rem 1rem 1rem;
        padding-top: 1.5rem; /* Extra space for drag handle */
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
    }
    
    .chatbot-header h3 {
        font-size: 1.125rem;
    }
    
    .chatbot-close {
        width: 40px;
        height: 40px;
        min-width: 40px;
        min-height: 40px;
        font-size: 1.75rem;
    }

    .chatbot-messages {
        padding: 1rem;
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
        gap: 0.75rem;
        flex: 1;
        min-height: 0; /* Important for flex scrolling */
    }

    .message-content {
        max-width: 85%;
        font-size: 0.9375rem;
        padding: 0.75rem 1rem;
    }
    
    /* Hide message tails on mobile for cleaner look */
    .message.bot .message-content::before,
    .message.user .message-content::after {
        display: none;
    }
    
    /* Quick actions - horizontal scroll */
    .chatbot-quick-actions {
        padding: 0.75rem 0;
        padding-left: max(1rem, env(safe-area-inset-left));
        gap: 0.5rem;
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x mandatory;
        scroll-behavior: smooth;
        scrollbar-width: none; /* Firefox */
        -ms-overflow-style: none; /* IE/Edge */
    }
    
    .chatbot-quick-actions::-webkit-scrollbar {
        display: none; /* Chrome/Safari */
    }

    .quick-action-button {
        padding: 0.5rem 0.75rem;
        min-height: 40px;
        font-size: 0.8125rem;
        scroll-snap-align: start;
        flex: 0 0 auto;
        white-space: nowrap;
    }
    
    /* Add spacer after last button so it can scroll fully into view */
    .quick-action-button:last-child {
        margin-right: max(1rem, env(safe-area-inset-right));
    }

    .chatbot-input-container {
        padding: 0.75rem 1rem;
        padding-bottom: max(0.75rem, env(safe-area-inset-bottom));
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
        background: var(--white);
        border-top: 1px solid var(--section-border);
    }
    
    .chatbot-input {
        padding: 0.75rem 1rem;
    }
    
    .chatbot-send {
        width: 44px;
        height: 44px;
    }

    .chatbot-captcha-container {
        padding: 1rem;
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
    }
    
    .chatbot-captcha-message {
        font-size: 0.8125rem;
        margin-bottom: 0.75rem;
    }
}

@media (max-width: 480px) {
    .chatbot-window {
        height: 94vh;
        height: 94dvh;
        max-height: 94vh;
        max-height: 94dvh;
        border-radius: 12px 12px 0 0;
    }

    .chatbot-button {
        width: 52px;
        height: 52px;
    }

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

    .chatbot-header {
        padding: 1.25rem 0.875rem 0.875rem;
        padding-top: max(1.5rem, calc(env(safe-area-inset-top) + 0.75rem));
    }
    
    .chatbot-header h3 {
        font-size: 1rem;
    }

    .chatbot-header .status {
        font-size: 0.6875rem;
    }
    
    .chatbot-messages {
        padding: 0.875rem;
    }
    
    .chatbot-quick-actions {
        padding: 0.625rem 0;
        padding-left: 0.875rem;
        gap: 0.5rem;
    }
    
    .quick-action-button {
        padding: 0.5rem 0.625rem;
        min-height: 36px;
        font-size: 0.75rem;
    }
    
    .quick-action-button:last-child {
        margin-right: 0.875rem;
    }
    
    .chatbot-input-container {
        padding: 0.625rem 0.875rem;
        padding-bottom: max(0.625rem, env(safe-area-inset-bottom));
    }
}

/* Landscape mobile optimization */
@media (max-width: 768px) and (orientation: landscape) {
    .chatbot-window {
        height: 95vh;
        max-height: 95vh;
    }
    
    .chatbot-header {
        padding: 0.75rem 1rem;
        padding-top: 1.25rem;
    }
    
    .chatbot-messages {
        padding: 0.75rem 1rem;
    }
    
    .chatbot-quick-actions {
        padding: 0.5rem 1rem;
    }
    
    .quick-action-button {
        min-height: 36px;
        padding: 0.5rem 0.875rem;
    }
}

/* Accessibility */
.chatbot-button:focus,
.chatbot-close:focus,
.chatbot-send:focus,
.quick-action-button:focus {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
}

.chatbot-button:focus-visible,
.chatbot-close:focus-visible,
.chatbot-send:focus-visible,
.quick-action-button:focus-visible {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
}

/* Screen reader only content */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .chatbot-button,
    .chatbot-send {
        border: 2px solid currentColor;
    }
    
    .chatbot-window {
        border: 2px solid var(--text-color);
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .chatbot-window,
    .message,
    .chatbot-button,
    .chatbot-close,
    .chatbot-send,
    .quick-action-button {
        animation: none;
        transition: none;
    }
    
    .chatbot-button:hover,
    .chatbot-send:hover:not(:disabled),
    .quick-action-button:hover {
        transform: none;
    }
}

/* Loading state */
.chatbot-loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Send button loading state */
.chatbot-send.sending {
    position: relative;
    color: transparent;
    pointer-events: none;
}

.chatbot-send.sending::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    border: 2px solid var(--white);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Success/Error message states */
.message.success .message-content {
    background: linear-gradient(135deg, var(--chatbot-success) 0%, #059669 100%);
    color: white;
}

.message.error .message-content {
    background: linear-gradient(135deg, var(--chatbot-error) 0%, #dc2626 100%);
    color: white;
}

/* GPU acceleration for better performance */
.chatbot-window,
.message,
.chatbot-button {
    will-change: transform;
    transform: translateZ(0);
}


