/* ============================================================
   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: #4A4A4A;
    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; }

/* ============================================================
   MODAL DE LOGIN (para quando não está autenticado)
   ============================================================ */

/* Animação de fade-in */
@keyframes tutor-login-fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Overlay do modal de login */
.tutor-login-overlay {
    display: flex;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 9100;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    pointer-events: none;
}

/* Quando tem classe aberto — transition só aqui (abre suave, fecha instantâneo) */
.tutor-login-overlay.aberto {
    opacity: 1;
    pointer-events: auto;
    transition: opacity 0.8s ease-out;
}

/* Caixa do modal de login */
.tutor-login-modal {
    background: #fff;
    border-radius: 12px;
    width: 100%;
    max-width: 420px;
    padding: 35px 30px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.25);
    position: relative;
    text-align: center;
}

/* Botão fechar */
.tutor-login-fechar {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #999;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
}
.tutor-login-fechar:hover {
    color: #333;
}

/* Conteúdo do modal */
.tutor-login-conteudo {
    width: 100%;
}

.tutor-login-conteudo h2 {
    color: #333;
    margin-bottom: 18px;
    font-size: 22px;
    font-weight: 700;
    text-align: center;
}

/* Texto de explicação */
.tutor-login-texto {
    color: #666;
    margin: 0 15px 30px 15px;
    line-height: 1.5;
    font-size: 1em;
    text-align: center;
}
.tutor-login-texto strong {
    color: #6BA918;
    font-weight: 600;
}

/* Botões de ação */
.tutor-login-btn {
    display: block;
    width: calc(100% - 32px);
    max-width: 300px;
    margin: 0 auto 12px auto;
    padding: 14px 16px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
	transition: background-color 0.5s ease, border-color 1.5s ease, color 1.5s ease;
    font-family: inherit;
    text-align: center;
}

/* Botão Login (principal) */
.tutor-login-btn-login {
    background-color: #6BA918;
    color: #fff;
	letter-spacing: 0.4px;
	font-weight: 500;
}
.tutor-login-btn-login:hover {
    background-color: #FA6B4B;
	color: #fff;
}

/* Botão Criar Conta (secundário) */
.tutor-login-btn-registo {
	background-color: #f0f0f0;
	color: #313131;
	letter-spacing: 0.4px;
	font-weight: 500;
	border: thin solid #A5A3A3;
}
.tutor-login-btn-registo:hover {
	background-color: #D6D6D6;
	color: #313131;
}

/* Divisor */
.tutor-login-divider {
    margin: 28px 0;
    border: none;
    border-top: 1px solid #ddd;
}

/* Texto pequeno */
.tutor-login-texto-pequeno {
    color: #666;
    font-size: 0.9em;
    margin-bottom: 14px;
    text-align: center;
}

/* ============================================================
   BANNER CHAT GERAL (Gaspar)
   ============================================================ */

.gaspar-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: #f3f9e8;
    border: 1.5px solid #c2e07a;
    border-radius: 8px;
    padding: 14px 18px;
    margin: 18px 0 24px 0;
}

.gaspar-banner-texto {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.gaspar-banner-texto strong {
    color: #3d6b0a;
    font-size: 0.95em;
}

.gaspar-banner-texto span {
    color: #555;
    font-size: 0.84em;
    line-height: 1.45;
}

.gaspar-banner-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 18px;
    background: #6BA918;
    color: #fff;
    border-radius: 5px;
    font-size: 0.87em;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background 0.18s;
}

.gaspar-banner-btn:hover {
    background: #5a9614;
}

@media (max-width: 600px) {
    .gaspar-banner {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    .gaspar-banner-btn {
        width: 100%;
        justify-content: center;
		padding: 9px 0;
    }
}

/* ============================================================
   BLOCO DE LIMITE ATINGIDO (dentro do chat)
   ============================================================ */
.tutor-limite-bloco {
	align-self: center;
	text-align: center;
	background: #fff;
	border: 1px solid #FF5530;
	border-radius: 10px;
	padding: 22px 26px;
	margin: 18px 0;
	max-width: 88%;
}
.tutor-limite-texto {
    color: #444;
    font-size: 0.9em;
    line-height: 1.7;
    margin: 0 0 14px 0;
	white-space: pre-line;
}
.tutor-limite-btn {
    display: inline-block;
    background: #6BA918;
    color: #fff;
    text-decoration: none;
    padding: 11px 24px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.92em;
    letter-spacing: 0.5px;
    transition: background 0.4s ease;
}
.tutor-limite-btn:hover {
    background: #FA6B4B;
    color: #fff;
}

/* 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; }

    .tutor-login-modal {
        border-radius: 12px;
        width: 100%;
        max-width: none;
        padding: 24px 16px;
    }

    .tutor-login-conteudo h2 {
        font-size: 20px;
    }

    .tutor-login-texto {
        font-size: 1em;
    }
}