/* =========================================================
   Symtime Assistant Chat — CSS completamente isolado
   Carregado por último para garantir precedência total
   ========================================================= */

/* ── Botão do NavBar ─────────────────────────────────────── */
.symtime-chat-nav-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1.5px solid rgba(255, 255, 255, 0.5) !important;
    background: rgba(255, 255, 255, 0.12) !important;
    color: white !important;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
    flex-shrink: 0;
    transition: background 0.2s, border-color 0.2s, transform 0.15s;
    padding: 0 !important;
    box-shadow: none !important;
    outline: none !important;
}

.symtime-chat-nav-btn i,
.symtime-chat-nav-btn .fas {
    color: white !important;
    font-size: 15px !important;
}

.symtime-chat-nav-btn:hover {
    background: rgba(255, 255, 255, 0.22) !important;
    border-color: rgba(255, 255, 255, 0.8) !important;
    transform: scale(1.06);
}

.symtime-chat-nav-btn.symtime-chat-nav-active {
    background: rgba(255, 255, 255, 0.92) !important;
    border-color: white !important;
}

.symtime-chat-nav-btn.symtime-chat-nav-active i,
.symtime-chat-nav-btn.symtime-chat-nav-active .fas {
    color: #001180 !important;
}

/* ── Chat Card (sidebar flutuante) ───────────────────────── */
.symtime-chat-card {
    position: fixed;
    right: 5px;
    top: 53px;
    bottom: 5px;
    width: 360px;
    background: #fff;
    border-radius: 16px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.14),
        0 2px 8px rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    z-index: 200;
    overflow: hidden;
    animation: symtime-slide-in 0.25s cubic-bezier(0.4, 0, 0.2, 1) both;
}

@keyframes symtime-slide-in {
    from { transform: translateX(calc(100% + 5px)); opacity: 0.4; }
    to   { transform: translateX(0);                opacity: 1;   }
}

