@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    /* Primary Colors */
    --aqai-color: <?php echo $color; ?>;
    --aqai-color-rgb: 0, 131, 176;
    --aqai-color-light: <?php echo $color; ?>15;
    --aqai-color-hover: <?php echo $color; ?>ee;
    
    /* Backgrounds */
    --aqai-bg: #ffffff;
    --aqai-bg-alt: #f8fafc;
    --aqai-bg-elevated: #ffffff;
    
    /* Text */
    --aqai-text: #0f172a;
    --aqai-text-muted: #64748b;
    --aqai-text-light: #94a3b8;
    
    /* Borders & Dividers */
    --aqai-border: #e2e8f0;
    --aqai-divider: #f1f5f9;
    
    /* Shadows - Layered for depth */
    --aqai-shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
    --aqai-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06), 0 1px 4px rgba(0, 0, 0, 0.04);
    --aqai-shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.06);
    --aqai-shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.12), 0 4px 16px rgba(0, 0, 0, 0.08);
    --aqai-shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.15), 0 8px 24px rgba(0, 0, 0, 0.1);
    --aqai-shadow-glow: 0 0 0 1px rgba(var(--aqai-color-rgb), 0.1), 0 8px 32px rgba(var(--aqai-color-rgb), 0.15);
    
    /* Radius */
    --aqai-radius: 20px;
    --aqai-radius-md: 16px;
    --aqai-radius-sm: 12px;
    --aqai-radius-xs: 8px;
    
    /* Transitions */
    --aqai-transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --aqai-transition-spring: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@media (prefers-color-scheme: dark) {
    :root {
        --aqai-bg: #0f172a;
        --aqai-bg-alt: #1e293b;
        --aqai-bg-elevated: #1e293b;
        --aqai-text: #f1f5f9;
        --aqai-text-muted: #94a3b8;
        --aqai-text-light: #64748b;
        --aqai-border: #334155;
        --aqai-divider: #1e293b;
        --aqai-shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.3);
        --aqai-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4), 0 1px 4px rgba(0, 0, 0, 0.3);
        --aqai-shadow-md: 0 4px 16px rgba(0, 0, 0, 0.5), 0 2px 8px rgba(0, 0, 0, 0.4);
        --aqai-shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.6), 0 4px 16px rgba(0, 0, 0, 0.5);
        --aqai-shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.7), 0 8px 24px rgba(0, 0, 0, 0.6);
    }
}

/* ============================================
   BUBBLE - Floating Action Button
   ============================================ */
#aqai-bubble {
    position: fixed;
    bottom: <?php echo $y; ?>px;
    <?php echo $pos_right ? 'right' : 'left'; ?>: <?php echo $x; ?>px;
    background: linear-gradient(135deg, var(--aqai-color) 0%, #00a7d6 100%);
    color: #fff;
    padding: 16px 28px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    z-index: 9999;
    box-shadow: var(--aqai-shadow-lg), 0 0 0 0 rgba(var(--aqai-color-rgb), 0.4);
    user-select: none;
    display: none;
    font-family: 'Inter', sans-serif;
    letter-spacing: -0.02em;
    transition: var(--aqai-transition-spring);
    animation: aqai-bubble-pulse 3s ease-in-out infinite;
}

@keyframes aqai-bubble-pulse {
    0%, 100% { box-shadow: var(--aqai-shadow-lg), 0 0 0 0 rgba(var(--aqai-color-rgb), 0.4); }
    50% { box-shadow: var(--aqai-shadow-lg), 0 0 0 8px rgba(var(--aqai-color-rgb), 0); }
}

#aqai-bubble:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 28px 80px rgba(var(--aqai-color-rgb), 0.35), 0 12px 32px rgba(0, 0, 0, 0.15);
    animation: none;
}

#aqai-bubble:active {
    transform: translateY(-2px) scale(1.02);
}

