/* ==========================================================================
   BOTÃO DE VOLTAR AO TOPO (SCROLL TO TOP) & ASSISTENTE VIRTUAL (FAQ WIDGET)
   ========================================================================== */

/* Botão Voltar ao Topo */
.cc-scroll-top-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #0f172a;
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(15px);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 998;
}

.cc-scroll-top-btn.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.cc-scroll-top-btn:hover {
    background: #2563eb;
    color: #ffffff;
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(37, 99, 235, 0.4);
}

/* Assistente Virtual Flutuante */
.cc-assistant-widget {
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 999999 !important;
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
}

/* Botão Gatilho do Assistente */
.cc-assistant-trigger {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #ffffff;
    border: none;
    border-radius: 9999px;
    padding: 0.75rem 1.35rem 0.75rem 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(37, 99, 235, 0.35);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.cc-assistant-trigger:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 14px 36px rgba(37, 99, 235, 0.45);
}

.cc-assistant-trigger .icon-pulse {
    width: 32px !important;
    height: 32px !important;
    border-radius: 50% !important;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    overflow: hidden !important;
    flex-shrink: 0;
}

.cc-assistant-trigger .icon-pulse img,
.cc-assistant-avatar img {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: cover !important;
    border-radius: 50% !important;
    display: block !important;
}

/* Balão Popup de Convocação (Primeira Visita) */
.cc-assistant-tooltip {
    position: absolute;
    bottom: 58px;
    left: 0;
    width: 270px;
    background: #0f172a;
    color: #ffffff;
    padding: 0.85rem 1rem;
    border-radius: 16px;
    border-bottom-left-radius: 4px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.25);
    font-size: 0.85rem;
    line-height: 1.45;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px) scale(0.95);
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 1000;
}

.cc-assistant-tooltip.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.cc-assistant-tooltip-close {
    background: transparent;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 0.95rem;
    padding: 0;
    line-height: 1;
    transition: color 0.2s;
}

.cc-assistant-tooltip-close:hover {
    color: #ffffff;
}

/* Card do Chat do Assistente */
.cc-assistant-card {
    position: absolute;
    bottom: 64px;
    left: 0;
    width: 320px;
    max-width: calc(100vw - 32px);
    height: 400px;
    max-height: calc(100vh - 120px);
    background: #ffffff;
    border-radius: 24px;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.22), 0 0 0 1px rgba(0, 0, 0, 0.06);
    display: none;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transform-origin: bottom left;
    transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.cc-assistant-widget.active .cc-assistant-card {
    display: flex;
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Header do Assistente */
.cc-assistant-header {
    background: #0f172a;
    color: #ffffff;
    padding: 1.25rem 1.25rem 1.1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cc-assistant-header-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.cc-assistant-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #2563eb;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

.cc-assistant-header-text h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 800;
    color: #ffffff;
}

.cc-assistant-header-text p {
    margin: 0.15rem 0 0;
    font-size: 0.75rem;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.cc-assistant-header-text .status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #22c55e;
    display: inline-block;
}

.cc-assistant-close-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0.35rem;
    border-radius: 8px;
    transition: color 0.2s;
}

.cc-assistant-close-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
}

/* Corpo e Chat do Assistente */
.cc-assistant-body {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

/* Balões de Mensagem */
.cc-assistant-msg {
    max-width: 85%;
    padding: 0.85rem 1rem;
    border-radius: 18px;
    font-size: 0.9rem;
    line-height: 1.5;
    animation: msgFadeIn 0.25s ease-out;
}

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

.cc-assistant-msg.bot {
    align-self: flex-start;
    background: #ffffff;
    color: #1e293b;
    border: 1px solid #e2e8f0;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.cc-assistant-msg.user {
    align-self: flex-end;
    background: #2563eb;
    color: #ffffff;
    border-bottom-right-radius: 4px;
}

/* Sugestões Rápidas de Perguntas */
.cc-assistant-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.35rem;
}

.cc-assistant-opt-btn {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #2563eb;
    border-radius: 12px;
    padding: 0.65rem 0.85rem;
    font-size: 0.85rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cc-assistant-opt-btn:hover {
    background: #eff6ff;
    border-color: #93c5fd;
    transform: translateX(3px);
}

/* Rodapé do Chat com Input */
.cc-assistant-footer {
    padding: 0.75rem 1rem;
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 0.5rem;
}

.cc-assistant-input {
    flex: 1;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    padding: 0.6rem 0.85rem;
    font-size: 0.88rem;
    outline: none;
    transition: border-color 0.2s;
}

.cc-assistant-input:focus {
    border-color: #2563eb;
}

.cc-assistant-send-btn {
    background: #2563eb;
    color: #ffffff;
    border: none;
    border-radius: 12px;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}

.cc-assistant-send-btn:hover {
    background: #1d4ed8;
}

@media (max-width: 640px) {
    .cc-assistant-widget {
        bottom: 16px;
        left: 16px;
    }
    .cc-scroll-top-btn {
        bottom: 16px;
        right: 16px;
    }
    .cc-assistant-card {
        width: calc(100vw - 32px);
        height: 420px;
    }
}