/* Header */
.symtime-chat-header {
    background: linear-gradient(135deg, #001180 0%, #0D2280 100%);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.symtime-chat-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.25);
}

.symtime-chat-avatar i {
    color: #001180 !important;
    font-size: 18px !important;
}

.symtime-chat-header-info {
    flex: 1;
    min-width: 0;
}

.symtime-chat-title {
    color: white !important;
    font-size: 15px !important;
    font-weight: 500 !important;
    letter-spacing: 0.1px;
}

.symtime-chat-subtitle {
    color: rgba(255, 255, 255, 0.65) !important;
    font-size: 11px !important;
    margin-top: 1px;
}

.symtime-chat-close {
    width: 30px !important;
    height: 30px !important;
    min-width: unset !important;
    border-radius: 50% !important;
    border: none !important;
    background: rgba(255, 255, 255, 0.12) !important;
    color: white !important;
    cursor: pointer;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0;
    transition: background 0.2s;
    padding: 0 !important;
    box-shadow: none !important;
}

.symtime-chat-close i {
    color: white !important;
    font-size: 14px !important;
}

.symtime-chat-close:hover {
    background: rgba(255, 255, 255, 0.22) !important;
}

/* Messages area */
.symtime-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: #F0F2FF;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.symtime-chat-messages::-webkit-scrollbar { width: 4px; }
.symtime-chat-messages::-webkit-scrollbar-track { background: transparent; }
.symtime-chat-messages::-webkit-scrollbar-thumb { background: rgba(0, 0, 0, 0.15); border-radius: 4px; }

/* Bubbles */
.symtime-chat-bubble {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 14px !important;
    font-family: Roboto, sans-serif !important;
    font-weight: normal !important;
    line-height: 1.55;
    word-wrap: break-word;
    text-align: left;
}

.symtime-chat-bubble.symtime-assistant {
    background: #FFFFFF;
    color: #1F2937;
    border-radius: 12px 12px 12px 4px;
    align-self: flex-start;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.symtime-chat-bubble.symtime-user {
    background: #001180;
    color: white;
    border-radius: 12px 12px 4px 12px;
    align-self: flex-end;
}

/* Reset total dentro do bubble do assistente */
.symtime-chat-bubble.symtime-assistant *,
.symtime-chat-bubble.symtime-assistant *::before,
.symtime-chat-bubble.symtime-assistant *::after {
    font-size: 14px !important;
    font-family: Roboto, sans-serif !important;
    font-weight: normal !important;
    font-style: normal !important;
    color: #1F2937 !important;
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.symtime-chat-bubble.symtime-assistant p { margin-bottom: 8px !important; }
.symtime-chat-bubble.symtime-assistant p:last-child { margin-bottom: 0 !important; }
.symtime-chat-bubble.symtime-assistant ul,
.symtime-chat-bubble.symtime-assistant ol { padding-left: 18px !important; margin-bottom: 8px !important; }
.symtime-chat-bubble.symtime-assistant li { margin-bottom: 4px !important; }

.symtime-chat-bubble.symtime-assistant pre {
    background: #1e1e2e !important;
    color: #cdd6f4 !important;
    padding: 10px 12px !important;
    border-radius: 8px !important;
    overflow-x: auto !important;
    margin: 8px 0 !important;
}

.symtime-chat-bubble.symtime-assistant pre code {
    color: #cdd6f4 !important;
    font-family: monospace !important;
}

/* Loading dots */
.symtime-chat-loading {
    display: flex;
    gap: 5px;
    align-items: center;
    padding: 12px 16px;
    background: #FFFFFF;
    border-radius: 12px 12px 12px 4px;
    align-self: flex-start;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    width: fit-content;
}

.symtime-chat-loading span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #001180;
    animation: symtime-dot-bounce 1.2s infinite;
    display: inline-block;
}

.symtime-chat-loading span:nth-child(2) { animation-delay: 0.2s; }
.symtime-chat-loading span:nth-child(3) { animation-delay: 0.4s; }

@keyframes symtime-dot-bounce {
    0%, 80%, 100% { transform: scale(0.7); opacity: 0.4; }
    40%            { transform: scale(1);   opacity: 1;   }
}

/* Input area */
.symtime-chat-input-area {
    padding: 12px 16px;
    border-top: 1px solid #EAEAEA;
    display: flex;
    gap: 8px;
    align-items: center;
    flex-shrink: 0;
    background: white;
}

.symtime-chat-input {
    flex: 1;
    border: 1.5px solid #E5E7EB !important;
    border-radius: 20px !important;
    padding: 9px 14px !important;
    font-size: 14px !important;
    font-family: Roboto, sans-serif !important;
    outline: none !important;
    transition: border-color 0.2s;
    background: #F9FAFB !important;
    color: #1F2937 !important;
    box-shadow: none !important;
}

.symtime-chat-input:focus {
    border-color: #001180 !important;
    background: white !important;
}

.symtime-chat-send {
    width: 38px !important;
    height: 38px !important;
    min-width: unset !important;
    border-radius: 50% !important;
    background: #001180 !important;
    color: white !important;
    border: none !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0;
    transition: background 0.2s;
    padding: 0 !important;
    box-shadow: 0 2px 6px rgba(0, 17, 128, 0.3) !important;
}

.symtime-chat-send i {
    color: white !important;
    font-size: 14px !important;
}

.symtime-chat-send:hover {
    background: #0D1FA8 !important;
}

/* ── Deslocamento do conteúdo principal ──────────────────── */
/* card 360px + margem direita 5px + folga 8px = 373px */
.main-content-with-chat {
    margin-right: 373px !important;
    transition: margin-right 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Responsive */
@media (max-width: 1200px) {
    .symtime-chat-card { width: 320px; right: 5px; }
    .main-content-with-chat { margin-right: 333px !important; }
}

@media (max-width: 768px) {
    .symtime-chat-card { width: calc(100vw - 24px); right: 12px; left: 12px; border-radius: 12px; }
    .main-content-with-chat { margin-right: 0 !important; }
}
