/* ============================================================
   قسم "معاينة الخريطة الحية ثلاثية الأبعاد" - الصفحة الرئيسية
   يعتمد على متغيرات الهوية البصرية المعرّفة في home-modern.css
   (--primary-dark / --primary-darker / --gold / --radius-lg ...)
   ============================================================ */

.live-map-3d-panel {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: radial-gradient(120% 140% at 50% 0%, #163d2a 0%, var(--primary-darker) 65%, #06110c 100%);
    box-shadow: var(--shadow-lg);
    min-height: 420px;
    isolation: isolate;
}

.live-map-3d-canvas-holder {
    position: absolute;
    inset: 0;
    z-index: 1;
}

    .live-map-3d-canvas-holder canvas {
        display: block;
        width: 100% !important;
        height: 100% !important;
    }

/* ---------- شارة "مباشر" أعلى يسار اللوحة ---------- */
.live-map-badge {
    position: absolute;
    top: 20px;
    inset-inline-start: 20px;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(8, 23, 18, 0.65);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #fff;
    font-weight: 800;
    font-size: 0.8rem;
    padding: 8px 14px;
    border-radius: var(--radius-full);
}

.live-map-badge .dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #ef4444;
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6);
    animation: liveMapPulseDot 1.6s ease-out infinite;
}

.live-map-badge.is-active .dot {
    background: #2f9e6e;
    box-shadow: 0 0 0 0 rgba(47, 158, 110, 0.6);
}

@keyframes liveMapPulseDot {
    0%   { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.55); }
    70%  { box-shadow: 0 0 0 9px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.live-map-badge.is-active .dot { animation-name: liveMapPulseDotGreen; }

@keyframes liveMapPulseDotGreen {
    0%   { box-shadow: 0 0 0 0 rgba(47, 158, 110, 0.55); }
    70%  { box-shadow: 0 0 0 9px rgba(47, 158, 110, 0); }
    100% { box-shadow: 0 0 0 0 rgba(47, 158, 110, 0); }
}

/* ---------- تذييل اللوحة: عدّاد + زر الانتقال للخريطة الكاملة ---------- */
.live-map-footer {
    position: absolute;
    bottom: 0;
    inset-inline: 0;
    z-index: 3;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 18px 22px;
    background: linear-gradient(to top, rgba(6, 17, 12, 0.85), transparent);
}

.live-map-footer-text {
    color: #eaf3ee;
}

    .live-map-footer-text strong {
        color: #fff;
        font-weight: 900;
    }

    .live-map-footer-text small {
        display: block;
        color: rgba(234, 243, 238, 0.65);
        font-size: 0.78rem;
        margin-top: 2px;
    }

/* ---------- بديل بلا WebGL (prefers-reduced-motion / شاشات ضيقة / فشل التحميل) ---------- */
.live-map-fallback {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 32px;
    background:
        radial-gradient(circle at 30% 30%, rgba(201, 162, 39, 0.10), transparent 55%),
        radial-gradient(circle at 70% 70%, rgba(47, 158, 110, 0.14), transparent 55%);
}

.live-map-3d-panel.is-3d-ready .live-map-fallback {
    display: none;
}

.live-map-fallback-ring {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    border: 2px dashed rgba(201, 162, 39, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
    position: relative;
}

.live-map-fallback-ring i {
    font-size: 2.1rem;
    color: var(--gold);
}

.live-map-fallback-ring .fallback-dot {
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--secondary-color);
    animation: liveMapFallbackOrbit 5s linear infinite;
}

@keyframes liveMapFallbackOrbit {
    from { transform: rotate(0deg) translateX(48px) rotate(0deg); }
    to   { transform: rotate(360deg) translateX(48px) rotate(-360deg); }
}

.live-map-fallback h4 {
    color: #fff;
    font-weight: 800;
    margin-bottom: 6px;
}

.live-map-fallback p {
    color: rgba(234, 243, 238, 0.7);
    max-width: 380px;
    margin: 0 auto;
    font-size: 0.92rem;
}

@media (prefers-reduced-motion: reduce) {
    .live-map-fallback-ring .fallback-dot { animation: none; }
}

@media (max-width: 992px) {
    .live-map-3d-panel { min-height: 340px; }
}
