/* =========================================
   1. STAGE WRAPPER (SCENA)
   ========================================= */
.bp-handoff-stage {
    position: relative;
    width: 100%;
    min-height: 100px;
    overflow: hidden; /* Să nu iasă animațiile */
}

/* =========================================
   2. ROBOT VOCE (ID: bp-handoff-robo)
   ========================================= */
.bp-handoff-robo {
    opacity: 1;
    visibility: visible;
    transition: all 0.5s ease;
    position: relative;
    z-index: 20;
}

/* Când JS pune clasa .is-hide, robotul dispare în sus */
.bp-handoff-robo.is-hide {
    opacity: 0;
    visibility: hidden;
    height: 0;
    margin: 0;
    transform: translateY(-30px);
    pointer-events: none;
}

/* =========================================
   3. CHAT WIDGET (ID: bp-handoff-chat)
   ========================================= */

/* --- A. STARE DEFAULT (Vizibil oriunde altundeva) --- */
.bp-handoff-chat {
    display: block; /* Vizibil by default */
    opacity: 1;
    visibility: visible;
    
    /* Design General Chat */
    position: relative;
    z-index: 999;
    font-family: 'Courier New', Courier, monospace;
    width: 95%;
    max-width: 800px;
    margin: 20px auto;
    transition: opacity 0.5s ease, transform 0.5s ease;
}

/* --- B. STARE ASCUNSĂ (Doar în Stage, controlat de PHP) --- */
/* Asta se aplică pentru că în stage-ui.php ai pus clasa 'is-hidden' */
.bp-handoff-chat.is-hidden {
    display: none !important; /* FORȚĂM ASCUNDEREA */
    opacity: 0 !important;
    visibility: hidden !important;
    transform: translateY(30px);
}

/* --- C. STARE TRANZIȚIE (Afișat de JS) --- */
/* Când voice.js adaugă clasa 'is-show', aceasta suprascrie 'is-hidden' */
.bp-handoff-chat.is-show {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
}

/* =========================================
   4. DESIGN INTERIOR CHAT (Reparații text tăiat)
   ========================================= */
.bp-ai-robot-container { position: relative; width: 100%; }
.bp-ai-robot-bg { width: 100%; height: auto; display: block; pointer-events: none; }

.bp-ai-visor-screen {
    position: absolute;
    z-index: 50;
    background: rgba(0, 0, 0, 0.85);
    box-shadow: inset 0 0 20px rgba(0,0,0,1);
    border-radius: 40px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 15px 25px;
    box-sizing: border-box;
}

#bp-ai-messages {
    flex: 1 1 auto;
    min-height: 0; /* Critic pentru flexbox */
    width: 100%;
    overflow-y: auto;
    padding: 10px 5px 10px 0; /* Padding să nu taie textul */
    display: flex;
    flex-direction: column;
    gap: 12px;
    scrollbar-width: none;
}
#bp-ai-messages::-webkit-scrollbar { display: none; }

.bp-ai-msg { display: flex; width: 100%; }
.bp-ai-msg.user { justify-content: flex-end; }
.bp-ai-bub {
    padding: 4px 0;
    background: transparent;
    font-size: 16px;
    color: #00ff41;
    text-shadow: 0 0 4px rgba(0, 255, 65, 0.5);
    word-wrap: break-word;
}
.bp-ai-msg.user .bp-ai-bub { color: #fff; text-align: right; text-shadow: none; }

#bp-ai-row {
    flex-shrink: 0;
    min-height: 35px;
    display: flex;
    align-items: center;
    border-top: 1px solid rgba(0, 255, 65, 0.3);
    margin-top: 5px;
}
.bp-terminal-prompt { color: #00ff41; font-weight: bold; margin-right: 8px; }
#bp-ai-input { flex: 1; background: transparent; border: none; color: #fff; font-size: 16px; }
#bp-ai-input:focus { outline: none; border-bottom: 2px solid #00ff41; }