/* ============================================================
   tutor-gd.css  —  Assistente Virtual · gd.elisiosilva.pt
   ============================================================ */

/* --- BOTÃO (junto a cada exercício) --- */
.tutor-btn-ajuda {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin: 4px 0 24px 20px;
    padding: 7px 15px;
    background: #fff;
    color: #6BA918;
    border: 1.5px solid #6BA918;
    border-radius: 5px;
    font-size: 0.84em;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.18s, color 0.18s;
    line-height: 1.3;
}
.tutor-btn-ajuda:hover {
    background: #6BA918;
    color: #fff;
}
.tutor-btn-ajuda svg {
    flex-shrink: 0;
    transition: transform 0.2s;
}
.tutor-btn-ajuda:hover svg {
    transform: scale(1.1);
}

/* --- OVERLAY DO MODAL --- */
.tutor-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 9000;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.tutor-overlay.aberto {
    display: flex;
}

/* --- CAIXA DO MODAL --- */
.tutor-modal {
    background: #fff;
    border-radius: 10px;
    width: 100%;
    max-width: 740px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 40px rgba(0,0,0,0.25);
    overflow: hidden;
    font-family: inherit;
    font-size: 0.93em;
}

/* Cabeçalho */
.tutor-modal-header {
    background: #649D18;
    color: #fff;
    padding: 12px 16px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    flex-shrink: 0;
}
.tutor-modal-header-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.tutor-modal-titulo {
    font-weight: 700;
    font-size: 0.97em;
    display: flex;
    align-items: center;
    gap: 7px;
}
.tutor-modal-subtitulo {
    font-size: 0.78em;
    opacity: 0.85;
    font-weight: 400;
    margin: 5px 0 0 0;
}
.tutor-modal-fechar {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.3em;
    cursor: pointer;
    opacity: 0.8;
    line-height: 1;
    padding: 2px 4px;
    flex-shrink: 0;
    margin-top: 1px;
}
.tutor-modal-fechar:hover { opacity: 1; }

/* Enunciado resumido */
.tutor-modal-enunciado {
    background: #fff;
    border-bottom: 1px solid #d8eabc;
    padding: 9px 16px;
    font-size: 0.81em;
    color: #444;
    max-height: 90px;
    overflow-y: auto;
    flex-shrink: 0;
    line-height: 1.45;
}
.tutor-modal-enunciado strong {
    color: #6BA918;
    font-size: 0.9em;
    display: block;
    margin-bottom: 3px;
}

/* Área de mensagens */
.tutor-msgs {
    flex: 1;
    overflow-y: auto;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #fafafa;
    min-height: 180px;
}

/* Balões de mensagem */
.tutor-msg {
    max-width: 86%;
    padding: 9px 13px;
    border-radius: 10px;
    line-height: 1.5;
    word-break: break-word;
    font-size: 0.92em;
}

/* Assistente — verde clarinho */
.tutor-msg.tutor {
    align-self: flex-start;
    background: #edf4e0;
    border-bottom-left-radius: 2px;
    color: #1e2d10;
    border: 1px solid #d4e9b0;
}
.tutor-msg.tutor strong { color: #1e2d10; }

/* Aluno — verde oficial */
.tutor-msg.aluno {
    align-self: flex-end;
    background: #6BA918;
    color: #fff;
    border-bottom-right-radius: 2px;
}

/* Sistema */
.tutor-msg.sistema {
    align-self: center;
    background: #f0f0f0;
    color: #777;
    font-style: italic;
    font-size: 0.82em;
    border-radius: 20px;
    padding: 4px 14px;
}

/* Indicador "a responder" */
.tutor-typing {
    align-self: flex-start;
    padding: 9px 14px;
    background: #edf4e0;
    border-radius: 10px;
    border-bottom-left-radius: 2px;
    color: #555;
    font-style: italic;
    font-size: 0.85em;
    border: 1px solid #d4e9b0;
}
.tutor-typing-dots {

    display: inline-block;
    width: 18px;
}
.tutor-typing-dots::after {
    content: '.';
    animation: tutor-dots 1.2s steps(3, end) infinite;
}
@keyframes tutor-dots {
    0%   { content: '.';   }
    33%  { content: '..';  }
    66%  { content: '...'; }
}

/* --- BOTÕES DE OPÇÃO INICIAL --- */
.tutor-opcoes {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 12px;
    align-self: flex-start;
    max-width: 100%;
	margin: 14px 0 0 0;
}
.tutor-opcao-btn {
    padding: 12px 10px;
    background: #fff;
    border: 1.5px solid #6BA918;
    border-radius: 6px;
    color: #6BA918;
    font-size: 0.75em;
    font-family: inherit;
    cursor: pointer;
    text-align: center;
    transition: background 0.15s, color 0.15s;
    font-weight: 500;
    white-space: nowrap;
}
.tutor-opcao-btn:hover {
    background: #6BA918;
    color: #fff;
}

@media (max-width: 600px) {
    .tutor-opcao-btn {
        flex: 1 1 100%;
        text-align: center;
        white-space: normal;
    }
}

/* Sugestões rápidas */
.tutor-sugestoes {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 16px 4px;
    border-top: 1px solid #e8e8e8;
    background: #fff;
    flex-shrink: 0;
}
.tutor-sug-btn {
    padding: 4px 11px;
    background: #fff;
    border: 1px solid #6BA918;
    border-radius: 20px;
    color: #6BA918;
    font-size: 11px;
    cursor: pointer;
    transition: background 0.15s;
    font-family: inherit;
}
.tutor-sug-btn:hover { background: #edf4e0; }

/* Área de input */
.tutor-input-area {
    display: flex;
    gap: 8px;
    padding: 10px 16px;
    border-top: 1px solid #e0e0e0;
    background: #fff;
    flex-shrink: 0;
}
.tutor-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #b8d87a;
    border-radius: 6px;
    font-size: 0.87em;
    font-family: inherit;
    outline: none;
    resize: none;
    line-height: 1.4;
    background: #fafff5;
}
.tutor-input:focus {
    border-color: #6BA918;
    box-shadow: 0 0 0 2px rgba(107,169,24,0.15);
}

/* Botão Enviar */
.tutor-enviar {
    padding: 8px 15px;
    background: #6BA918;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.87em;
    font-family: inherit;
    white-space: nowrap;
    transition: background 0.18s;
    font-weight: 600;
}
.tutor-enviar:hover    { background: #5a9614; }
.tutor-enviar:disabled { background: #aac870; cursor: not-allowed; }

/* Rodapé do modal */
.tutor-modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 16px 8px;
    background: #fff;
    border-top: 1px solid #f0f0f0;
    flex-shrink: 0;
}
.tutor-modal-footer-texto {
    font-size: 0.71em;
    color: #bbb;
}
.tutor-limpar {
    background: none;
    border: none;
    color: #bbb;
    cursor: pointer;
    font-size: 0.75em;
    text-decoration: underline;
    font-family: inherit;
    padding: 0;
}
.tutor-limpar:hover { color: #888; }

/* Responsivo */
@media (max-width: 600px) {
    .tutor-overlay { padding: 0; align-items: flex-end; }
    .tutor-modal   { border-radius: 12px 12px 0 0; max-height: 92vh; }
    .tutor-sugestoes { display: none; }
    .tutor-modal-enunciado { max-height: 60px; }
}