﻿.card {
    border: none;
    background: #eee;
}

.search {
    width: 100%;
    margin-bottom: auto;
    margin-top: 20px;
    height: 50px;
    background-color: #fff;
    padding: 10px;
    border-radius: 5px;
}

.search-input {
    color: white;
    border: 0;
    outline: 0;
    background: none;
    width: 0;
    margin-top: 5px;
    caret-color: transparent;
    line-height: 20px;
    transition: width 0.4s linear
}

.search .search-input {
    padding: 0 10px;
    width: 100%;
    caret-color: #536bf6;
    font-size: 19px;
    font-weight: 300;
    color: black;
    transition: width 0.4s linear;
}


.search-icon {
    height: 34px;
    width: 34px;
    float: right;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    background-color: #536bf6;
    font-size: 10px;
    bottom: 30px;
    position: relative;
    border-radius: 5px;
}

    .search-icon:hover {
        color: #fff !important;
    }

a:link {
    text-decoration: none
}



.card-inner {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    word-wrap: break-word;
    background-color: #fff;
    background-clip: border-box;
    border: 1px solid rgba(0,0,0,.125);
    border-radius: .25rem;
    border: none;
    cursor: pointer;
    transition: all 2s;
}


    .card-inner:hover {
        transform: scale(1.1);
    }

.mg-text span {
    font-size: 12px;
}

.mg-text {
    line-height: 14px;
}

/* ── Conteúdo Markdown renderizado (divcorpo em suporte.aspx) ── */
.markdown-content h1,
.markdown-content h2,
.markdown-content h3,
.markdown-content h4,
.markdown-content h5,
.markdown-content h6 {
    margin-top: 1.2em;
    margin-bottom: 0.5em;
    font-weight: 600;
    line-height: 1.3;
}

.markdown-content h1 { font-size: 1.6em; }
.markdown-content h2 { font-size: 1.35em; }
.markdown-content h3 { font-size: 1.15em; }
.markdown-content h4 { font-size: 1.05em; }
.markdown-content h5,
.markdown-content h6 { font-size: 1em; }

.markdown-content p {
    margin-bottom: 0.8em;
    line-height: 1.6;
}

.markdown-content code {
    background-color: #f4f4f4;
    padding: 2px 5px;
    border-radius: 3px;
    font-size: 0.9em;
    font-family: Consolas, "Courier New", monospace;
}

/* Blocos <pre> — usados para código E para ASCII art / fluxogramas.
   Preserva alinhamento de caracteres box-drawing (─ │ ├ ┤ ┐ ┘ etc) usando
   fonte monospace explícita, line-height compacto e tab-size fixo. */
.markdown-content pre {
    background-color: #f6f8fa;
    border: 1px solid #d1d5da;
    padding: 14px 16px;
    border-radius: 4px;
    overflow-x: auto;
    margin: 1em 0;
    line-height: 1.45;
    tab-size: 4;
    -moz-tab-size: 4;
}

.markdown-content pre code {
    background: none;
    padding: 0;
    border-radius: 0;
    font-size: 0.9em;
    font-family: Consolas, "Courier New", "Lucida Console", monospace;
    line-height: 1.45;
    white-space: pre;
    word-break: normal;
    word-wrap: normal;
    color: #24292e;
}

.markdown-content blockquote {
    border-left: 3px solid #ccc;
    padding-left: 1em;
    margin: 0.8em 0;
    color: #666;
}

/* Tabelas — visual de "quadro" claro: borda externa marcada, cabeçalho destacado,
   linhas alternadas (zebra) para facilitar a leitura. */
