/* Mapa mundial inspirado en una sala de monitoreo, adaptado a la paleta de Guido Canales. */
.world-frame {
    isolation: isolate;
    overflow: hidden;
    border: 1px solid rgba(135, 208, 222, .2);
    border-radius: 10px;
    background:
        radial-gradient(circle at 50% 48%, rgba(22, 92, 113, .7) 0, rgba(5, 29, 43, .96) 52%, #041621 100%);
    box-shadow:
        0 22px 48px rgba(4, 25, 37, .2),
        inset 0 0 55px rgba(2, 12, 19, .72);
}

.world-frame::before {
    content: "";
    position: absolute;
    z-index: 0;
    inset: 0;
    display: block;
    width: auto;
    height: auto;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(128, 218, 226, .045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(128, 218, 226, .045) 1px, transparent 1px),
        radial-gradient(circle at 50% 50%, transparent 25%, rgba(1, 12, 20, .42) 100%);
    background-size: 24px 24px, 24px 24px, 100% 100%;
}

.world-frame::after {
    content: "";
    position: absolute;
    z-index: 2;
    top: -32%;
    right: 0;
    left: 0;
    height: 30%;
    pointer-events: none;
    opacity: .55;
    background: linear-gradient(180deg, transparent, rgba(122, 229, 224, .08), transparent);
    animation: guido-map-scan 7s linear infinite;
}

#world-globe {
    position: absolute;
    z-index: 1;
    inset: 0;
    width: 100%;
    height: 100%;
    cursor: grab;
    filter: saturate(1.08) contrast(1.02);
    touch-action: none;
}

#world-globe.is-dragging { cursor: grabbing; }
.world-frame[data-map-mode="plane"] #world-globe { cursor: move; }
.world-frame[data-map-mode="plane"] #world-globe.is-dragging { cursor: grabbing; }

#world-globe:focus-visible {
    outline: 2px solid rgba(185, 244, 242, .95);
    outline-offset: -4px;
    border-radius: inherit;
}

.globe-legend,
.globe-toolbar,
.globe-controls,
.world-caption,
.globe-tooltip {
    font-family: var(--font-sans);
}

.globe-legend {
    position: absolute;
    z-index: 4;
    top: 10px;
    left: 10px;
    display: flex;
    max-width: 48%;
    flex-wrap: wrap;
    gap: 5px 10px;
    padding: 7px 9px;
    border: 1px solid rgba(179, 230, 233, .14);
    border-radius: 5px;
    background: rgba(3, 22, 33, .62);
    color: #eefcfd;
    font-size: .58rem;
    font-weight: 650;
    letter-spacing: .045em;
    text-transform: uppercase;
    box-shadow: 0 7px 18px rgba(0, 10, 18, .17);
    backdrop-filter: blur(9px);
}

.globe-legend span { display: inline-flex; align-items: center; gap: 5px; }

.globe-legend i {
    display: inline-block;
    width: 7px;
    height: 7px;
    flex: 0 0 7px;
    border-radius: 50%;
    box-shadow: 0 0 8px currentColor;
}