/* === AKTUÁLNY PRODUKT === */
.aqai-current-product {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px 6px 6px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: var(--aqai-radius-xs);
    margin-top: 6px;
    font-size: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.aqai-product-thumb {
    width: 36px;
    height: 36px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    flex-shrink: 0;
}

.aqai-product-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.aqai-product-label {
    color: rgba(255, 255, 255, 0.85);
    font-weight: 600;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.aqai-product-name {
    color: #fff;
    font-weight: 700;
    font-size: 12px;
    line-height: 1.3;
}
.aqai-current-product {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: var(--aqai-radius-xs);
    margin-top: 6px;
    font-size: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.aqai-product-label {
    color: rgba(255, 255, 255, 0.85);
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.aqai-product-name {
    color: #fff;
    font-weight: 700;
    font-size: 12.5px;
}

@media (max-width: 480px) {
    .aqai-current-product {
        flex-direction: column;
        align-items: flex-start;
        gap: 3px;
        padding: 8px 12px;
    }
}			

/* ============================================
   🎬 ULTRA-SMOOTH STREAMING ANIMATIONS
   ============================================ */

/* === TYPING INDICATOR (tri bodky) === */
.aqai-typing-container {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    margin-bottom: 14px;
    animation: aqai-fadein 0.3s ease;
}

.aqai-typing-dots {
    display: flex;
    gap: 6px;
    padding: 12px 18px;
    background: var(--aqai-bg);
    border: 1px solid var(--aqai-border);
    border-radius: var(--aqai-radius-md);
    box-shadow: var(--aqai-shadow-sm);
}

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

.aqai-typing-dots span:nth-child(1) {
    animation-delay: -0.32s;
}

.aqai-typing-dots span:nth-child(2) {
    animation-delay: -0.16s;
}

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

.aqai-typing-fadeout {
    animation: aqai-fadeout 0.2s ease forwards;
}

@keyframes aqai-fadeout {
    to {
        opacity: 0;
        transform: translateY(-8px);
    }
}

/* === BLIKAJÚCI KURZOR === */
.aqai-typing-cursor {
    display: inline-block;
    color: var(--aqai-color);
    font-weight: 700;
    margin-left: 2px;
    animation: aqai-cursor-blink 1s step-end infinite;
    line-height: 1;
    vertical-align: baseline;
}

@keyframes aqai-cursor-blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* === STREAMING STATE === */
.aqai-msg.aqai-streaming {
    position: relative;
    overflow: hidden;
}

.aqai-msg.aqai-streaming::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(var(--aqai-color-rgb), 0.08) 50%,
        transparent 100%
    );
    animation: aqai-shimmer 2s infinite;
    pointer-events: none;
}

@keyframes aqai-shimmer {
    0% { left: -100%; }
    100% { left: 200%; }
}

/* === WORD HIGHLIGHT (nové slová majú glow) === */
.aqai-msg.aqai-streaming .aqai-highlight,
.aqai-msg.aqai-streaming strong {
    animation: aqai-word-glow 0.6s ease-out;
}

@keyframes aqai-word-glow {
    0% {
        text-shadow: 0 0 8px rgba(var(--aqai-color-rgb), 0.6);
        transform: scale(1.02);
    }
    100% {
        text-shadow: none;
        transform: scale(1);
    }
}

/* === PULSE EFEKT NA BUBBLE POČAS STREAMINGU === */
#aqai-bubble.aqai-streaming {
    animation: aqai-bubble-stream-pulse 1.5s ease-in-out infinite;
}

@keyframes aqai-bubble-stream-pulse {
    0%, 100% {
        box-shadow: var(--aqai-shadow-lg), 0 0 0 0 rgba(var(--aqai-color-rgb), 0.4);
    }
    50% {
        box-shadow: var(--aqai-shadow-lg), 0 0 0 12px rgba(var(--aqai-color-rgb), 0);
        transform: translateY(-4px) scale(1.02);
    }
}

/* === SMOOTH SCROLL INDICATOR === */
#aqai-messages {
    scroll-behavior: smooth;
}

