/* ===== AI CHATBOT ASSISTANT — FROSTED GLASS THEME ===== */

#ai-bubble {
    position: fixed;
    right: 24px;
    bottom: 24px;
    width: 340px;
    z-index: 999999;
    font-family: -apple-system, 'SF Pro Display', 'Segoe UI', Arial, sans-serif;
    background: rgba(180, 220, 228, 0.22);
    backdrop-filter: blur(40px) saturate(200%) brightness(1.1);
    -webkit-backdrop-filter: blur(40px) saturate(200%) brightness(1.1);
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 24px;
    box-shadow:
        0 2px 0 rgba(255,255,255,0.6) inset,
        0 -1px 0 rgba(0,0,0,0.08) inset,
        0 20px 60px rgba(0,0,0,0.22),
        0 4px 16px rgba(0,0,0,0.12);
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== HEADER ===== */
#ai-header {
    background: rgba(6, 149, 169, 0.38);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    color: #ffffff;
    padding: 13px 16px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.2px;
    display: flex;
    align-items: center;
    gap: 7px;
    border-bottom: 1px solid rgba(255,255,255,0.2);
    user-select: none;
    cursor: pointer;
    text-shadow: 0 1px 8px rgba(0,0,0,0.2);
}

#ai-header-icon {
    font-size: 10px;
    animation: ai-pulse 2s ease-in-out infinite;
}

#ai-header-title { flex: 1; }



/* ===== CONTENT PANEL ===== */
#ai-content {
    display: flex;
    flex-direction: column;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

#ai-bubble.ai-expanded #ai-content {
    max-height: 520px;
}

/* ===== MESSAGES AREA ===== */
#ai-messages {
    flex: 1;
    overflow-y: auto;
    padding: 14px 14px 6px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 270px;
}

#ai-messages::-webkit-scrollbar { width: 3px; }
#ai-messages::-webkit-scrollbar-track { background: transparent; }
#ai-messages::-webkit-scrollbar-thumb {
    background: rgba(6,149,169,0.3);
    border-radius: 3px;
}

/* ===== MESSAGE BUBBLES ===== */
.ai-msg {
    display: flex;
    animation: ai-slide-in 0.25s ease;
}
.ai-msg--user { justify-content: flex-end; }
.ai-msg--bot  { justify-content: flex-start; }

.ai-msg-bubble {
    max-width: 85%;
    padding: 9px 13px;
    border-radius: 16px;
    font-size: 13px;
    line-height: 1.6;
    word-break: break-word;
    white-space: pre-line;
}

.ai-msg--user .ai-msg-bubble {
    background: rgba(6,149,169,0.85);
    color: #ffffff;
    border-bottom-right-radius: 4px;
}

.ai-msg--bot .ai-msg-bubble {
    background: rgba(255,255,255,0.7);
    color: #0a3a42;
    border-bottom-left-radius: 4px;
    border: 1px solid rgba(6,149,169,0.15);
}

.ai-msg--bot .ai-msg-bubble b {
    color: #0695a9;
    display: block;
    margin-bottom: 4px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ===== TYPING INDICATOR ===== */
.ai-msg--typing .ai-msg-bubble {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 12px 16px;
}

.ai-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(6,149,169,0.6);
    animation: ai-bounce 1.2s ease-in-out infinite;
}
.ai-dot:nth-child(2) { animation-delay: 0.2s; }
.ai-dot:nth-child(3) { animation-delay: 0.4s; }

/* ===== FAQ CHIPS ===== */
#ai-faqs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 14px 10px;
    border-top: 1px solid rgba(6,149,169,0.1);
}

.ai-faq-chip {
    background: rgba(6,149,169,0.08);
    border: 1px solid rgba(6,149,169,0.28);
    border-radius: 20px;
    color: #0695a9;
    font-size: 11.5px;
    font-weight: 500;
    padding: 5px 11px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    line-height: 1.3;
}

.ai-faq-chip:hover {
    background: rgba(6,149,169,0.18);
    border-color: rgba(6,149,169,0.5);
    transform: translateY(-1px);
}

/* ===== INPUT ROW ===== */
#ai-input-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px 13px;
    border-top: 1px solid rgba(6,149,169,0.12);
}

#ai-input {
    flex: 1;
    border: 1px solid rgba(6,149,169,0.3);
    border-radius: 20px;
    padding: 8px 14px;
    font-size: 13px;
    font-family: inherit;
    background: rgba(255,255,255,0.75);
    color: #0a3a42;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

#ai-input::placeholder { color: rgba(10,58,66,0.4); }

#ai-input:focus {
    border-color: rgba(6,149,169,0.6);
    box-shadow: 0 0 0 3px rgba(6,149,169,0.12);
    background: rgba(255,255,255,0.9);
}

#ai-send {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(6,149,169,0.85);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.2s, transform 0.15s;
}

#ai-send:hover { background: #0695a9; transform: scale(1.08); }
#ai-send:active { transform: scale(0.95); }

/* ===== TOGGLE BUTTON ===== */
#ai-toggle {
    cursor: pointer;
    font-size: 22px;
    line-height: 1;
    opacity: 0.85;
    user-select: none;
    color: #fff;
    transition: opacity 0.2s, transform 0.2s;
    width: 22px;
    text-align: center;
}
#ai-toggle:hover { opacity: 1; transform: scale(1.2); }

/* ===== ANIMATIONS ===== */
@keyframes ai-pulse {
    0%, 100% { opacity: 1;   transform: scale(1);   }
    50%       { opacity: 0.4; transform: scale(0.7); }
}
@keyframes ai-bounce {
    0%, 60%, 100% { transform: translateY(0); }
    30%           { transform: translateY(-5px); }
}
@keyframes ai-slide-in {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}