/* ============================================================
   AI CHAT — Pufakcha stillari
   components.css yoki style.css ga qo'shing
   ============================================================ */

/* Foydalanuvchi pufakchasi */
.ai-chat-bubble--user {
    align-self: flex-end;
    max-width: 80%;
    background: var(--accent-gradient);
    color: #fff;
    border-radius: 16px 16px 4px 16px;
    padding: 10px 14px;
    font-size: 13px;
    line-height: 1.5;
    word-break: break-word;
}

/* AI pufakchasi */
.ai-chat-bubble--ai {
    align-self: flex-start;
    max-width: 88%;
    background: var(--comp-period-bg, rgba(0,242,255,0.08));
    border: 1px solid var(--border);
    border-radius: 16px 16px 16px 4px;
    padding: 10px 14px;
    font-size: 13px;
    line-height: 1.6;
    color: var(--text);
    word-break: break-word;
}

/* Kirish animatsiyasi */
.ai-chat-bubble--in {
    animation: aiBubbleIn 0.25s ease-out;
}

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

/* Xato pufakchasi */
.ai-chat-bubble--error {
    align-self: flex-start;
    max-width: 88%;
    background: rgba(255, 42, 42, 0.10);
    border: 1px solid rgba(255, 42, 42, 0.30);
    border-radius: 12px;
    padding: 8px 14px;
    font-size: 12px;
    color: var(--red-neon, #ff4444);
}

/* Fikrlash animatsiyasi (3 nuqta) */
.ai-chat-bubble--thinking {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 12px 16px;
}

.ai-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--cyan-neon, #00f2ff);
    animation: aiDotBounce 1.2s infinite ease-in-out;
}

.ai-dot:nth-child(2) { animation-delay: 0.2s; }
.ai-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes aiDotBounce {
    0%, 80%, 100% { transform: scale(0.7); opacity: 0.5; }
    40%            { transform: scale(1.1); opacity: 1; }
}

/* Kod bloklar */
.ai-code {
    background: rgba(0,0,0,0.25);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
    overflow-x: auto;
    margin: 6px 0;
    white-space: pre;
    font-family: monospace;
}

.ai-inline-code {
    background: rgba(0,0,0,0.2);
    border-radius: 4px;
    padding: 1px 5px;
    font-size: 12px;
    font-family: monospace;
}

/* Input focus */
#aiChatInput:focus {
    border-color: var(--cyan-neon) !important;
    box-shadow: 0 0 0 2px rgba(0, 242, 255, 0.15);
}

/* Send btn hover */
#aiChatSendBtn:hover:not(:disabled) {
    opacity: 0.85;
    transform: scale(1.05);
    transition: all 0.15s;
}

#aiChatSendBtn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