#aqai-messages.aqai-scrolling {
    scroll-behavior: auto;
}

/* === PERFORMANCE OPTIMIZATION === */
.aqai-typing-cursor,
.aqai-typing-dots span,
.aqai-msg.aqai-streaming::after {
    will-change: opacity, transform;
}

/* === BULLET STYLING (vylepšené) === */
.aqai-bullet {
    padding: 10px 0;
    margin: 6px 0;
    border-left: 3px solid var(--aqai-color);
    padding-left: 14px;
    transition: var(--aqai-transition);
}

.aqai-bullet:hover {
    border-left-color: var(--aqai-color-hover);
    padding-left: 18px;
    background: var(--aqai-color-light);
    margin-left: -4px;
    padding-right: 8px;
    border-radius: 0 var(--aqai-radius-xs) var(--aqai-radius-xs) 0;
}

/* === RESPONSIVE === */
@media (max-width: 480px) {
    .aqai-typing-dots {
        padding: 10px 14px;
    }
    
    .aqai-typing-dots span {
        width: 7px;
        height: 7px;
    }
}			
			
/* ============================================
   WIDGET BOX - Main Container
   ============================================ */
#aqai-box {
    position: fixed;
    bottom: <?php echo ($y + 68); ?>px;
    <?php echo $pos_right ? 'right' : 'left'; ?>: <?php echo $x; ?>px;
    width: min(440px, calc(100vw - 40px));
    height: min(700px, calc(100vh - 120px));
    display: none;
    flex-direction: column;
    background: var(--aqai-bg-elevated);
    color: var(--aqai-text);
    border-radius: var(--aqai-radius);
    overflow: hidden;
    z-index: 9998;
    border: 1px solid var(--aqai-border);
    box-shadow: var(--aqai-shadow-xl);
    font-family: 'Inter', sans-serif;
    transition: var(--aqai-transition-spring);
    transform: translateY(24px) scale(0.94);
    opacity: 0;
    backdrop-filter: blur(20px);
}

#aqai-box.aqai-open {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* ============================================
   HEADER - Gradient Top Bar
   ============================================ */
#aqai-head {
    background: linear-gradient(135deg, var(--aqai-color) 0%, #00a7d6 100%);
    color: #fff;
    padding: 18px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
    position: relative;
    z-index: 10;
}

#aqai-head::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.1) 0%, transparent 100%);
    pointer-events: none;
}

#aqai-head::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
}

#aqai-title h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 800;
    letter-spacing: -0.03em;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

#aqai-head-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

#aqai-close,
#aqai-clear,
#aqai-export {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: var(--aqai-radius-xs);
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--aqai-transition);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

#aqai-close:hover,
#aqai-clear:hover,
#aqai-export:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

#aqai-close:active,
#aqai-clear:active,
#aqai-export:active {
    transform: scale(0.95);
}

/* ============================================
   BODY - Messages Container
   ============================================ */
#aqai-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--aqai-bg-alt);
    position: relative;
    overflow: hidden; /* ← PRIDANÉ */
}

#aqai-body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 20px;
    background: linear-gradient(180deg, var(--aqai-bg-alt), transparent);
    pointer-events: none;
    z-index: 1;
}

/* ============================================
   MESSAGES - Chat Area
   ============================================ */
#aqai-messages {
    flex: 1 1 auto;
    max-height: 520px;
    padding: 24px 18px 16px;
    overflow-y: auto;
    scroll-behavior: smooth;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
}

#aqai-messages::-webkit-scrollbar {
    width: 6px;
}

#aqai-messages::-webkit-scrollbar-track {
    background: transparent;
    margin: 8px 0;
}

#aqai-messages::-webkit-scrollbar-thumb {
    background: var(--aqai-border);
    border-radius: 999px;
    transition: var(--aqai-transition);
}

#aqai-messages::-webkit-scrollbar-thumb:hover {
    background: var(--aqai-text-muted);
}

