/* Interactive 3D Globe - Frontend Styles */

/* ── Container: ensures globe stays within bounds ── */
.i3dg-globe-wrap {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    background: #000011;
    width: 100%;
    box-sizing: border-box;
}

.i3dg-globe-container {
    width: 100% !important;
    height: 100% !important;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Force the canvas rendered by globe.gl to fit within the container */
.i3dg-globe-container canvas {
    outline: none;
    display: block;
    max-width: 100%;
    max-height: 100%;
}

/* globe.gl injects a scene-container div — keep it contained */
.i3dg-globe-container > div {
    width: 100% !important;
    height: 100% !important;
}

/* Ensure the HTML overlay layer allows pointer events on markers */
.i3dg-globe-container .scene-tooltip,
.i3dg-globe-container .scene-nav-info {
    pointer-events: none !important;
}


/* ── Marker Pin (HTML overlay) ── */
.i3dg-marker-pin {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    cursor: pointer;
    position: relative;
    transition: transform 0.2s ease;
}

.i3dg-marker-pin:hover {
    transform: scale(1.3);
}

.i3dg-marker-pin::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border-radius: 50%;
    animation: i3dg-pulse 2s ease-in-out infinite;
    opacity: 0.4;
}

@keyframes i3dg-pulse {
    0%, 100% { transform: scale(1); opacity: 0.4; }
    50%      { transform: scale(1.6); opacity: 0; }
}

/* ── SVG Marker Icon ── */
.i3dg-marker-svg {
    cursor: pointer;
    position: relative;
    transition: transform 0.2s ease, filter 0.2s ease;
    line-height: 0;
}

.i3dg-marker-svg:hover {
    transform: translate(-50%, -100%) scale(1.2);
    filter: drop-shadow(0 0 8px currentColor) !important;
}

.i3dg-marker-svg svg,
.i3dg-marker-svg path,
.i3dg-marker-svg circle,
.i3dg-marker-svg rect,
.i3dg-marker-svg polygon,
.i3dg-marker-svg line,
.i3dg-marker-svg ellipse,
.i3dg-marker-svg g {
    pointer-events: none;
}

/* ── Info Popup ── */
.i3dg-popup {
    position: absolute;
    z-index: 1000;
    max-width: 360px;
    min-width: 260px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 20px 60px rgba(0,0,0,0.6), 0 0 30px rgba(0,0,0,0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    overflow: hidden;
    pointer-events: auto;
    opacity: 0;
    transform: translateY(10px) scale(0.95);
    transition: opacity 0.3s ease, transform 0.3s ease;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.i3dg-popup.i3dg-popup--visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.i3dg-popup-close {
    position: absolute;
    top: 10px;
    right: 12px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.1);
    color: #fff;
    font-size: 16px;
    line-height: 28px;
    text-align: center;
    cursor: pointer;
    z-index: 2;
    transition: background 0.2s;
    padding: 0;
}

.i3dg-popup-close:hover {
    background: rgba(255,255,255,0.25);
}

.i3dg-popup-image {
    width: 100%;
    height: 140px;
    object-fit: cover;
    display: block;
}

.i3dg-popup-body {
    padding: 16px 20px 20px;
}

.i3dg-popup-title {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 8px 0;
    line-height: 1.3;
    padding-right: 30px;
}

.i3dg-popup-desc {
    font-size: 14px;
    line-height: 1.6;
    margin: 0 0 14px 0;
    opacity: 0.85;
}

.i3dg-popup-link {
    display: inline-block;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    padding: 8px 18px;
    border-radius: 6px;
    transition: opacity 0.2s, transform 0.2s;
}

.i3dg-popup-link:hover {
    opacity: 0.85;
    transform: translateX(2px);
}

/* ── Responsive ── */
@media (max-width: 600px) {
    .i3dg-popup {
        max-width: calc(100vw - 40px);
        min-width: 200px;
    }
    .i3dg-popup-image {
        height: 100px;
    }
}
