/* ============================================
   AI CHAT ASSISTANT PRO - MODERN ANIMATIONS
   Version: 3.0 - Premium Edition
   ============================================ */

/* ============================================
   CHAT CONTAINER & BUTTON
   ============================================ */
#aica-chat-container {
    position: fixed;
    bottom: 20px;
    z-index: 99999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

#aica-chat-container.aica-position-right { right: 20px; }
#aica-chat-container.aica-position-left { left: 20px; }

/* Animated Chat Button */
#aica-chat-button {
    /* Larger bubble + resilient icon sizing (Elementor/themes often override img/button rules) */
    width: 72px;
    height: 72px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    padding: 0 !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    /* If the icon is rendered as a background-image, force its visible size */
    background-size: 66px 66px !important;
}

/* Pulse animation for attention */
#aica-chat-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 50%;
    background: inherit;
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
    opacity: 0;
}

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

/* Hover effects */
#aica-chat-button:hover {
    transform: scale(1.1) translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
}

#aica-chat-button:active {
    transform: scale(0.95);
}

#aica-chat-button img {
    /* Bigger icon (some themes override img sizing) */
    width: 56px !important;
    height: 56px !important;
    object-fit: contain;
    max-width: none !important;
    max-height: none !important;
    transition: transform 0.3s ease;
    display: block;
}

/* Bigger default SVG icon too */
#aica-chat-button svg {
    width: 32px !important;
    height: 32px !important;
    display: block;
}

#aica-chat-button:hover img {
    transform: rotate(15deg) scale(1.1);
}

/* ============================================
   CHAT WINDOW - SLIDING ANIMATIONS
   ============================================ */
#aica-chat-window {
    position: fixed;
    bottom: 100px;
    width: 400px;
    max-width: calc(100vw - 40px);
    height: 600px;
    max-height: calc(100vh - 140px);
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    display: none;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#aica-chat-container.aica-position-right #aica-chat-window { right: 20px; }
#aica-chat-container.aica-position-left #aica-chat-window { left: 20px; }

#aica-chat-window.active {
    display: flex;
    opacity: 1;
    transform: translateY(0) scale(1);
}


/* ============================================
   HARD RESET INSIDE WIDGET (AVOID THEME OVERRIDES)
   ============================================ */
#aica-chat-window, 
#aica-chat-window * {
    box-sizing: border-box !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

#aica-chat-window h1,
#aica-chat-window h2,
#aica-chat-window h3,
#aica-chat-window h4,
#aica-chat-window p {
    margin: 0 !important;
}

#aica-chat-window button {
    -webkit-appearance: none;
    appearance: none;
    border: none;
    background: none;
    padding: 0;
    margin: 0;
    font: inherit;
    line-height: 1;
}

#aica-chat-window svg {
    display: block !important;
}



/* Allow WordPress Dashicons inside widget (our hard reset overrides font-family) */
#aica-chat-window .dashicons,
#aica-chat-window .dashicons:before {
    font-family: dashicons !important;
    font-weight: normal !important;
    font-style: normal !important;
    speak: none !important;
    text-decoration: inherit !important;
    text-transform: none !important;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
}

/* ============================================
   AICA OVERRIDE GUARD
   Prevent Elementor/theme typography from overriding widget
   ============================================ */
#aica-chat-window .aica-header-content h3 {
    font-size: 17px !important;
    font-weight: 600 !important;
    letter-spacing: -0.2px !important;
    line-height: 1.2 !important;
    color: #ffffff !important;
}

#aica-chat-window .aica-header-content p {
    font-size: 12px !important;
    opacity: 0.9 !important;
    line-height: 1.2 !important;
    color: #ffffff !important;
}

#aica-chat-window .aica-step-content h3 {
    font-size: 20px !important;
    font-weight: 700 !important;
    color: #1a1a1a !important;
    letter-spacing: -0.3px !important;
}

#aica-chat-window .aica-step-content p {
    font-size: 14px !important;
    color: #666 !important;
    line-height: 1.6 !important;
}

/* ============================================
   LARGE CHANNEL ICONS (WHATSAPP/EMAIL/CALL)
   ============================================ */
#aica-chat-window .aica-channel-icon-large{
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 6px auto 14px;
    color: var(--primary-color, #0084ff);
}

#aica-chat-window .aica-channel-icon-large svg{
    width: 34px;
    height: 34px;
    display: block;
}

/* WhatsApp gets its brand green */
#aica-chat-window #aica-step-whatsapp .aica-channel-icon-large{
    color: #25D366;
}

