/**
 * Radar Section Styles
 * Styles for the radar visualization, blips, detail cards, and mobile timeline
 */

/* ── Radar Section: prevent internal scrolling ── */
#radar-section {
    overflow: hidden !important;
}

/* ── Dot Grid Background ── */
.dot-grid {
    background-image: radial-gradient(circle, rgba(34,211,238,0.06) 1px, transparent 1px);
    background-size: 28px 28px;
}

/* ── Radar Container ── */
.radar-container {
    position: relative;
    width: min(680px, 88vw);
    height: min(680px, 88vw);
    margin: 0 auto;
}

/* ── Radar Rings ── */
.radar-rings {
    position: absolute;
    inset: 0;
}

.radar-ring {
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(34,211,238,0.2);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}
.radar-ring:nth-child(1) { width: 25%; height: 25%; }
.radar-ring:nth-child(2) { width: 45%; height: 45%; }
.radar-ring:nth-child(3) { width: 65%; height: 65%; }
.radar-ring:nth-child(4) { width: 85%; height: 85%; border-color: rgba(34,211,238,0.05); }
.radar-ring:nth-child(5) { width: 100%; height: 100%; border-color: rgba(34,211,238,0.04); }

/* ── Cross-hair lines ── */
.crosshair-h, .crosshair-v {
    position: absolute;
    background: rgba(34,211,238,0.04);
}
.crosshair-h { width: 100%; height: 1px; top: 50%; left: 0; }
.crosshair-v { height: 100%; width: 1px; left: 50%; top: 0; }

/* ── Sweep animation ── */
.radar-sweep {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    animation: sweep 6s linear infinite;
    transform-origin: center center;
    opacity: 0;
    transition: opacity 0.8s ease;
}
.radar-sweep.active { opacity: 1; }

.radar-sweep::before {
    content: '';
    position: absolute;
    top: 0; left: 50%;
    width: 50%; height: 50%;
    transform-origin: bottom left;
    background: conic-gradient(
        from 0deg at 0% 100%,
        transparent 0deg,
        rgba(34,211,238,0.18) 25deg,
        rgba(34,211,238,0.06) 50deg,
        transparent 70deg
    );
    border-radius: 0 100% 0 0;
}

@keyframes sweep {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* ── Center hub ── */
.center-hub {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    text-align: center;
}
.center-pulse {
    position: absolute;
    inset: -12px;
    border-radius: 50%;
    border: 1.5px solid rgba(34,211,238,0.25);
    animation: pulse-ring 3s ease-out infinite;
}
.center-pulse:nth-child(2) { animation-delay: 1s; }
.center-pulse:nth-child(3) { animation-delay: 2s; }

@keyframes pulse-ring {
    0%   { transform: scale(1); opacity: 0.6; }
    100% { transform: scale(2.2); opacity: 0; }
}

/* ── Blips ── */
.blip {
    position: absolute;
    transform: translate(-50%, -50%);
    z-index: 20;
    cursor: pointer;
    transition: transform 0.3s ease, opacity 0.6s ease;
    opacity: 1;
}
.blip:hover { transform: translate(-50%, -50%) scale(1.12); }
.blip.revealed { opacity: 1; }

.blip-dot {
    width: 14px; height: 14px;
    border-radius: 50%;
    background: #22d3ee;
    box-shadow: 0 0 12px rgba(34,211,238,0.6), 0 0 30px rgba(34,211,238,0.2);
    position: relative;
    transition: all 0.3s ease;
}
.blip:hover .blip-dot,
.blip.active .blip-dot {
    background: #67e8f9;
    box-shadow: 0 0 18px rgba(103,232,249,0.8), 0 0 45px rgba(103,232,249,0.3);
    transform: scale(1.3);
}

.blip-ping {
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 1px solid rgba(34,211,238,0.4);
    animation: blip-ping 2.5s ease-out infinite;
    opacity: 1;
}
.blip.revealed .blip-ping { opacity: 1; }

@keyframes blip-ping {
    0%   { transform: scale(1); opacity: 0.5; }
    100% { transform: scale(3); opacity: 0; }
}

.blip-label {
    position: absolute;
    white-space: nowrap;
    font-family: 'Space Mono', monospace;
    font-size: 12px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: rgba(148,163,184,0.7);
    transition: color 0.3s ease;
    pointer-events: none;
}
.blip:hover .blip-label,
.blip.active .blip-label {
    color: #e2e8f0;
}

/* ── Connection lines (SVG) ── */
.connection-line {
    stroke: rgba(34,211,238,0.25);
    stroke-width: 1.5;
    fill: none;
    transition: all 0.4s ease;
}
.connection-line.active {
    stroke: rgba(34,211,238,0.45);
    stroke-width: 1.5;
    filter: drop-shadow(0 0 4px rgba(34,211,238,0.3));
}

/* ── Detail Card ── */
.detail-card {
    position: absolute;
    width: 320px;
    padding: 24px;
    background: rgba(11, 17, 32, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(34,211,238,0.12);
    border-radius: 12px;
    opacity: 0;
    pointer-events: none;
    transform: translateY(8px) scale(0.96);
    transition: all 0.35s cubic-bezier(0.16,1,0.3,1);
    z-index: 50;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5), 0 0 40px rgba(34,211,238,0.05);
    display: flex;
    flex-direction: column;
}
.detail-card.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}
.detail-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #22d3ee, transparent);
    border-radius: 12px 12px 0 0;
}