/* ============================================
   MESSAGE BUBBLES
   ============================================ */
.aqai-msg {
    max-width: 85%;
    padding: 14px 18px;
    border-radius: var(--aqai-radius-md);
    line-height: 1.6;
    font-size: 14px;
    white-space: pre-wrap;
    word-wrap: break-word;
    position: relative;
    margin-bottom: 14px;
    animation: aqai-fadein 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    transition: var(--aqai-transition);
}

@keyframes aqai-fadein {
    0% {
        opacity: 0;
        transform: translateY(12px) scale(0.96);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.aqai-user {
    align-self: flex-end;
    background: linear-gradient(135deg, var(--aqai-color) 0%, #00a7d6 100%);
    color: #fff;
    border-bottom-right-radius: 6px;
    box-shadow: var(--aqai-shadow-md), 0 0 0 0 rgba(var(--aqai-color-rgb), 0.3);
    font-weight: 500;
}

.aqai-user:hover {
    transform: translateX(-2px);
    box-shadow: var(--aqai-shadow-lg), 0 0 0 4px rgba(var(--aqai-color-rgb), 0.15);
}

.aqai-bot {
    align-self: flex-start;
    background: var(--aqai-bg);
    border: 1px solid var(--aqai-border);
    border-bottom-left-radius: 6px;
    box-shadow: var(--aqai-shadow-sm);
}

.aqai-bot:hover {
    transform: translateX(2px);
    box-shadow: var(--aqai-shadow-md);
    border-color: var(--aqai-color);
}

.aqai-copy {
    display: none;
    position: absolute;
    top: 10px;
    right: 10px;
    border: 0;
    background: rgba(0, 0, 0, 0.08);
    backdrop-filter: blur(8px);
    cursor: pointer;
    font-size: 14px;
    padding: 6px 10px;
    border-radius: var(--aqai-radius-xs);
    opacity: 0;
    transition: var(--aqai-transition);
    box-shadow: var(--aqai-shadow-xs);
}

.aqai-copy:hover {
    opacity: 1 !important;
    background: rgba(0, 0, 0, 0.15);
    transform: scale(1.08);
}

.aqai-msg:hover .aqai-copy {
    display: inline-block;
    opacity: 0.85;
}

/* ============================================
   PRODUCT CARD
   ============================================ */
.aqai-card {
    border: 1px solid var(--aqai-border);
    background: var(--aqai-bg);
    padding: 14px;
    border-radius: var(--aqai-radius-sm);
    font-size: 13px;
    margin-top: 10px;
    box-shadow: var(--aqai-shadow-sm);
    transition: var(--aqai-transition);
}

.aqai-card:hover {
    box-shadow: var(--aqai-shadow-md);
    border-color: var(--aqai-color);
    transform: translateY(-2px);
}

.aqai-card img {
    width: 52px;
    height: 52px;
    object-fit: cover;
    border-radius: var(--aqai-radius-xs);
    vertical-align: middle;
    margin-right: 12px;
    border: 1px solid var(--aqai-border);
    transition: var(--aqai-transition);
}

.aqai-card:hover img {
    transform: scale(1.05);
    box-shadow: var(--aqai-shadow-sm);
}

.aqai-card a {
    color: var(--aqai-color);
    text-decoration: none;
    font-weight: 600;
    transition: var(--aqai-transition);
    border-bottom: 2px solid transparent;
}

.aqai-card a:hover {
    border-bottom-color: var(--aqai-color);
    opacity: 0.8;
}

/* === NÁVRHY (CHIPS) - HORIZONTÁLNY SCROLL === */
#aqai-suggestions {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    padding: 14px 18px;
    border-top: 1px solid var(--aqai-divider);
    background: var(--aqai-bg);
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--aqai-border) transparent;
    position: relative;
    flex-shrink: 0; /* ← Nezmenší sa */
    order: 1; /* ← PRIDANÉ - poradie */
}

/* Gradient fade */
#aqai-suggestions::before,
#aqai-suggestions::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 20px;
    pointer-events: none;
    z-index: 1;
}