#aica-chat-window .aica-success-message{
    margin-top: 14px;
    padding: 12px 14px;
    border-radius: 12px;
    background: #f1f5f9;
    color: #111827;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}



#aica-chat-window .aica-form-group label {
    font-size: 13px !important;
    font-weight: 600 !important;
    color: #333 !important;
}

#aica-chat-window .aica-form-group input,
#aica-chat-window .aica-form-group textarea {
    font-size: 14px !important;
}

/* ============================================
   HEADER - GRADIENT & ANIMATIONS
   ============================================ */
.aica-chat-header {
    padding: 24px 20px;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, var(--primary-color, #0084ff) 0%, var(--primary-color-dark, #0066cc) 100%);
}

#aica-chat-window .aica-chat-header h3,
#aica-chat-window .aica-chat-header p {
    color: #ffffff !important;
}

/* Animated background gradient */
.aica-chat-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: headerGlow 8s linear infinite;
    pointer-events: none;
}

@keyframes headerGlow {
    0% { transform: translate(0, 0) rotate(0deg); }
    100% { transform: translate(50%, 50%) rotate(360deg); }
}

.aica-header-content {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    position: relative;
    z-index: 1;
}

/* Animated Avatar */
.aica-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    font-size: 20px;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    animation: avatarBounce 2s ease-in-out infinite;
}

@keyframes avatarBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

.aica-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.aica-header-content h3 {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -0.2px;
}

.aica-header-content p {
    margin: 2px 0 0;
    font-size: 12px;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Online indicator pulse */
.aica-header-content p::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4caf50;
    animation: onlinePulse 2s ease-in-out infinite;
}

@keyframes onlinePulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.2); }
}

/* Close button with smooth transition */
.aica-close-button {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #ffffff;
    cursor: pointer;
    padding: 0 !important; /* avoid theme padding */
    border-radius: 999px !important;
    opacity: 0.9;
    transition: all 0.2s ease;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 10;
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    min-height: 36px !important;
}


.aica-back-hidden {
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
}
.aica-close-button:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.aica-close-button svg {
    display: block;
    pointer-events: none;
}

/* ============================================
   CONTENT AREA - SMOOTH TRANSITIONS
   ============================================ */
#aica-content {
    flex: 1;
    overflow: hidden;
    position: relative;
    background: #ffffff;
}

.aica-step {
    display: none;
    height: 100%;
    opacity: 0;
    transform: translateX(20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.aica-step.active {
    display: flex;
    flex-direction: column;
    opacity: 1;
    transform: translateX(0);
}

/* Specific fix for chat step */
#aica-step-chat {
    display: none;
}

#aica-step-chat.active {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.aica-step-content {
    padding: 28px 24px;
    overflow-y: auto;
    flex: 1;
}

.aica-step-content::-webkit-scrollbar {
    width: 6px;
}

.aica-step-content::-webkit-scrollbar-track {
    background: transparent;
}

.aica-step-content::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 10px;
}

.aica-step-content::-webkit-scrollbar-thumb:hover {
    background: #bbb;
}

.aica-step-content h3 {
    margin: 0 0 8px;
    font-size: 20px;
    font-weight: 700;
    color: #1a1a1a;
    letter-spacing: -0.3px;
}

.aica-step-content p {
    margin: 0 0 24px;
    color: #666;
    font-size: 14px;
    line-height: 1.6;
}

/* ============================================
   FORM ELEMENTS - MODERN INPUTS
   ============================================ */
.aica-form-group {
    margin-bottom: 20px;
}

.aica-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 13px;
    color: #333;
    letter-spacing: 0.2px;
}

.aica-form-group input,
.aica-form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e8e8e8;
    border-radius: 12px;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.3s ease;
    background: #fafafa;
}

.aica-form-group input:focus,
.aica-form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color, #0084ff);
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(0, 132, 255, 0.1);
    transform: translateY(-1px);
}

.aica-form-group input::placeholder,
.aica-form-group textarea::placeholder {
    color: #999;
}

/* Animated Submit Button */
.aica-submit-button {
    width: 100%;
    padding: 14px 24px;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    letter-spacing: 0.3px;
    box-shadow: 0 4px 12px rgba(0, 132, 255, 0.3);
}

.aica-submit-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.aica-submit-button:hover::before {
    width: 300px;
    height: 300px;
}

.aica-submit-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 132, 255, 0.4);
}

.aica-submit-button:active {
    transform: translateY(0);
}

/* ============================================
   CHANNEL SELECTION - CARD ANIMATIONS
   ============================================ */
#aica-channels-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    margin-top: 24px;
}