.card-tag {
    display: inline-block;
    font-family: 'Space Mono', monospace;
    font-size: 9px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 4px;
    background: rgba(34,211,238,0.1);
    color: #67e8f9;
    border: 1px solid rgba(34,211,238,0.15);
    margin-bottom: 10px;
}
.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #f1f5f9;
    line-height: 1.3;
    margin-bottom: 8px;
}
.card-provider {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 12px;
    font-style: italic;
}
.card-desc {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.6;
    margin-bottom: 14px;
}
.card-stat {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: 'Space Mono', monospace;
    font-size: 11px;
    color: #67e8f9;
}
.card-stat-bar {
    flex: 1;
    height: 3px;
    background: rgba(34,211,238,0.1);
    border-radius: 2px;
    overflow: hidden;
}
.card-stat-fill {
    height: 100%;
    background: linear-gradient(90deg, #22d3ee, #67e8f9);
    border-radius: 2px;
    transition: width 0.8s cubic-bezier(0.16,1,0.3,1);
    width: 0;
}
.detail-card.visible .card-stat-fill {
    width: var(--coverage);
}

.card-detail-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 14px;
    margin-left: auto;
    padding: 8px 14px;
    font-family: 'Space Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #67e8f9;
    text-decoration: none;
    border: 1px solid rgba(34,211,238,0.25);
    border-radius: 6px;
    background: rgba(34,211,238,0.05);
    transition: all 0.25s ease;
}
.card-detail-link:hover {
    background: rgba(34,211,238,0.15);
    border-color: rgba(34,211,238,0.4);
    transform: translateX(2px);
}
.card-detail-link svg {
    transition: transform 0.25s ease;
}
.card-detail-link:hover svg {
    transform: translateX(3px);
}

/* ── Section fade in ── */
.radar-section-content {
    opacity: 1;
    transform: translateY(0);
    transition: all 1s cubic-bezier(0.16,1,0.3,1);
}
.radar-section-content.in-view {
    opacity: 1;
    transform: translateY(0);
}

/* ── Mobile timeline ── */
.mobile-timeline { display: none; }