#aqai-suggestions::before {
    left: 0;
    background: linear-gradient(90deg, var(--aqai-bg), transparent);
}

#aqai-suggestions::after {
    right: 0;
    background: linear-gradient(270deg, var(--aqai-bg), transparent);
}

#aqai-suggestions::-webkit-scrollbar {
    height: 4px;
}

#aqai-suggestions::-webkit-scrollbar-track {
    background: transparent;
}

#aqai-suggestions::-webkit-scrollbar-thumb {
    background: var(--aqai-border);
    border-radius: 999px;
}

#aqai-suggestions::-webkit-scrollbar-thumb:hover {
    background: var(--aqai-text-muted);
}

.aqai-chip {
    background: var(--aqai-color-light);
    border: 1.5px solid var(--aqai-color);
    border-radius: 999px;
    padding: 9px 16px;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--aqai-transition-spring);
    color: var(--aqai-color);
    box-shadow: var(--aqai-shadow-xs);
    white-space: nowrap;
    flex-shrink: 0;
}

.aqai-chip:hover {
    background: var(--aqai-color);
    color: #fff;
    transform: translateY(-2px) scale(1.03);
    box-shadow: var(--aqai-shadow-md);
}

.aqai-chip:active {
    transform: translateY(0) scale(0.98);
}

/* === SÚHLAS === */
#aqai-consent {
    padding: 12px 18px;
    border-top: 1px solid var(--aqai-divider);
    font-size: 11.5px;
    color: var(--aqai-text-muted);
    display: none;
    background: var(--aqai-bg);
    line-height: 1.5;
    flex-shrink: 0; /* ← PRIDANÉ */
    order: 2; /* ← PRIDANÉ */
}

/* === VSTUPNÉ POLE === */
#aqai-inputwrap {
    flex: 0 0 auto;
    display: flex;
    gap: 10px;
    align-items: flex-end;
    border-top: 1px solid var(--aqai-divider);
    padding: 16px 18px;
    background: var(--aqai-bg);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.04);
    order: 3; /* ← PRIDANÉ - poradie */
}
/* ============================================
   CONSENT ROW
   ============================================ */
#aqai-consent {
    padding: 12px 18px;
    border-top: 1px solid var(--aqai-divider);
    font-size: 11.5px;
    color: var(--aqai-text-muted);
    display: none;
    background: var(--aqai-bg);
    line-height: 1.5;
}

#aqai-consent label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

#aqai-consent input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--aqai-color);
}

/* ============================================
   INPUT AREA
   ============================================ */
#aqai-inputwrap {
    flex: 0 0 auto;
    position: sticky;
    bottom: 0;
    display: flex;
    gap: 10px;
    align-items: flex-end;
    border-top: 1px solid var(--aqai-divider);
    padding: 16px 18px;
    background: var(--aqai-bg);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.04);
}

#aqai-input {
    flex: 1;
    border: 2px solid var(--aqai-border);
    border-radius: var(--aqai-radius-sm);
    font-size: 14px;
    resize: none;
    max-height: 140px;
    line-height: 1.5;
    background: var(--aqai-bg-alt);
    color: var(--aqai-text);
    font-family: 'Inter', sans-serif;
    transition: var(--aqai-transition);
    font-weight: 500;
}

#aqai-input::placeholder {
    color: var(--aqai-text-light);
    font-weight: 400;
}

#aqai-input:focus {
    outline: none;
    border-color: var(--aqai-color);
    box-shadow: var(--aqai-shadow-glow);
    background: var(--aqai-bg);
}

#aqai-send {
    background: linear-gradient(135deg, var(--aqai-color) 0%, #00a7d6 100%);
    color: #fff;
    border: 0;
    padding: 13px 20px;
    border-radius: var(--aqai-radius-sm);
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--aqai-transition-spring);
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    box-shadow: var(--aqai-shadow-md);
    letter-spacing: -0.01em;
}