.aica-channel-option {
    background: #ffffff;
    border: 2px solid #f0f0f0;
    border-radius: 16px;
    padding: 24px 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    position: relative;
    overflow: hidden;
}

.aica-channel-option::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--primary-color, #0084ff) 0%, var(--primary-color-dark, #0066cc) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.aica-channel-option:hover {
    border-color: var(--primary-color, #0084ff);
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 132, 255, 0.2);
}

.aica-channel-option:hover::before {
    opacity: 0.05;
}

.aica-channel-option:active {
    transform: translateY(-2px) scale(0.98);
}

.aica-channel-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
}

.aica-channel-option:hover .aica-channel-icon {
    transform: scale(1.1) rotate(5deg);
    background: linear-gradient(135deg, var(--primary-color, #0084ff) 0%, var(--primary-color-dark, #0066cc) 100%);
}

.aica-channel-icon .dashicons {
    font-size: 32px;
    width: 32px;
    height: 32px;
    color: #666;
    transition: color 0.3s ease;
}

.aica-channel-option:hover .aica-channel-icon .dashicons {
    color: #ffffff;
}

.aica-channel-option h4 {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    color: #333;
    position: relative;
    z-index: 1;
    letter-spacing: 0.2px;
}

/* ============================================
   CHAT MESSAGES - SMOOTH ANIMATIONS
   ============================================ */
.aica-chat-messages {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px;
    background: linear-gradient(to bottom, #fafafa 0%, #f5f5f5 100%);
    scroll-behavior: smooth;
    min-height: 0; /* Important for flex */
}

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

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

.aica-chat-messages::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 10px;
}

.aica-message {
    margin-bottom: 16px;
    display: flex;
    gap: 10px;
    animation: messageSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

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

.aica-message-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    background: linear-gradient(135deg, #e8e8e8 0%, #d0d0d0 100%);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.aica-message.assistant .aica-message-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.aica-message-content {
    max-width: 75%;
    padding: 13px 18px;
    border-radius: 20px;
    line-height: 1.5;
    font-size: 14px;
    background: #ffffff;
    color: #333;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    position: relative;
    word-wrap: break-word;
}

.aica-message.assistant .aica-message-content {
    border-bottom-left-radius: 4px;
}

.aica-message.user .aica-message-content {
    background: linear-gradient(135deg, var(--primary-color, #0084ff) 0%, var(--primary-color-dark, #0066cc) 100%);
    color: #ffffff;
    border-bottom-right-radius: 4px;
    box-shadow: 0 2px 12px rgba(0, 132, 255, 0.3);
}

/* ============================================
   TYPING INDICATOR - ANIMATED DOTS
   ============================================ */
.aica-typing {
    display: none;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
}

.aica-typing.active {
    display: flex;
    animation: messageSlideIn 0.4s ease-out;
}

.aica-typing-dots {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: #ffffff;
    border-radius: 20px;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.aica-typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #999;
    animation: typingBounce 1.4s ease-in-out infinite;
}

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

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

@keyframes typingBounce {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.7;
    }
    30% {
        transform: translateY(-8px);
        opacity: 1;
    }
}

/* ============================================
   INPUT AREA - FLOATING SEND BUTTON
   ============================================ */
.aica-chat-input-area {
    padding: 16px 20px;
    background: #ffffff;
    border-top: 1px solid #f0f0f0;
    display: flex;
    gap: 12px;
    align-items: flex-end;
    flex-shrink: 0; /* Never shrink */
    position: relative;
    z-index: 10;
}

#aica-message-input {
    flex: 1;
    padding: 12px 18px;
    border: 2px solid #f0f0f0;
    border-radius: 24px;
    font-size: 14px;
    font-family: inherit;
    resize: none;
    max-height: 120px;
    min-height: 44px;
    transition: all 0.3s ease;
    background: #fafafa;
    line-height: 1.4;
}

#aica-message-input:focus {
    outline: none;
    border-color: var(--primary-color, #0084ff);
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(0, 132, 255, 0.1);
}

#aica-send-button {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    border-radius: 50%;
    border: none;
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 132, 255, 0.3);
    padding: 0;
}

#aica-send-button:hover {
    transform: scale(1.1) rotate(15deg);
    box-shadow: 0 4px 16px rgba(0, 132, 255, 0.4);
}

#aica-send-button:active {
    transform: scale(0.95);
}

#aica-send-button svg {
    width: 20px;
    height: 20px;
    display: block;
}


/* ============================================
   MOBILE RESPONSIVE (CARD STYLE, NOT FULLSCREEN)
   ============================================ */