@media (max-width: 768px) {
    .radar-desktop { display: none !important; }
    .mobile-timeline { display: block; }

    .timeline-line {
        position: absolute;
        left: 24px;
        top: 0; bottom: 0;
        width: 2px;
        background: linear-gradient(180deg, transparent, rgba(34,211,238,0.3) 10%, rgba(34,211,238,0.3) 90%, transparent);
    }
    .timeline-pulse {
        position: absolute;
        left: 24px;
        top: 0;
        width: 2px;
        height: 60px;
        background: linear-gradient(180deg, transparent, #22d3ee, transparent);
        animation: timeline-scroll 4s ease-in-out infinite;
    }
    @keyframes timeline-scroll {
        0%, 100% { top: 0; }
        50% { top: calc(100% - 60px); }
    }

    .timeline-card {
        position: relative;
        padding-left: 52px;
        padding-bottom: 32px;
        opacity: 0;
        transform: translateX(-16px);
        transition: all 0.5s cubic-bezier(0.16,1,0.3,1);
    }
    .timeline-card.revealed {
        opacity: 1;
        transform: translateX(0);
    }
    .timeline-dot {
        position: absolute;
        left: 18px;
        top: 6px;
        width: 14px; height: 14px;
        border-radius: 50%;
        background: #22d3ee;
        box-shadow: 0 0 12px rgba(34,211,238,0.5);
    }
    .timeline-dot::after {
        content: '';
        position: absolute;
        inset: -5px;
        border-radius: 50%;
        border: 1px solid rgba(34,211,238,0.3);
        animation: blip-ping 2.5s ease-out infinite;
    }
    .timeline-card-inner {
        background: rgba(11,17,32,0.9);
        backdrop-filter: blur(16px);
        border: 1px solid rgba(34,211,238,0.1);
        border-radius: 10px;
        padding: 18px;
        transition: border-color 0.3s ease, background-color 0.3s ease;
    }
    .timeline-card-inner:hover,
    .timeline-card-inner:active {
        border-color: rgba(34,211,238,0.3);
        background: rgba(11,17,32,0.95);
    }
    .timeline-card-inner .card-title { font-size: 14px; }
    .timeline-card-inner .card-desc { font-size: 12px; }
}

/* ── Particle Dust Background ── */
.particle-dust {
    position: absolute;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: #22d3ee;
    box-shadow: 0 0 4px rgba(34,211,238,0.6);
    pointer-events: none;
    z-index: 1;
}

.particle-dust:nth-child(1) { top: 15%; left: 10%; animation: dust-float 8s ease-in-out infinite; animation-delay: 0s; }
.particle-dust:nth-child(2) { top: 25%; left: 25%; animation: dust-float 10s ease-in-out infinite; animation-delay: 1s; }
.particle-dust:nth-child(3) { top: 35%; left: 15%; animation: dust-float 12s ease-in-out infinite; animation-delay: 2s; }
.particle-dust:nth-child(4) { top: 45%; left: 30%; animation: dust-float 9s ease-in-out infinite; animation-delay: 0.5s; }
.particle-dust:nth-child(5) { top: 55%; left: 20%; animation: dust-float 11s ease-in-out infinite; animation-delay: 1.5s; }
.particle-dust:nth-child(6) { top: 65%; left: 12%; animation: dust-float 7s ease-in-out infinite; animation-delay: 2.5s; }
.particle-dust:nth-child(7) { top: 75%; left: 28%; animation: dust-float 13s ease-in-out infinite; animation-delay: 0.8s; }
.particle-dust:nth-child(8) { top: 85%; left: 18%; animation: dust-float 9s ease-in-out infinite; animation-delay: 1.8s; }
.particle-dust:nth-child(9) { top: 20%; right: 15%; animation: dust-float 8s ease-in-out infinite; animation-delay: 3s; }
.particle-dust:nth-child(10) { top: 30%; right: 25%; animation: dust-float 11s ease-in-out infinite; animation-delay: 0.3s; }
.particle-dust:nth-child(11) { top: 40%; right: 20%; animation: dust-float 10s ease-in-out infinite; animation-delay: 1.3s; }
.particle-dust:nth-child(12) { top: 50%; right: 12%; animation: dust-float 12s ease-in-out infinite; animation-delay: 2.3s; }
.particle-dust:nth-child(13) { top: 60%; right: 28%; animation: dust-float 9s ease-in-out infinite; animation-delay: 3.3s; }
.particle-dust:nth-child(14) { top: 70%; right: 18%; animation: dust-float 8s ease-in-out infinite; animation-delay: 0.6s; }
.particle-dust:nth-child(15) { top: 80%; right: 22%; animation: dust-float 11s ease-in-out infinite; animation-delay: 1.6s; }

@keyframes dust-float {
    0%, 100% {
        transform: translate(0, 0);
        opacity: 0.3;
    }
    25% {
        transform: translate(10px, -20px);
        opacity: 0.8;
    }
    50% {
        transform: translate(-5px, -30px);
        opacity: 0.4;
    }
    75% {
        transform: translate(-10px, -15px);
        opacity: 0.7;
    }
}

/* ── Scroll hint ── */
.scroll-hint {
    animation: float-hint 2s ease-in-out infinite;
}
@keyframes float-hint {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(6px); }
}
