/* ============================================
   MEETINGS — Panel de Reuniones con Agentes
   ============================================ */

/* Contenedor de vista agentes (dentro del panel lateral) */
#agentsView {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

/* Vista de reunión: ocupa todo el panel lateral */
#meetingView {
    display: none;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

/* Header de la reunión */
.meeting-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-light);
    background: var(--bg-card);
    flex-shrink: 0;
}

.meeting-back-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 11px;
    padding: 4px 7px;
    border-radius: 4px;
    white-space: nowrap;
    font-family: inherit;
    letter-spacing: 0.3px;
    transition: background 0.15s, color 0.15s;
    flex-shrink: 0;
}

.meeting-back-btn:hover {
    background: var(--tag-bg);
    color: var(--text-primary);
}

.meeting-agent-info {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.meeting-header-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 12px;
    color: white;
    flex-shrink: 0;
}

.meeting-header-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.meeting-header-status {
    font-size: 10px;
    color: var(--accent-green);
    letter-spacing: 0.3px;
}

/* Área de mensajes */
.meeting-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Mensajes */
.meeting-msg {
    display: flex;
    align-items: flex-end;
    gap: 6px;
}

.meeting-msg--user {
    flex-direction: row-reverse;
}

.meeting-msg--system {
    justify-content: center;
}

.meeting-msg-avatar {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 9px;
    color: white;
    flex-shrink: 0;
    margin-bottom: 2px;
}

.meeting-msg-bubble {
    max-width: 82%;
    padding: 7px 10px;
    border-radius: 12px;
    font-size: 12px;
    line-height: 1.55;
    color: var(--text-primary);
    background: var(--tag-bg);
    word-break: break-word;
    border-radius: 4px 12px 12px 12px;
}

.meeting-msg-bubble--user {
    background: var(--accent-orange);
    color: white;
    border-radius: 12px 12px 4px 12px;
}

.meeting-msg-system {
    font-size: 11px;
    color: var(--text-muted);
    padding: 3px 10px;
    background: var(--tag-bg);
    border-radius: 20px;
    text-align: center;
}

/* Loader: puntos animados */
.meeting-typing {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 2px;
    height: 18px;
}

.meeting-typing span {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--text-muted);
    animation: meeting-bounce 1.2s ease-in-out infinite;
}

.meeting-typing span:nth-child(1) { animation-delay: 0s; }
.meeting-typing span:nth-child(2) { animation-delay: 0.2s; }
.meeting-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes meeting-bounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.35; }
    30%           { transform: translateY(-5px); opacity: 1; }
}

/* Quick replies */
.meeting-quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    padding: 8px 10px;
    border-top: 1px solid var(--border-subtle);
    flex-shrink: 0;
}

.meeting-quick-reply {
    padding: 4px 9px;
    border: 1px solid var(--border-light);
    border-radius: 20px;
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 11px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s;
    white-space: nowrap;
}

.meeting-quick-reply:hover {
    border-color: var(--accent-orange);
    color: var(--accent-orange);
    background: var(--bg-main);
}

/* Input area */
.meeting-input-area {
    display: flex;
    gap: 6px;
    padding: 10px;
    border-top: 1px solid var(--border-light);
    background: var(--bg-card);
    flex-shrink: 0;
}

.meeting-input {
    flex: 1;
    padding: 7px 10px;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    font-family: inherit;
    font-size: 12px;
    color: var(--text-primary);
    background: var(--bg-main);
    outline: none;
    transition: border-color 0.15s;
    min-width: 0;
}

.meeting-input:focus {
    border-color: var(--accent-orange);
}

.meeting-send-btn {
    padding: 7px 12px;
    background: var(--accent-orange);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: opacity 0.15s;
    white-space: nowrap;
    flex-shrink: 0;
}

.meeting-send-btn:hover {
    opacity: 0.85;
}

.meeting-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Botón de reunión (💬) en cada agente de la lista */
.agent-meeting-btn {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    border: 1px solid var(--border-light);
    background: var(--bg-main);
    color: var(--text-muted);
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.15s, color 0.15s, border-color 0.15s;
    flex-shrink: 0;
    padding: 0;
}

.agent-item:hover .agent-meeting-btn {
    opacity: 1;
}

.agent-meeting-btn:hover {
    border-color: var(--accent-orange);
    color: var(--accent-orange);
    background: var(--bg-card);
}

/* Mensajes históricos (sesión anterior) — ligeramente atenuados */
.meeting-msg--past .meeting-msg-bubble {
    opacity: 0.55;
}
.meeting-msg--past .meeting-msg-bubble--user {
    opacity: 0.55;
}

/* Separador de sesión */
.meeting-separator {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 6px 0;
    color: var(--text-muted);
    font-size: 10px;
    letter-spacing: 0.6px;
    text-transform: uppercase;
}
.meeting-separator::before,
.meeting-separator::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-subtle);
}

/* Dark mode */
[data-theme="dark"] .meeting-msg-bubble {
    background: #2a2a2a;
}

[data-theme="dark"] .meeting-quick-reply {
    background: #1e1e1e;
}

[data-theme="dark"] .meeting-input {
    background: #1a1a1a;
    color: #fff;
    border-color: #333;
}

[data-theme="dark"] .meeting-back-btn:hover {
    background: #2a2a2a;
}