#aqai-send:hover:not([disabled]) {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 12px 32px rgba(var(--aqai-color-rgb), 0.35), var(--aqai-shadow-lg);
}

#aqai-send:active:not([disabled]) {
    transform: translateY(-1px) scale(0.99);
}

#aqai-send[disabled] {
    opacity: 0.75;
    cursor: not-allowed;
    filter: saturate(0.8);
}

/* ============================================
   SPINNER - Loading Animation
   ============================================ */
.aqai-spinner {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2.5px solid rgba(255, 255, 255, 0.25);
    border-top-color: #fff;
    animation: aqai-spin 0.7s linear infinite;
}

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

/* ============================================
   MARKDOWN STYLES
   ============================================ */
.aqai-markdown ul {
    margin: 10px 0 10px 22px;
    padding: 0;
}

.aqai-markdown li {
    list-style: disc;
    margin: 5px 0;
}

.aqai-markdown strong {
    font-weight: 700;
    color: var(--aqai-color);
}

.aqai-markdown a {
    color: var(--aqai-color);
    text-decoration: none;
    border-bottom: 1.5px solid var(--aqai-color);
    transition: var(--aqai-transition);
    font-weight: 600;
}

.aqai-markdown a:hover {
    opacity: 0.75;
    border-bottom-width: 2px;
}

.aqai-markdown h3 {
    font-size: 15px;
    font-weight: 700;
    margin: 12px 0 8px;
    color: var(--aqai-text);
}

/* ============================================
   SCROLL TO BOTTOM BUTTON
   ============================================ */
#aqai-bottomfab {
    position: sticky;
    bottom: 14px;
    align-self: flex-end;
    margin-right: 14px;
    z-index: 2;
    display: none;
    animation: aqai-fadein 0.3s ease;
}

#aqai-bottomfab button {
    border: 0;
    background: var(--aqai-bg);
    border: 1px solid var(--aqai-border);
    border-radius: 999px;
    padding: 10px 18px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: var(--aqai-shadow-md);
    color: var(--aqai-text);
    transition: var(--aqai-transition-spring);
    font-family: 'Inter', sans-serif;
    backdrop-filter: blur(12px);
}

#aqai-bottomfab button:hover {
    background: var(--aqai-color);
    color: #fff;
    transform: translateY(-3px) scale(1.05);
    box-shadow: var(--aqai-shadow-lg);
}

#aqai-bottomfab button:active {
    transform: translateY(-1px) scale(1);
}

/* ============================================
   RESPONSIVE - Mobile Optimization
   ============================================ */
@media (max-width: 480px) {
    #aqai-box {
        width: calc(100vw - 20px);
        height: calc(100vh - 100px);
        bottom: 10px;
        <?php echo $pos_right ? 'right' : 'left'; ?>: 10px;
        border-radius: var(--aqai-radius-md);
    }
    
    #aqai-bubble {
        bottom: 20px;
        <?php echo $pos_right ? 'right' : 'left'; ?>: 20px;
        padding: 14px 22px;
        font-size: 14px;
    }
    
    .aqai-msg {
        max-width: 90%;
        font-size: 13.5px;
        padding: 12px 16px;
    }
    
    #aqai-head {
        padding: 16px 18px;
    }
    
    #aqai-title h3 {
        font-size: 15px;
    }
    
    #aqai-messages {
        padding: 20px 14px 12px;
    }
    
    #aqai-inputwrap {
        padding: 14px 16px;
    }
}

/* ============================================
   ACCESSIBILITY & FOCUS STATES
   ============================================ */
*:focus-visible {
    outline: 2px solid var(--aqai-color);
    outline-offset: 2px;
}

button:focus-visible {
    outline-offset: 3px;
}

/* ============================================
   PERFORMANCE OPTIMIZATIONS
   ============================================ */
#aqai-box,
#aqai-bubble,
.aqai-msg,
.aqai-chip {
    will-change: transform;
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
        </style>
