/* Atlas de Maestrías SUNEDU — v2: animaciones del mapa, comparador y sesgo de ingeniería. Usa los tokens de app.css. */

/* ---------- Animaciones del mapa */
@keyframes pop { from { transform: scale(0); opacity: 0; } 70% { transform: scale(1.12); opacity: 1; } to { transform: scale(1); } }
.cbub.pop { animation: pop 420ms var(--ease) both; }
/* Radar: tres anillos que se abren y se desvanecen en bucle + núcleo que late */
.radar { position: relative; width: 120px; height: 120px; pointer-events: none; }
.radar i { position: absolute; left: 50%; top: 50%; width: 120px; height: 120px; margin: -60px 0 0 -60px; border-radius: 50%; border: 2px solid var(--support); opacity: 0; animation: radar 2.4s var(--ease) infinite; }
.radar i:nth-child(2) { animation-delay: .8s; }
.radar i:nth-child(3) { animation-delay: 1.6s; }
.radar b { position: absolute; left: 50%; top: 50%; width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%; background: color-mix(in srgb, var(--support) 35%, transparent); animation: latido 1.2s ease-in-out infinite alternate; }
.radar.has i { border-color: var(--accent); }
.radar.has b { background: color-mix(in srgb, var(--accent) 40%, transparent); }
@keyframes radar { 0% { transform: scale(.12); opacity: .95; } 70% { opacity: .35; } 100% { transform: scale(1); opacity: 0; } }
@keyframes latido { from { transform: scale(.8); } to { transform: scale(1.25); } }
/* Contorno del país: el borde se dibuja, el relleno aparece y luego "respira" */
.pais-trazo { stroke: var(--accent); fill: var(--accent); fill-opacity: 0; stroke-dasharray: 2400; stroke-dashoffset: 2400; animation: trazo 1.6s var(--ease) forwards, respira 3.2s ease-in-out 1.6s infinite alternate; }
@keyframes trazo { 60% { fill-opacity: 0; } to { stroke-dashoffset: 0; fill-opacity: .07; } }
@keyframes respira { from { fill-opacity: .07; stroke-opacity: 1; } to { fill-opacity: .13; stroke-opacity: .55; } }
.dep { stroke: var(--surface-2); fill: var(--accent); cursor: pointer; animation: depIn 600ms var(--ease) both; transition: fill-opacity var(--dur) var(--ease); }
.dep:hover { fill-opacity: .7 !important; stroke: var(--accent); }
@keyframes depIn { from { opacity: 0; } to { opacity: 1; } }
.quieto { animation: none !important; stroke-dashoffset: 0 !important; fill-opacity: .08; }
.panel-title { flex-wrap: wrap; }
.pais-sw { display: flex; gap: var(--sp-1); align-items: center; flex: none; }
.pais-sw select { height: 36px; max-width: 150px; border: var(--border) solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 0 var(--sp-2); font-size: var(--fs-ui); }
.icon-btn.sm { width: 28px; height: 28px; font-size: 12px; }

/* ---------- Botones de tarjeta, ingeniería, citas literales */
.btns { display: inline-flex; gap: var(--sp-1); flex: none; }
.save.cmp[aria-pressed="true"] { background: var(--support); border-color: var(--support); color: var(--support-ink); }
.ing-box { margin-top: var(--sp-3); padding: var(--sp-3); border: var(--border) dashed var(--line-strong); border-radius: var(--radius); }
.ing-h { font: 700 var(--fs-label) var(--font-mono); text-transform: uppercase; letter-spacing: .05em; color: var(--ink-soft); margin-bottom: var(--sp-2); }
blockquote.lit { margin: 0; padding: var(--sp-2) var(--sp-3); border-left: 3px solid var(--support); background: var(--support-soft); font-size: var(--fs-ui); line-height: var(--lh-body); border-radius: var(--radius); }
blockquote.lit.sm { font-size: var(--fs-label); max-height: 220px; overflow: auto; }

