/* legismap.css */
.lm-wrapper {
    font-family: 'Inter', sans-serif;
    width: 100%;
    position: relative;
    border-radius: 16px;
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    box-sizing: border-box; /* Garante que o padding não quebre o layout */
}

.lm-wrapper * { box-sizing: border-box; }

.lm-container {
    width: 100%;
    /* Padding bottom define a altura relativa. 
       Desktop: 55% (aprox 16:9). Mobile via media query. */
    padding-bottom: 55%; 
    position: relative;
    background-image: radial-gradient(#cbd5e1 1.5px, transparent 1.5px);
    background-size: 24px 24px;
    transition: padding-bottom 0.3s;
}

.lm-content { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
.lm-svg { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; }

/* Animações */
@keyframes lmPopIn {
    0% { opacity: 0; transform: translate(-50%, -40%) scale(0.5); }
    60% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); }
    100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
@keyframes lmDashFlow { to { stroke-dashoffset: -20; } }
@keyframes lmFadeIn { from { opacity: 0; } to { opacity: 1; } }

/* Nós (Cards) */
.lm-node {
    position: absolute;
    padding: 12px 16px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0,0,0,0.05);
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    transform: translate(-50%, -50%);
    opacity: 0;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-width: 120px;
    transition: transform 0.2s;
    line-height: 1.3;
}

.lm-node:hover { transform: translate(-50%, -50%) scale(1.05) !important; z-index: 20; box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1); }
.lm-node i { font-size: 1.3rem; margin-bottom: 6px; color: #64748b; }

/* Estilos */
.lm-style-root { background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%); color: white; font-size: 1.1rem; padding: 16px 24px; border: none; }
.lm-style-root i { color: white; }
.lm-style-warning { border-left: 4px solid #f59e0b; }
.lm-style-warning i { color: #f59e0b; }
.lm-style-info { border-left: 4px solid #0ea5e9; }
.lm-style-info i { color: #0ea5e9; }
.lm-style-success { border-left: 4px solid #10b981; background-color: #f0fdf4; }
.lm-style-success i { color: #10b981; }
.lm-style-danger { border-left: 4px solid #ef4444; background-color: #fef2f2; }
.lm-style-danger i { color: #ef4444; }

/* Linhas e Labels */
.lm-line { fill: none; stroke-linecap: round; stroke-linejoin: round; transition: d 0.5s ease; }
.lm-line.solid { stroke: #cbd5e1; stroke-width: 2.5; }
.lm-line.dashed { stroke: #94a3b8; stroke-width: 2; stroke-dasharray: 6 4; animation: lmDashFlow 1s linear infinite; }
.lm-line.subtle { stroke: #cbd5e1; stroke-width: 1.5; opacity: 0.5; }

.lm-label {
    position: absolute; background: white; padding: 2px 6px; border-radius: 4px;
    font-size: 1rem; font-weight: 700; color: #64748b; border: 1px solid #e2e8f0;
    z-index: 5; transform: translate(-50%, -50%); opacity: 0; animation: lmFadeIn 0.5s ease 0.8s forwards;
}

/* Responsivo Mobile */
@media (max-width: 768px) {
    .lm-container { padding-bottom: 75%; }
    .lm-node { font-size: 9px; padding: 5px 8px; border-radius: 6px; min-width: auto; width: auto; max-width: 90px; }
    .lm-node.lm-style-root { font-size: 11px; padding: 10px 14px; max-width: 150px; }
    .lm-node i { font-size: 11px; margin-bottom: 3px; }
    .lm-line.solid { stroke-width: 1.5; }
    .lm-line.dashed { stroke-width: 1.5; stroke-dasharray: 3 2; }
    .lm-label { font-size: 8px; padding: 1px 3px; }
}