.markdown-content table {
    width: auto;
    min-width: 50%;
    max-width: 100%;
    border-collapse: collapse;
    margin: 1em 0;
    font-size: 0.95em;
    border: 1px solid #c0c0c0;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.markdown-content table th,
.markdown-content table td {
    border: 1px solid #d8d8d8;
    padding: 8px 12px;
    text-align: left;
    vertical-align: top;
}

.markdown-content table th {
    background-color: #eef2f7;
    font-weight: 600;
    color: #2c3e50;
    border-bottom: 2px solid #c0c0c0;
}

.markdown-content table tbody tr:nth-child(even) {
    background-color: #fafafa;
}

.markdown-content table tbody tr:hover {
    background-color: #f0f4fa;
}

.markdown-content ul,
.markdown-content ol {
    padding-left: 1.8em;
    margin-bottom: 0.8em;
}

.markdown-content li { margin-bottom: 0.3em; }

.markdown-content hr {
    border: none;
    border-top: 1px solid #e0e0e0;
    margin: 1.2em 0;
}

.markdown-content img {
    max-width: 100%;
    height: auto;
}

/* Links — !important para vencer regras genéricas do tema (ex.: ".panel a { color: inherit }").
   Sublinhado padrão para reforçar a affordance de "isto é clicável", além do cursor pointer. */
.markdown-content a,
.markdown-content a:link,
.markdown-content a:visited {
    color: #337ab7 !important;
    text-decoration: underline;
}
.markdown-content a:hover,
.markdown-content a:focus {
    color: #23527c !important;
    text-decoration: underline;
}
.markdown-content a:visited {
    color: #6f42c1 !important;
}

/* ════════════════════════════════════════════════════════════════════
   Widget de chat com IA na página de suporte (suporte.aspx).
   Widget flutuante no canto inferior direito, similar ao botão WhatsApp.
   Tudo em z-index alto pra ficar sempre visível.
   ════════════════════════════════════════════════════════════════════ */

#chat-ia-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Botão flutuante (estado fechado) */
.chat-ia-fab {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4a90e2 0%, #2e6cba 100%);
    color: #fff;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.chat-ia-fab:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
}

.chat-ia-fab:focus {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

/* Painel do chat (estado aberto) */
.chat-ia-painel {
    width: 380px;
    max-width: calc(100vw - 40px);
    height: 560px;
    max-height: calc(100vh - 60px);
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: chatIaSlideUp 0.25s ease-out;
}

@keyframes chatIaSlideUp {
    from { transform: translateY(20px); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}

/* Header */
.chat-ia-header {
    background: linear-gradient(135deg, #4a90e2 0%, #2e6cba 100%);
    color: #fff;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.chat-ia-titulo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 15px;
}

.chat-ia-acoes {
    display: flex;
    gap: 4px;
}

.chat-ia-acoes button {
    background: transparent;
    border: none;
    color: #fff;
    cursor: pointer;
    width: 28px;
    height: 28px;
    border-radius: 4px;
    font-size: 18px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}

.chat-ia-acoes button:hover {
    background: rgba(255, 255, 255, 0.18);
}

/* Área de mensagens */
.chat-ia-mensagens {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    background: #f7f9fc;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chat-ia-msg {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

.chat-ia-msg-user {
    align-self: flex-end;
    background: linear-gradient(135deg, #4a90e2 0%, #2e6cba 100%);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.chat-ia-msg-assistant {
    align-self: flex-start;
    background: #fff;
    color: #2c3e50;
    border: 1px solid #e1e7ef;
    border-bottom-left-radius: 4px;
}

/* Estilos do markdown dentro da mensagem da IA */
.chat-ia-msg-assistant p { margin: 0 0 8px 0; }
.chat-ia-msg-assistant p:last-child { margin-bottom: 0; }
.chat-ia-msg-assistant ul,
.chat-ia-msg-assistant ol {
    margin: 4px 0 8px 0;
    padding-left: 22px;
}
.chat-ia-msg-assistant li { margin-bottom: 2px; }
.chat-ia-msg-assistant code {
    background: #f0f2f5;
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 0.88em;
    font-family: Consolas, "Courier New", monospace;
}
.chat-ia-msg-assistant pre {
    background: #f0f2f5;
    padding: 8px 10px;
    border-radius: 4px;
    overflow-x: auto;
    font-size: 0.88em;
    margin: 6px 0;
}
.chat-ia-msg-assistant strong { color: #1a2942; }
.chat-ia-msg-assistant a {
    color: #2e6cba;
    text-decoration: underline;
}

/* Indicador "digitando..." */
.chat-ia-digitando {
    align-self: flex-start;
    background: #fff;
    color: #999;
    padding: 10px 14px;
    border-radius: 16px;
    border: 1px solid #e1e7ef;
    font-size: 13px;
    font-style: italic;
    display: flex;
    align-items: center;
    gap: 6px;
}

.chat-ia-digitando-dots span {
    display: inline-block;
    width: 6px;
    height: 6px;
    background: #999;
    border-radius: 50%;
    margin: 0 1px;
    animation: chatIaPulse 1.2s infinite;
}
.chat-ia-digitando-dots span:nth-child(2) { animation-delay: 0.2s; }
.chat-ia-digitando-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes chatIaPulse {
    0%, 60%, 100% { opacity: 0.3; transform: scale(0.8); }
    30%           { opacity: 1;   transform: scale(1.1); }
}

/* Cards de fontes (artigos da base usados na resposta) */
.chat-ia-fontes {
    align-self: flex-start;
    max-width: 85%;
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: -4px;
}

.chat-ia-fontes-titulo {
    font-size: 11px;
    color: #768296;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
    font-weight: 600;
}

.chat-ia-fonte-card {
    background: #fff;
    border: 1px solid #d6dde8;
    border-radius: 8px;
    padding: 8px 12px;
    cursor: pointer;
    text-decoration: none !important;
    color: #2c3e50 !important;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: border-color 0.15s, transform 0.15s;
    font-size: 13px;
}

.chat-ia-fonte-card:hover {
    border-color: #4a90e2;
    transform: translateX(2px);
    color: #2c3e50 !important;
}

.chat-ia-fonte-card i {
    color: #4a90e2;
    flex-shrink: 0;
}

.chat-ia-fonte-card .chat-ia-fonte-titulo {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Input + botão enviar */
.chat-ia-input-wrap {
    display: flex;
    gap: 6px;
    padding: 10px;
    background: #fff;
    border-top: 1px solid #e1e7ef;
    flex-shrink: 0;
}

.chat-ia-input-wrap textarea {
    flex: 1;
    border: 1px solid #d6dde8;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 14px;
    font-family: inherit;
    resize: none;
    outline: none;
    transition: border-color 0.15s;
}

.chat-ia-input-wrap textarea:focus {
    border-color: #4a90e2;
}

.chat-ia-input-wrap textarea:disabled {
    background: #f7f9fc;
    color: #999;
}

#chat-ia-enviar {
    background: linear-gradient(135deg, #4a90e2 0%, #2e6cba 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    width: 42px;
    cursor: pointer;
    font-size: 16px;
    flex-shrink: 0;
    transition: opacity 0.15s;
}

#chat-ia-enviar:hover:not(:disabled) {
    opacity: 0.9;
}

#chat-ia-enviar:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.chat-ia-rodape {
    padding: 6px 12px 8px;
    background: #fff;
    flex-shrink: 0;
}

.chat-ia-hint {
    font-size: 11px;
    color: #94a0b3;
}

/* Mensagem de erro/sistema */
.chat-ia-msg-sistema {
    align-self: center;
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 12px;
    text-align: center;
    max-width: 90%;
}

/* Responsivo: em telas pequenas o painel ocupa quase toda a tela */
@media (max-width: 480px) {
    #chat-ia-widget {
        bottom: 10px;
        right: 10px;
    }
    .chat-ia-painel {
        width: calc(100vw - 20px);
        height: calc(100vh - 80px);
        max-height: calc(100vh - 80px);
    }
}