/* ---------- Vista Comparar */
.view-inner.wide { max-width: 1480px; }
.cmp-pick { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-5); margin-bottom: var(--sp-5); }
.cmp-pick h2 { font-size: var(--fs-h3); margin-bottom: var(--sp-2); display: flex; gap: var(--sp-2); align-items: baseline; }
.cmp-pick .chip { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.cmp-pick .chip small { font-weight: 400; opacity: .8; }
.cmp-q { width: 100%; height: 38px; padding: 0 var(--sp-3); border: var(--border) solid var(--line); border-radius: var(--radius); background: var(--surface-2); }
.cmp-q:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.cmp-res { max-height: 300px; overflow: auto; border: var(--border) solid var(--line); border-top: 0; background: var(--surface-2); }
.cmp-res:empty { display: none; }
.cmp-res .row[disabled] { opacity: .5; cursor: not-allowed; }
.cmp-wrap { overflow: auto; border: var(--border) solid var(--line); border-radius: var(--radius); background: var(--surface-2); max-height: calc(100vh - var(--top-h) - 140px); }
table.cmp { width: 100%; min-width: 900px; border-collapse: separate; border-spacing: 0; table-layout: fixed; font-size: var(--fs-ui); }
table.cmp th, table.cmp td { padding: var(--sp-3); border-bottom: var(--border) solid var(--line); border-right: var(--border) solid var(--line); vertical-align: top; text-align: left; }
table.cmp thead th { position: sticky; top: 0; z-index: 2; background: var(--surface-2); border-bottom: 2px solid var(--ink); }
table.cmp th.corner, table.cmp tbody th { position: sticky; left: 0; z-index: 1; background: var(--surface); width: 190px; font: 700 var(--fs-label) var(--font-mono); text-transform: uppercase; letter-spacing: .04em; color: var(--ink-soft); }
table.cmp th.corner { z-index: 3; }
table.cmp tbody th i { color: var(--accent); width: 16px; }
table.cmp tr.sep th { position: static; background: var(--surface-3); color: var(--ink); letter-spacing: .08em; padding: var(--sp-2) var(--sp-3); }
table.cmp tbody tr:not(.sep):hover td { background: color-mix(in srgb, var(--accent-soft) 45%, transparent); }
.cmp-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--sp-2); }
.cmp-name { display: block; font: 700 var(--fs-h3)/var(--lh-heading) var(--font-display); color: var(--ink); text-decoration: none; }
.cmp-name:hover { color: var(--accent); }
.cmp-uni { display: block; margin-top: var(--sp-1); font-weight: 600; font-size: var(--fs-ui); }
.cmp-h .es { font-size: var(--fs-label); color: var(--ink-mute); font-style: italic; }
.cmp-h.add .slot { display: grid; place-items: center; gap: var(--sp-1); min-height: 110px; border: 2px dashed var(--line); border-radius: var(--radius); color: var(--ink-mute); text-align: center; padding: var(--sp-3); font: 600 var(--fs-ui) var(--font-body); }
.cmp-h.add small { font-weight: 400; font-size: var(--fs-label); }
td.empty-col { background: repeating-linear-gradient(45deg, transparent 0 8px, var(--surface-3) 8px 9px); }
.cmp .plan { padding-left: var(--sp-4); max-height: 320px; overflow: auto; }
.cmp .txt { margin: 0; }
.cmp .alc { margin-bottom: var(--sp-1); }
.cmp .best { margin-left: var(--sp-1); }
.btn.sm { height: 30px; padding: 0 var(--sp-2); font-size: var(--fs-label); }
.webbox iframe { width: 100%; height: 520px; border: var(--border) solid var(--line); border-radius: var(--radius); margin-top: var(--sp-2); background: #fff; }
.cmp-empty { border: 2px dashed var(--line); border-radius: var(--radius); }
.cmp-empty > i { font-size: 32px; color: var(--accent); }
@media (max-width: 900px) {
  .cmp-pick { grid-template-columns: 1fr; }
  table.cmp th.corner, table.cmp tbody th { width: 120px; }
  .cmp-wrap { max-height: none; }
  .pais-sw select { max-width: 110px; }
  .panel-title { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) { .radar i, .radar b { animation: none !important; opacity: .5; } }
@media print {
  .top, .panel, #map, .legend, .map-tools, .cmp-pick, .v-head .saved-actions, .webbox, [data-web], .icon-btn, .views { display: none !important; }
  body { overflow: visible; background: #fff; color: #000; }
  .stage, .view { position: static !important; overflow: visible !important; padding: 0 !important; }
  .cmp-wrap { max-height: none; overflow: visible; border: 0; }
  table.cmp { min-width: 0; font-size: 10px; }
  table.cmp thead th, table.cmp th.corner, table.cmp tbody th { position: static; }
}
