/* ── Página de Geometria ─────────────────────────────────────── */

.geo-pag {
    padding: 20px 24px;
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.geo-pag-header {
    display: flex;
    align-items: baseline;
    gap: 12px;
}

.geo-pag-titulo {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--cor-texto, #1e293b);
    margin: 0;
}

.geo-pag-ano {
    font-size: 0.95rem;
    color: #6b7280;
    font-weight: 500;
    background: #f3f4f6;
    padding: 2px 10px;
    border-radius: 12px;
}

/* Construções rápidas */
.geo-presets {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.geo-presets-label {
    font-size: 13px;
    color: #6b7280;
    white-space: nowrap;
}

.geo-preset-btn {
    padding: 4px 12px;
    border: 1px solid #a5b4fc;
    border-radius: 5px;
    background: #eef2ff;
    color: #3730a3;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.1s;
}

.geo-preset-btn:hover {
    background: #c7d2fe;
}

/* Layout de duas colunas */
.geo-pag-corpo {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.geo-pag-esq {
    flex: 0 0 auto;
}

.geo-pag-dir {
    flex: 1 1 240px;
    min-width: 200px;
}

/* Painel de métricas */
.geo-met-tit {
    font-size: 1rem;
    font-weight: 600;
    color: var(--cor-texto, #1e293b);
    margin: 0 0 10px;
}

.geo-met-panel {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.geo-met-vazio {
    font-size: 13px;
    color: #9ca3af;
    font-style: italic;
    margin: 0;
}

.geo-bloco {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 8px 12px;
}

.geo-bloco-tit {
    font-size: 13px;
    font-weight: 600;
    color: var(--cor-primaria, #2563eb);
    margin: 0 0 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.geo-met-tab {
    border-collapse: collapse;
    width: 100%;
    font-size: 12px;
}

.geo-m-k {
    color: #6b7280;
    padding: 2px 8px 2px 0;
    white-space: nowrap;
    font-weight: 500;
}

.geo-m-v {
    color: #1e293b;
    padding: 2px 0;
    font-family: var(--fonte-mono, monospace);
    font-size: 11.5px;
}

/* ── Canvas de Geometria ─────────────────────────────────────── */

.canvas-geo-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    user-select: none;
}

/* Barra de ferramentas */
.geo-toolbar {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.geo-tool {
    padding: 5px 13px;
    border: 1px solid var(--cor-borda, #d1d5db);
    border-radius: 5px;
    background: var(--cor-fundo-card, #f9fafb);
    color: var(--cor-texto, #1e293b);
    font-size: 13px;
    cursor: pointer;
    transition: background 0.1s, border-color 0.1s;
}

.geo-tool:hover:not(.geo-tool-on) {
    background: #e0e7ff;
    border-color: #a5b4fc;
}

.geo-tool-on {
    background: var(--cor-primaria, #2563eb);
    color: #fff;
    border-color: var(--cor-primaria, #2563eb);
}

.geo-tool-perigo {
    color: #dc2626;
    border-color: #fca5a5;
}

.geo-tool-perigo:hover {
    background: #fee2e2;
    border-color: #dc2626;
}

.geo-sep {
    display: inline-block;
    width: 1px;
    height: 24px;
    background: var(--cor-borda, #d1d5db);
    margin: 0 2px;
    align-self: center;
}

/* Canvas SVG */
.canvas-geo {
    display: block;
    border: 1px solid var(--cor-borda, #d1d5db);
    border-radius: 6px;
    background: #fff;
    cursor: crosshair;
    touch-action: none;
}

.canvas-geo-mover { cursor: grab; }
.canvas-geo-arrastar { cursor: grabbing; }

/* Desactiva pointer-events nos filhos para que offset_x/y sejam
   sempre relativos ao SVG, e os eventos de rato não borbulhem
   de elementos filhos com coordenadas erradas. */
.canvas-geo * {
    pointer-events: none;
}

/* Grelha e eixos */
.geo-grade {
    stroke: #e5e7eb;
    stroke-width: 0.5;
}

.geo-eixo {
    stroke: #9ca3af;
    stroke-width: 1;
}

.geo-eixo-rot {
    font-size: 11px;
    fill: #6b7280;
    font-family: var(--fonte-mono, monospace);
}

/* Pontos */
.geo-ponto {
    fill: var(--cor-primaria, #2563eb);
    stroke: #fff;
    stroke-width: 2;
}

.geo-ponto-sel {
    fill: #dc2626;
    stroke: #fff;
}

/* Pontos de intersecção derivados (compassos) */
.geo-ponto-derivado {
    fill: #f97316;
    stroke: #fff;
    stroke-width: 1.5;
    fill-opacity: 0.85;
}

.geo-ponto-derivado-cruz {
    stroke: #ea580c;
    stroke-width: 2;
    fill: none;
}

/* Rótulos dos pontos */
.geo-rot {
    font-size: 13px;
    font-weight: 700;
    fill: #1e293b;
    font-family: var(--fonte-serif, Georgia, serif);
}

/* Formas 2D */
.geo-seg {
    stroke: #1e293b;
    stroke-width: 2;
    fill: none;
    stroke-linecap: round;
}

.geo-tri {
    fill: rgba(37, 99, 235, 0.07);
    stroke: #1e293b;
    stroke-width: 2;
    stroke-linejoin: round;
}

.geo-pol {
    fill: rgba(37, 99, 235, 0.07);
    stroke: #1e293b;
    stroke-width: 2;
    stroke-linejoin: round;
}

.geo-circ {
    fill: rgba(37, 99, 235, 0.05);
    stroke: #1e293b;
    stroke-width: 2;
}

.geo-recta {
    stroke: #64748b;
    stroke-width: 1.5;
    stroke-dasharray: 6 4;
    fill: none;
}

/* Anotações */
.geo-ang90 {
    stroke: #1e293b;
    stroke-width: 1.5;
    fill: none;
}

.geo-ang-arco {
    stroke: #7c3aed;
    stroke-width: 1.5;
    fill: none;
}

.geo-ang-val {
    font-size: 11px;
    fill: #7c3aed;
    font-family: var(--fonte-mono, monospace);
    font-weight: 600;
}

/* Construções clássicas */
.geo-mediatriz {
    stroke: #0891b2;
    stroke-width: 1.5;
    fill: none;
}

.geo-bissetriz {
    stroke: #d97706;
    stroke-width: 1.5;
    fill: none;
}

.geo-paralela {
    stroke: #16a34a;
    stroke-width: 1.5;
    fill: none;
}

.geo-perp {
    stroke: #dc2626;
    stroke-width: 1.5;
    fill: none;
}

/* Ângulo ao centro e ângulo inscrito */
.geo-arco-central {
    stroke: #dc2626;
    stroke-width: 3;
    fill: none;
    stroke-linecap: round;
}

.geo-ang-arco-centro {
    stroke: #dc2626;
    stroke-width: 2;
    fill: none;
}

.geo-ang-centro-val {
    font-size: 12px;
    fill: #dc2626;
    font-family: var(--fonte-mono, monospace);
    font-weight: 700;
}

/* Pré-visualização durante criação */
.geo-preview {
    stroke: #2563eb;
    stroke-width: 1.5;
    stroke-dasharray: 5 4;
    fill: none;
    opacity: 0.6;
}

/* Dica contextual */
.geo-dica {
    font-size: 12px;
    color: #6b7280;
    margin: 0;
    min-height: 1.2em;
}

/* ── Selector de exercícios ──────────────────────────────────── */
.geo-exercicios {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 8px;
    flex-wrap: wrap;
    border-top: 1px solid #e5e7eb;
}

.geo-ex-label {
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    white-space: nowrap;
}

.geo-ex-btn {
    font-size: 12px;
    padding: 3px 9px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    color: #374151;
}

.geo-ex-btn:hover { background: #f3f4f6; }

.geo-ex-btn-on {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}

.geo-ex-btn-on:hover { background: #1d4ed8; }

/* ── Painel de exercício ─────────────────────────────────────── */
.geo-ex-panel { padding: 2px 0; }

.geo-ex-tit {
    font-size: 14px;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 6px 0;
}

.geo-ex-desc {
    font-size: 12px;
    color: #4b5563;
    line-height: 1.5;
    margin: 0 0 10px 0;
}

.geo-ex-passos {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.geo-ex-passo {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 12px;
    border: 1px solid transparent;
}

.geo-ex-ok  { background: #f0fdf4; border-color: #86efac; color: #15803d; }
.geo-ex-nok { background: #f9fafb; border-color: #e5e7eb; color: #6b7280; }

.geo-ex-icone {
    font-size: 14px;
    font-weight: 700;
    min-width: 16px;
    text-align: center;
}

.geo-ex-pdesc { line-height: 1.3; }

.geo-ex-concluido {
    margin-top: 12px;
    padding: 10px 14px;
    background: #f0fdf4;
    border: 1px solid #86efac;
    border-radius: 8px;
    color: #15803d;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
}

/* ── EditorGeoTrig ──────────────────────────────────────────── */

.geo-ex-dados {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 0 0 12px 0;
}

.geo-ex-dado {
    font-size: 12px;
    color: #1e293b;
    background: #f1f5f9;
    border-radius: 5px;
    padding: 5px 10px;
    font-family: 'JetBrains Mono', monospace;
}

.geo-ex-pergunta {
    font-size: 13px;
    font-weight: 600;
    color: #1e40af;
    line-height: 1.45;
    margin: 0 0 10px 0;
}
