/* =========================================================
   SMH GRAPHICS — "Tu Radio"
========================================================= */

.smhgfx-section {
    position: relative;
    overflow: hidden;
}

.smhgfx-overlay { position: absolute; inset: 0; z-index: 1; pointer-events: none; }

.smhgfx-bg-video { position: absolute; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.smhgfx-bg-video iframe,
.smhgfx-bg-video video {
    position: absolute; top: 50%; left: 50%;
    width: 100%; height: 100%;
    min-width: 177.78vh; min-height: 100%;
    transform: translate(-50%, -50%);
    object-fit: cover; border: 0; pointer-events: none;
}
.smhgfx-bg-shield { position: absolute; inset: 0; z-index: 1; }

.smhgfx-section .container { position: relative; z-index: 2; }

/* ---------- Contenedor circular ---------- */

.smhgfx-map {
    position: relative;
    width: min(var(--smhgfx-size, 360px), 84vw);
    height: min(var(--smhgfx-size, 360px), 84vw);
    margin-inline: auto;
    --radius: calc(min(var(--smhgfx-size, 360px), 84vw) / 2 - 58px);
}

/* ---------- Anillos decorativos giratorios (velocidad editable) ---------- */

.smhgfx-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 1px dashed rgba(255,255,255,.08);
    pointer-events: none;
}
.smhgfx-ring--outer {
    inset: 16%;
    border-style: dashed;
    opacity: .7;
}

.smhgfx-map--rotating .smhgfx-ring {
    background: conic-gradient(from 0deg, transparent 0%, var(--orange, #ff8400) 8%, transparent 22%, transparent 50%, var(--red, #ff0000) 62%, transparent 76%);
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 2px));
            mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 2px));
    border: 0;
    animation: smhgfx-spin var(--smhgfx-ring-duration, 26s) linear infinite;
    animation-direction: var(--smhgfx-ring-direction, normal);
}
.smhgfx-map--rotating .smhgfx-ring--outer {
    animation-duration: calc(var(--smhgfx-ring-duration, 26s) * 1.6);
    opacity: .45;
}

@keyframes smhgfx-spin { to { transform: rotate(360deg); } }

/* ---------- Centro "TU RADIO" ---------- */

.smhgfx-center {
    position: absolute;
    left: 50%; top: 50%;
    width: 116px; height: 116px;
    transform: translate(-50%, -50%);
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--red, #ff0000), var(--orange, #ff8400));
    color: #fff;
    text-decoration: none;
    box-shadow: 0 0 50px rgba(255,100,31,.28);
    transition: transform .25s cubic-bezier(.2,.8,.2,1), box-shadow .3s ease;
}
.smhgfx-center:hover { transform: translate(-50%, -50%) scale(1.05); box-shadow: 0 0 65px rgba(255,100,31,.4); }

.smhgfx-center-glow {
    position: absolute;
    inset: -14px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,100,31,.35), transparent 70%);
    z-index: -1;
    animation: smhgfx-pulse 2.6s ease-in-out infinite;
}
@keyframes smhgfx-pulse {
    0%, 100% { opacity: .5; transform: scale(.9); }
    50%      { opacity: 1;  transform: scale(1.12); }
}

.smhgfx-center-line1 { font-size: .58rem; font-weight: 800; letter-spacing: .06em; }
.smhgfx-center-line2 { font-size: 1.15rem; font-weight: 900; line-height: 1.1; }

/* ---------- Nodos: pivote rotado + ancla contra-rotada ---------- */

.smhgfx-node-pos {
    position: absolute;
    left: 50%; top: 50%;
    width: 0; height: 0;
    transform: rotate(var(--angle, 0deg));
    z-index: 2;
}

.smhgfx-line {
    position: absolute;
    left: 0; top: 0;
    width: var(--radius, 120px);
    height: 2px;
    transform-origin: left center;
    background: linear-gradient(90deg, rgba(255,100,31,.5), rgba(255,100,31,.05));
}
.smhgfx-line--animated {
    background: repeating-linear-gradient(90deg, rgba(255,100,31,.65) 0 6px, transparent 6px 14px);
    background-size: 200% 100%;
    animation: smhgfx-flow 1.6s linear infinite;
}
@keyframes smhgfx-flow { from { background-position: 0 0; } to { background-position: -20px 0; } }

.smhgfx-node-anchor {
    position: absolute;
    left: var(--radius, 120px);
    top: 0;
    transform: translate(-50%, -50%) rotate(calc(var(--angle, 0deg) * -1));
}

.smhgfx-node {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 92px;
    padding: 9px 14px;
    border: 1px solid var(--border, rgba(255,255,255,.10));
    border-radius: 999px;
    background: var(--black-card, #121214);
    color: var(--gray, #aaaab1);
    font-size: .68rem;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 10px 24px rgba(0,0,0,.25);
    animation: smhgfx-float 3.4s ease-in-out infinite;
    transition: transform .2s ease, border-color .25s ease, color .25s ease;
}
.smhgfx-node:hover {
    transform: translateY(-3px) scale(1.05);
    border-color: rgba(255,100,31,.4);
    color: var(--white, #fff);
}
@keyframes smhgfx-float {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-5px); }
}

.smhgfx-node-icon { font-size: .82rem; line-height: 1; }

/* ---------- Responsive ---------- */

@media (max-width: 760px) {
    .smhgfx-map { --radius: calc(min(var(--smhgfx-size, 360px), 78vw) / 2 - 46px); }
    .smhgfx-center { width: 96px; height: 96px; }
    .smhgfx-center-line2 { font-size: 1rem; }
    .smhgfx-node { min-width: 0; padding: 7px 11px; font-size: .62rem; }
}

/* ---------- Accesibilidad ---------- */

@media (prefers-reduced-motion: reduce) {
    .smhgfx-map--rotating .smhgfx-ring,
    .smhgfx-center-glow,
    .smhgfx-line--animated,
    .smhgfx-node {
        animation: none !important;
    }
}

/* Fuera de viewport: animaciones en pausa (ahorro de batería/CPU),
   reactivado por IntersectionObserver en graphics.js */
.smhgfx-map--paused .smhgfx-ring,
.smhgfx-map--paused .smhgfx-center-glow,
.smhgfx-map--paused .smhgfx-line--animated,
.smhgfx-map--paused .smhgfx-node {
    animation-play-state: paused;
}
