/* ============================================================
   AbuAmra Chatbot – Centered Search-Engine Layout
   ============================================================ */

/* ============ CONTAINER ============ */
.acb-container {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 700px;
    margin: 0 auto;
    animation: acbFadeUp 0.8s ease-out 0.7s both;
}

@keyframes acbFadeUp {
    from { opacity: 0; transform: translateY(25px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ============ SEARCH BAR ============ */
.acb-search-bar {
    background: #12122a;
    border: 1.5px solid rgba(0,240,255,0.25);
    border-radius: 28px;
    padding: 6px 6px 6px 20px;
    transition: border-color 0.3s, box-shadow 0.3s;
    box-shadow: 0 4px 30px rgba(0,0,0,0.4);
}

.acb-search-bar:focus-within {
    border-color: #00f0ff;
    box-shadow: 0 0 30px rgba(0,240,255,0.15), 0 4px 30px rgba(0,0,0,0.4);
}

.acb-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #fff;
    font-size: 16px;
    font-family: inherit;
    padding: 12px 0;
    min-width: 0;
}

.acb-input::placeholder { color: #555a70; }

.acb-send-btn {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #00f0ff, #b400ff);
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s;
    flex-shrink: 0;
}

.acb-send-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 0 22px rgba(0,240,255,0.4);
}

.acb-send-btn:active { transform: scale(0.95); }

/* ============ SUGGESTION CHIPS ============ */
.acb-chips {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-top: 22px;
    transition: opacity 0.4s, transform 0.4s;
}

.acb-chips.hidden {
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
    position: absolute;
    visibility: hidden;
}

.acb-chip {
    padding: 10px 20px;
    border-radius: 50px;
    border: 1px solid rgba(0,240,255,0.2);
    background: rgba(18,18,42,0.8);
    color: #a0a0c0;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-family: inherit;
    white-space: nowrap;
    backdrop-filter: blur(6px);
}

.acb-chip:hover {
    background: rgba(0,240,255,0.1);
    border-color: #00f0ff;
    color: #00f0ff;
    box-shadow: 0 0 16px rgba(0,240,255,0.15);
    transform: translateY(-2px);
}

/* ============ MESSAGES AREA ============ */
.acb-messages {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease, padding 0.5s ease, margin 0.5s ease;
    display: flex;
    flex-direction: column;
    gap: 12px;
    scrollbar-width: thin;
    scrollbar-color: #333 transparent;
}

.acb-messages::-webkit-scrollbar { width: 4px; }
.acb-messages::-webkit-scrollbar-thumb { background: #333; border-radius: 2px; }

.acb-messages.active {
    max-height: 380px;
    overflow-y: auto;
    padding: 8px 4px 16px;
    margin-bottom: 16px;
}

/* ============ MESSAGE BUBBLES ============ */
.acb-msg {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    animation: acbMsgPop 0.35s ease-out;
    max-width: 92%;
}

@keyframes acbMsgPop {
    from { opacity: 0; transform: translateY(14px) scale(0.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.acb-msg-user {
    flex-direction: row-reverse;
    align-self: flex-end;
}

.acb-msg-bot { align-self: flex-start; }

.acb-msg-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00f0ff, #b400ff);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
    box-shadow: 0 0 10px rgba(0,240,255,0.2);
}

.acb-bubble {
    padding: 12px 18px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.55;
    word-wrap: break-word;
}

.acb-msg-user .acb-bubble {
    background: linear-gradient(135deg, #00f0ff, #b400ff);
    color: #fff;
    border-bottom-right-radius: 6px;
    box-shadow: 0 2px 14px rgba(0,240,255,0.2);
}

.acb-msg-bot .acb-bubble {
    background: #1a1a2e;
    color: #dde;
    border: 1px solid rgba(0,240,255,0.12);
    border-bottom-left-radius: 6px;
}

.acb-msg-bot .acb-bubble.glow {
    animation: acbGlowIn 0.6s ease-out;
}

@keyframes acbGlowIn {
    0%   { box-shadow: 0 0 18px rgba(0,240,255,0.35); }
    100% { box-shadow: none; }
}

/* ============ TYPING INDICATOR ============ */
.acb-typing .acb-bubble {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 14px 22px;
}

.acb-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #00f0ff;
    animation: acbBounce 1.4s ease-in-out infinite;
}

.acb-dot:nth-child(2) { animation-delay: 0.15s; background: #b400ff; }
.acb-dot:nth-child(3) { animation-delay: 0.3s;  background: #00ff88; }

@keyframes acbBounce {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-9px); }
}

/* ============ FIREWORKS CANVAS ============ */
#acb-fireworks {
    position: fixed;
    inset: 0;
    z-index: 99999;
    pointer-events: none;
    display: none;
}

#acb-fireworks.active { display: block; }

/* ============ GHOST AVATAR ============ */
.acb-ghost {
    position: absolute;
    left: 50%;
    bottom: 60px;
    transform: translateX(-50%) translateY(40px) scale(0.3);
    opacity: 0;
    pointer-events: none;
    z-index: 50;
    transition: none;
}

.acb-ghost img {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(0,240,255,0.5);
    box-shadow:
        0 0 30px rgba(0,240,255,0.35),
        0 0 60px rgba(180,0,255,0.2);
    filter: brightness(1.1);
}

.acb-ghost.active {
    animation: ghostRise 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.acb-ghost.active.fade {
    animation: ghostFade 0.8s ease-in forwards;
}

@keyframes ghostRise {
    0% {
        opacity: 0;
        transform: translateX(-50%) translateY(40px) scale(0.3);
        filter: blur(8px);
    }
    50% {
        opacity: 1;
        filter: blur(0);
    }
    100% {
        opacity: 1;
        transform: translateX(-50%) translateY(-20px) scale(1);
        filter: blur(0);
    }
}

@keyframes ghostFade {
    0% {
        opacity: 1;
        transform: translateX(-50%) translateY(-20px) scale(1);
        filter: blur(0);
    }
    100% {
        opacity: 0;
        transform: translateX(-50%) translateY(-60px) scale(0.8);
        filter: blur(6px);
    }
}

.acb-ghost.active img {
    animation: ghostPulse 0.6s ease-in-out 0.3s 2;
}

@keyframes ghostPulse {
    0%, 100% { box-shadow: 0 0 30px rgba(0,240,255,0.35), 0 0 60px rgba(180,0,255,0.2); }
    50% { box-shadow: 0 0 50px rgba(0,240,255,0.6), 0 0 90px rgba(180,0,255,0.4); }
}

/* ============ INPUT ROW (wraps input + mic + send) ============ */
.acb-input-row {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
}

/* ============ MIC BUTTON ============ */
.acb-mic-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1.5px solid rgba(0,240,255,0.2);
    background: rgba(26,26,46,0.5);
    color: #a0a0c0;
    font-size: 19px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.3s;
}

.acb-mic-btn:hover {
    background: rgba(0,240,255,0.08);
    border-color: rgba(0,240,255,0.4);
    color: #00f0ff;
    box-shadow: 0 0 14px rgba(0,240,255,0.15);
}

.acb-mic-btn.listening {
    background: rgba(255,0,60,0.15);
    border-color: #ff003c;
    color: #ff003c;
    box-shadow: 0 0 20px rgba(255,0,60,0.3), 0 0 40px rgba(255,0,60,0.1);
    animation: micPulse 1s ease-in-out infinite;
}

@keyframes micPulse {
    0%, 100% {
        box-shadow: 0 0 20px rgba(255,0,60,0.3), 0 0 40px rgba(255,0,60,0.1);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 30px rgba(255,0,60,0.5), 0 0 60px rgba(255,0,60,0.2);
        transform: scale(1.08);
    }
}

/* ============ TTS MUTE BUTTON ============ */
.acb-tts-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid rgba(0,240,255,0.25);
    background: rgba(26,26,46,0.6);
    color: var(--neon-cyan);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.3s;
}

.acb-tts-btn:hover {
    background: rgba(0,240,255,0.12);
    border-color: var(--neon-cyan);
    box-shadow: 0 0 12px rgba(0,240,255,0.25);
}

.acb-tts-btn.muted {
    color: #666;
    border-color: rgba(255,255,255,0.08);
    opacity: 0.6;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 768px) {
    .acb-container { max-width: 95%; }
    .acb-messages.active { max-height: 300px; }
    .acb-chip { font-size: 12px; padding: 8px 14px; }
    .acb-input { font-size: 15px; }
}

@media (max-width: 480px) {
    .acb-search-bar { padding: 4px 4px 4px 12px; border-radius: 22px; }
    .acb-send-btn { width: 40px; height: 40px; font-size: 17px; }
    .acb-mic-btn  { width: 36px; height: 36px; font-size: 16px; }
    .acb-tts-btn  { width: 34px; height: 34px; font-size: 15px; }
    .acb-input-row { gap: 4px; }
    .acb-chips { gap: 8px; }
    .acb-chip { font-size: 11px; padding: 7px 12px; }
}