.globe-legend .is-completed { background: #ff9a68; color: #ff9a68; }
.globe-legend .is-upcoming { border: 1px solid #d9ffff; background: #51d4ce; color: #51d4ce; }

.globe-toolbar {
    position: absolute;
    z-index: 6;
    top: 10px;
    right: 10px;
    display: flex;
    align-items: stretch;
    gap: 5px;
}

.globe-view-switch {
    display: flex;
    padding: 3px;
    border: 1px solid rgba(179, 230, 233, .18);
    border-radius: 6px;
    background: rgba(3, 22, 33, .7);
    box-shadow: 0 7px 18px rgba(0, 10, 18, .18);
    backdrop-filter: blur(9px);
}

.globe-view-switch button,
.globe-color-toggle,
.globe-controls button {
    appearance: none;
    border: 0;
    color: rgba(226, 248, 249, .75);
    cursor: pointer;
}

.globe-view-switch button {
    display: inline-flex;
    min-height: 26px;
    align-items: center;
    gap: 5px;
    padding: 4px 7px;
    border-radius: 4px;
    background: transparent;
    font-size: .57rem;
    letter-spacing: .045em;
    text-transform: uppercase;
    transition: color .18s ease, background-color .18s ease, box-shadow .18s ease;
}

.globe-view-switch button span { color: #6edbd6; font-size: .5rem; }
.globe-view-switch button b,
.globe-color-toggle b { font: inherit; font-weight: 750; }

.globe-view-switch button:hover,
.globe-view-switch button.is-active {
    background: rgba(75, 185, 185, .2);
    color: #fff;
    box-shadow: inset 0 0 0 1px rgba(128, 235, 229, .18);
}

.globe-color-toggle {
    display: inline-flex;
    min-width: 58px;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 5px 7px;
    border: 1px solid rgba(179, 230, 233, .18);
    border-radius: 6px;
    background: rgba(3, 22, 33, .7);
    font-size: .57rem;
    letter-spacing: .045em;
    text-transform: uppercase;
    box-shadow: 0 7px 18px rgba(0, 10, 18, .18);
    backdrop-filter: blur(9px);
}

.globe-color-toggle i {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: conic-gradient(#42c3be, #658ed1, #ce7a64, #dfaf55, #42c3be);
    box-shadow: 0 0 8px rgba(108, 223, 216, .42);
}

.globe-color-toggle[aria-pressed="false"] i { background: #6e99a6; }
.globe-color-toggle:hover { color: #fff; border-color: rgba(162, 239, 235, .42); }

.globe-controls {
    position: absolute;
    z-index: 6;
    right: 10px;
    bottom: 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.globe-controls button {
    display: grid;
    width: 32px;
    height: 32px;
    place-items: center;
    padding: 0;
    border: 1px solid rgba(179, 230, 233, .2);
    border-radius: 5px;
    background: rgba(3, 22, 33, .72);
    font: 650 .92rem/1 var(--font-sans);
    box-shadow: 0 7px 18px rgba(0, 10, 18, .18);
    backdrop-filter: blur(9px);
    transition: color .18s ease, background-color .18s ease, transform .18s ease;
}

.globe-controls button:hover { background: rgba(51, 151, 157, .55); color: #fff; }
.globe-controls button:active { transform: scale(.94); }

.globe-view-switch button:focus-visible,
.globe-color-toggle:focus-visible,
.globe-controls button:focus-visible,
.globe-tooltip-gallery:focus-visible {
    outline: 2px solid #c8fffb;
    outline-offset: 2px;
}

.world-caption {
    position: absolute;
    z-index: 4;
    bottom: 10px;
    left: 10px;
    display: inline-flex;
    max-width: calc(100% - 62px);
    align-items: center;
    gap: 7px;
    padding: 6px 8px;
    border: 1px solid rgba(179, 230, 233, .14);
    border-radius: 5px;
    background: rgba(3, 22, 33, .64);
    color: rgba(226, 248, 249, .78);
    font-size: .55rem;
    letter-spacing: .105em;
    line-height: 1.25;
    text-transform: uppercase;
    box-shadow: 0 7px 18px rgba(0, 10, 18, .15);
    backdrop-filter: blur(9px);
}

.world-caption span {
    width: 6px;
    height: 6px;
    flex: 0 0 6px;
    margin: 0;
    border-radius: 50%;
    background: #65e0d9;
    box-shadow: 0 0 8px #65e0d9;
    animation: guido-map-pulse 1.7s ease-in-out infinite;
}

.world-caption b { font: inherit; font-weight: 650; }
.world-caption-mobile { display: none; }

.globe-tooltip {
    position: absolute;
    z-index: 8;
    display: none;
    width: 184px;
    max-width: calc(100% - 20px);
    gap: 3px;
    padding: 10px 11px;
    border: 1px solid rgba(143, 225, 223, .25);
    border-radius: 6px;
    background: rgba(3, 20, 31, .95);
    color: #fff;
    box-shadow: 0 12px 28px rgba(0, 8, 14, .42), inset 3px 0 0 #ff9565;
    pointer-events: none;
    font-size: .7rem;
    line-height: 1.35;
    backdrop-filter: blur(12px);
}

.globe-tooltip.is-visible { display: grid; }
.globe-tooltip.has-gallery { gap: 5px; padding: 11px; pointer-events: auto; }
.globe-tooltip strong { color: #fff; font-size: .72rem; }
.globe-tooltip > span { color: #9fc6ce; font-size: .62rem; }

.globe-tooltip-gallery {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    margin-top: 4px;
    padding: 7px 8px;
    border: 1px solid rgba(255, 149, 101, .5);
    border-radius: 4px;
    background: rgba(255, 149, 101, .1);
    color: #fff;
    cursor: pointer;
    font: 700 .61rem/1.2 var(--font-sans);
    letter-spacing: .05em;
    text-align: left;
}

.globe-tooltip-gallery::after { content: "↗"; margin-left: 8px; color: #ffac85; font-size: .78rem; }
.globe-tooltip-gallery:hover { background: #ff9a68; color: #071d2a; }
.globe-tooltip-gallery:hover::after { color: #071d2a; }

@keyframes guido-map-scan {
    from { transform: translateY(0); }
    to { transform: translateY(440%); }
}

@keyframes guido-map-pulse {
    0%, 100% { opacity: .55; transform: scale(.82); }
    50% { opacity: 1; transform: scale(1.12); }
}

@media (max-width: 800px) {
    #world-globe { touch-action: pan-y; }
    .globe-controls { display: flex; }
    .world-caption-desktop { display: none; }
    .world-caption-mobile { display: inline; }
    .globe-tooltip { width: min(190px, calc(100% - 20px)); }
}

@media (max-width: 560px) {
    .globe-legend {
        top: 8px;
        left: 8px;
        max-width: 44%;
        flex-direction: column;
        gap: 3px;
        padding: 6px 7px;
        font-size: .52rem;
    }

    .globe-toolbar { top: 8px; right: 8px; }
    .globe-view-switch button { min-height: 27px; padding-inline: 7px; }
    .globe-view-switch button b { display: none; }
    .globe-color-toggle { min-width: 34px; padding-inline: 7px; }
    .globe-color-toggle b { display: none; }
    .globe-controls { right: 8px; bottom: 8px; }
    .globe-controls button { width: 36px; height: 36px; }
    .world-caption { bottom: 8px; left: 8px; max-width: calc(100% - 58px); font-size: .51rem; letter-spacing: .075em; }
    .globe-tooltip { font-size: .66rem; }
}

@media (prefers-reduced-motion: reduce) {
    .world-frame::after,
    .world-caption span { animation: none; }
}