@media (max-width: 480px) {

    /* Respect iOS safe areas + keep floating button reachable */
    #aica-chat-container {
        bottom: calc(16px + env(safe-area-inset-bottom)) !important;
    }
    #aica-chat-container.aica-position-right { right: 16px !important; }
    #aica-chat-container.aica-position-left { left: 16px !important; }

    /* Chat window as a card with margins + rounded corners */
    #aica-chat-window {
        width: calc(100vw - 24px) !important;
        max-width: 420px !important;
        height: min(640px, calc(100dvh - 140px)) !important;
        max-height: calc(100dvh - 140px) !important;

        /* Keep above the floating bubble */
        bottom: calc(92px + env(safe-area-inset-bottom)) !important;

        /* Safe margins */
        left: 12px !important;
        right: 12px !important;

        border-radius: 22px !important;
        box-shadow: 0 14px 50px rgba(0, 0, 0, 0.25) !important;
    }

    /* Header sizing like your reference */
    .aica-chat-header {
        padding: 18px 16px !important;
    }

    .aica-avatar {
        width: 42px !important;
        height: 42px !important;
        animation: none !important; /* avoid jitter on mobile */
    }

    .aica-header-content h3 {
        font-size: 16px !important;
        line-height: 1.2 !important;
        max-width: 240px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .aica-header-content p {
        font-size: 12px !important;
        gap: 6px !important;
    }

    /* Back / Close buttons must stay circular (avoid theme styles) */
    .aica-close-button {
        width: 36px !important;
        height: 36px !important;
        min-width: 36px !important;
        min-height: 36px !important;
        border-radius: 999px !important;
        padding: 0 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    /* Content padding like the mock */
    .aica-step-content {
        padding: 22px 18px !important;
    }

    /* Single column channels on mobile */
    #aica-channels-list {
        grid-template-columns: 1fr !important;
    }

    /* Inputs spacing */
    .aica-form-group input {
        border-radius: 12px !important;
        padding: 12px 14px !important;
    }

    .aica-submit-button {
        border-radius: 12px !important;
        padding: 14px 16px !important;
    }
}

/* ============================================
   UTILITY ANIMATIONS
   ============================================ */
.aica-fade-in {
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.aica-slide-up {
    animation: slideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

/* ============================================
   SUCCESS/ERROR STATES
   ============================================ */
.aica-success-message,
.aica-error-message {
    padding: 12px 16px;
    border-radius: 12px;
    margin: 10px 0;
    animation: messageSlideIn 0.4s ease-out;
    font-size: 14px;
}

.aica-success-message {
    background: #e8f5e9;
    color: #2e7d32;
    border-left: 4px solid #4caf50;
}

.aica-error-message {
    background: #ffebee;
    color: #c62828;
    border-left: 4px solid #f44336;
}

/* ============================================
   HUMAN AGENT REQUEST BUTTON
   ============================================ */
.aica-human-agent-section {
    padding: 12px 20px;
    background: linear-gradient(to bottom, #ffffff 0%, #fafafa 100%);
    border-top: 1px solid #f0f0f0;
    border-bottom: 1px solid #f0f0f0;
}

.aica-request-human-button {
    width: 100%;
    padding: 12px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 12px;
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    position: relative;
    overflow: hidden;
}

.aica-request-human-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.aica-request-human-button:hover::before {
    width: 300px;
    height: 300px;
}

.aica-request-human-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.4);
}

.aica-request-human-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.aica-request-human-button .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

.aica-request-human-button .button-text {
    position: relative;
    z-index: 1;
}

/* Button states */
.aica-request-human-button.waiting {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    cursor: wait;
}

.aica-request-human-button.waiting .dashicons {
    animation: pulseIcon 1.5s ease-in-out infinite;
}

.aica-request-human-button.connected {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.aica-request-human-button.unavailable {
    background: linear-gradient(135deg, #9ca3af 0%, #6b7280 100%);
    cursor: not-allowed;
}

.aica-request-human-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

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

/* Hide button when with agent */
.aica-step-chat.with-agent .aica-human-agent-section {
    display: none;
}

/* Agent connected indicator */
.aica-agent-indicator {
    display: none;
    padding: 10px 20px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.aica-agent-indicator.active {
    display: block;
}

.aica-agent-indicator .dashicons {
    vertical-align: middle;
    margin-right: 5px;
}


/* FORCE WHITE HEADER TEXT (theme-proof) */
#aica-chat-window .aica-chat-header h3,
#aica-chat-window .aica-chat-header p {
    color: #ffffff !important;
}
