/* =====================================================
   GPS SMART CITY HERO ANIMATION
   City with landmarks (school, hospital, fire station,
   police, mall, houses) + highway with tracked vehicles
   ===================================================== */

/* ===== SCENE CONTAINER ===== */
.hero-city-scene {
    position: relative;
    width: 100%;
    height: 420px;
    overflow: hidden;
    border-radius: var(--radius-xl);
    background: linear-gradient(180deg, #0a1628 0%, #0f1f3d 35%, #162d55 65%, #1a3565 100%);
}

/* ===== SKY GLOW ===== */
.hero-city-scene::before {
    content: '';
    position: absolute;
    top: -20%;
    left: 30%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(247,148,29,.1) 0%, transparent 70%);
    border-radius: 50%;
    animation: skyGlow 6s ease-in-out infinite;
    pointer-events: none;
}

@keyframes skyGlow {
    0%, 100% { opacity: .5; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.15); }
}

/* ===== STARS ===== */
.city-stars { position: absolute; inset: 0; pointer-events: none; }
.city-star {
    position: absolute;
    width: 2px; height: 2px;
    background: #fff; border-radius: 50%;
    animation: twinkle 3s ease-in-out infinite;
}
.city-star:nth-child(1) { top: 6%; left: 10%; }
.city-star:nth-child(2) { top: 4%; left: 30%; animation-delay: 1s; width: 3px; height: 3px; }
.city-star:nth-child(3) { top: 12%; left: 50%; animation-delay: .5s; }
.city-star:nth-child(4) { top: 3%; left: 70%; animation-delay: 2s; }
.city-star:nth-child(5) { top: 8%; left: 85%; animation-delay: 1.5s; }
.city-star:nth-child(6) { top: 15%; left: 18%; animation-delay: .8s; width: 3px; height: 3px; }
.city-star:nth-child(7) { top: 5%; left: 45%; animation-delay: 2.5s; }
.city-star:nth-child(8) { top: 10%; left: 62%; animation-delay: 1.2s; }

@keyframes twinkle {
    0%, 100% { opacity: .2; }
    50% { opacity: 1; }
}

/* ===== MAP GRID ===== */
.city-map-grid {
    position: absolute; inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,.015) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.015) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none; z-index: 1;
}

/* ===== SATELLITE ===== */
.satellite-signals {
    position: absolute; top: 25px; right: 35px; z-index: 2; opacity: .5;
}
.sat-arc {
    position: absolute;
    border: 1.5px solid rgba(247,148,29,.3);
    border-radius: 50%;
    border-bottom-color: transparent;
    border-left-color: transparent;
    animation: satPulse 3s ease-out infinite;
}
.sat-arc:nth-child(1) { width: 28px; height: 28px; top: 0; right: 0; }
.sat-arc:nth-child(2) { width: 48px; height: 48px; top: -10px; right: -10px; animation-delay: .5s; }
.sat-arc:nth-child(3) { width: 68px; height: 68px; top: -20px; right: -20px; animation-delay: 1s; }

@keyframes satPulse {
    0% { opacity: 0; transform: scale(.8); }
    50% { opacity: .6; }
    100% { opacity: 0; transform: scale(1.2); }
}

.satellite-icon {
    position: absolute; top: 12px; right: 18px; z-index: 3;
    animation: satFloat 4s ease-in-out infinite;
}
@keyframes satFloat {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-5px) rotate(5deg); }
}

/* ===== CITY BUILDINGS / LANDMARKS ===== */
.city-buildings {
    position: absolute;
    bottom: 78px;
    left: 0; right: 0;
    height: 220px;
    pointer-events: none;
    z-index: 5;
}

.landmark {
    position: absolute;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Landmark positions — spread across the scene */
.lm-house1     { left: 1%; }
.lm-school     { left: 10%; }
.lm-hospital   { left: 24%; }
.lm-firestation{ left: 38%; }
.lm-office     { left: 52%; }
.lm-mall       { left: 62%; }
.lm-police     { left: 76%; }
.lm-house2     { left: 88%; }
.lm-house3     { left: 96%; }

.landmark svg { display: block; filter: drop-shadow(0 2px 8px rgba(0,0,0,.3)); }

/* ===== LANDMARK GPS PINS ===== */
.landmark-pin {
    position: absolute;
    top: -22px;
    left: 50%;
    transform: translateX(-50%);
    width: 16px; height: 20px;
    z-index: 8;
    animation: lmPinBounce 3s ease-in-out infinite;
}
.landmark-pin::before {
    content: '';
    position: absolute;
    width: 16px; height: 20px;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
}
.landmark-pin::after {
    content: '';
    position: absolute;
    width: 6px; height: 6px;
    border-radius: 50%;
    top: 4px; left: 5px;
    background: #fff;
}
.pin-orange::before { background: #F7941D; }
.pin-red::before    { background: #EF4444; }
.pin-blue::before   { background: #3B82F6; }
.pin-green::before  { background: #22C55E; }

/* Pin pulse ring */
.pin-ring {
    position: absolute;
    top: 3px; left: 50%; transform: translateX(-50%);
    width: 8px; height: 8px;
    border-radius: 50%;
    border: 1.5px solid currentColor;
    animation: lmRing 2.5s ease-out infinite;
}
.pin-orange .pin-ring { border-color: #F7941D; }
.pin-red .pin-ring    { border-color: #EF4444; }
.pin-blue .pin-ring   { border-color: #3B82F6; }

@keyframes lmPinBounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(-6px); }
}
@keyframes lmRing {
    0% { width: 8px; height: 8px; opacity: .8; }
    100% { width: 32px, height: 32px; opacity: 0; margin-top: -12px; margin-left: -12px; }
}

/* ===== LANDMARK ANIMATIONS ===== */
.school-flag {
    animation: flagWave 2s ease-in-out infinite;
    transform-origin: 46px 6px;
}
@keyframes flagWave {
    0%, 100% { transform: scaleX(1); }
    50% { transform: scaleX(.85); }
}

.fire-siren {
    animation: sirenFlash 1s ease-in-out infinite alternate;
}
@keyframes sirenFlash {
    0% { fill: #F7941D; opacity: 1; }
    100% { fill: #EF4444; opacity: .6; }
}

.antenna-blink {
    animation: antBlink 2s ease-in-out infinite;
}
@keyframes antBlink {
    0%, 100% { opacity: .3; }
    50% { opacity: 1; fill: #EF4444; }
}

.police-light {
    animation: policeFlash .8s ease-in-out infinite alternate;
}
@keyframes policeFlash {
    0% { fill: #3B82F6; opacity: 1; }
    100% { fill: #EF4444; opacity: .8; }
}

/* ===== TREES ===== */
.city-tree {
    position: absolute;
    bottom: 78px;
    z-index: 6;
}
.city-tree::before {
    content: '';
    position: absolute; bottom: 0; left: 50%;
    transform: translateX(-50%);
    width: 4px; height: 14px;
    background: #3a2a1a; border-radius: 2px;
}
.city-tree::after {
    content: '';
    position: absolute; bottom: 10px; left: 50%;
    transform: translateX(-50%);
    width: 18px; height: 22px;
    background: radial-gradient(ellipse, #1a5a2a, #0e3e1a);
    border-radius: 50% 50% 40% 40%;
}
.tree-1 { left: 8%; }
.tree-2 { left: 22%; }
.tree-3 { left: 49%; }
.tree-4 { left: 74%; }
.tree-5 { left: 94%; }

/* ===== SIDEWALK & ROAD ===== */
.city-sidewalk {
    position: absolute; bottom: 70px;
    left: 0; right: 0; height: 8px;
    background: linear-gradient(180deg, #3a4a5a, #2e3e4e);
    z-index: 4;
}

.city-road {
    position: absolute; bottom: 0;
    left: 0; right: 0; height: 70px;
    background: linear-gradient(180deg, #2a2a35, #222230, #1e1e2a);
    z-index: 3;
}
.city-road::before {
    content: '';
    position: absolute; top: 0;
    left: 0; right: 0; height: 3px;
    background: #4a4a5a;
}

/* Center dashed line */
.road-line {
    position: absolute; top: 50%;
    left: 0; right: 0; height: 3px;
    transform: translateY(-50%);
    background: repeating-linear-gradient(90deg, #F7941D 0px, #F7941D 28px, transparent 28px, transparent 48px);
    opacity: .6;
    animation: roadMove 2.5s linear infinite;
}
@keyframes roadMove {
    0% { transform: translateY(-50%) translateX(0); }
    100% { transform: translateY(-50%) translateX(-48px); }
}

.road-line-bottom {
    position: absolute; top: 76%;
    left: 0; right: 0; height: 2px;
    background: repeating-linear-gradient(90deg, rgba(255,255,255,.12) 0px, rgba(255,255,255,.12) 18px, transparent 18px, transparent 36px);
    animation: roadMove 3.5s linear infinite;
}

/* ===== VEHICLES ===== */
.vehicle-wrapper {
    position: absolute; z-index: 10;
    display: flex; flex-direction: column; align-items: center;
    left: 0;
}

/* GPS Pin above vehicle */
.gps-pin {
    position: relative;
    width: 22px; height: 28px;
    margin-bottom: 2px;
    animation: pinBounce 2s ease-in-out infinite;
    z-index: 12;
    filter: drop-shadow(0 3px 6px rgba(0,0,0,.4));
}
.gps-pin svg { width: 100%; height: 100%; }

.gps-pin::after {
    content: '';
    position: absolute; bottom: -3px; left: 50%;
    transform: translateX(-50%);
    width: 10px; height: 3px;
    border-radius: 50%;
    background: rgba(0,0,0,.3);
    animation: pinShadow 2s ease-in-out infinite;
}

@keyframes pinBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}
@keyframes pinShadow {
    0%, 100% { transform: translateX(-50%) scale(1); opacity: .3; }
    50% { transform: translateX(-50%) scale(.6); opacity: .6; }
}

/* Signal rings from pin */
.pin-signal {
    position: absolute; top: 5px; left: 50%;
    transform: translateX(-50%);
    width: 6px; height: 6px;
    border-radius: 50%;
    border: 1.5px solid rgba(247,148,29,.8);
    animation: signalRing 2s ease-out infinite;
    pointer-events: none;
}
.pin-signal:nth-child(2) { animation-delay: .5s; }

@keyframes signalRing {
    0% { width: 6px; height: 6px; opacity: .8; }
    100% { width: 36px; height: 36px; opacity: 0; margin-top: -15px; margin-left: -15px; }
}

/* Vehicle body */
.vehicle-body { position: relative; z-index: 11; }
.vehicle-body svg {
    display: block;
    filter: drop-shadow(0 2px 5px rgba(0,0,0,.3));
}

/* ===== VEHICLE MOVEMENT ===== */

/* Car — left to right, bottom lane */
.vehicle-car {
    bottom: 8px;
    animation: driveRight 24s linear infinite;
}
.vehicle-car .vehicle-body { transform: scaleX(-1); }
@keyframes driveRight {
    0% { transform: translateX(-100px); }
    100% { transform: translateX(calc(100vw + 100px)); }
}

/* School Bus — right to left, top lane */
.vehicle-bus {
    bottom: 32px;
    animation: driveLeft 30s linear infinite;
}
.vehicle-bus .vehicle-body { transform: scaleX(-1); }

@keyframes driveLeft {
    0% { transform: translateX(calc(100vw + 150px)); }
    100% { transform: translateX(-150px); }
}

/* Ambulance — left to right, bottom lane, delayed */
.vehicle-ambulance {
    bottom: 8px;
    animation: driveRightMed 20s linear infinite 8s;
    animation-fill-mode: backwards;
}
@keyframes driveRightMed {
    0% { transform: translateX(-110px); }
    100% { transform: translateX(calc(100vw + 110px)); }
}

/* Truck — right to left, top lane, delayed */
.vehicle-truck {
    bottom: 32px;
    animation: driveLeftSlow 34s linear infinite 5s;
    animation-fill-mode: backwards;
}
.vehicle-truck .vehicle-body { transform: scaleX(-1); }

@keyframes driveLeftSlow {
    0% { transform: translateX(calc(100vw + 130px)); }
    100% { transform: translateX(-130px); }
}

/* Ambulance flash */
.ambulance-flash {
    position: absolute; top: -2px; left: 50%;
    transform: translateX(-50%);
    width: 6px; height: 6px;
    border-radius: 50%;
    background: #ef4444;
    box-shadow: 0 0 8px #ef4444, 0 0 16px rgba(239,68,68,.4);
    animation: flashLight .5s ease-in-out infinite alternate;
}
@keyframes flashLight {
    0% { background: #ef4444; box-shadow: 0 0 8px #ef4444; }
    100% { background: #3b82f6; box-shadow: 0 0 8px #3b82f6; }
}

/* ===== TRACKING TRAILS ===== */
.tracking-trail {
    position: absolute; z-index: 8;
    height: 2px; pointer-events: none; left: 0;
}
.tracking-trail-car {
    bottom: 26px; width: 80px;
    background: linear-gradient(90deg, transparent, rgba(34,197,94,.5), #22C55E);
    animation: driveRight 24s linear infinite;
}
.tracking-trail-bus {
    bottom: 50px; width: 100px;
    background: linear-gradient(270deg, transparent, rgba(247,148,29,.5), #F7941D);
    animation: driveLeft 30s linear infinite;
}

/* ===== FLOATING INFO CARDS ===== */
.scene-info-card {
    position: absolute; z-index: 15;
    background: rgba(0,0,0,.55);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 10px;
    padding: 6px 12px;
    display: flex; align-items: center; gap: 7px;
    font-size: .68rem; font-weight: 600;
    color: #fff; white-space: nowrap;
    pointer-events: none;
}
.scene-info-card .info-dot {
    width: 7px; height: 7px;
    border-radius: 50%; flex-shrink: 0;
}
.scene-card-1 {
    top: 10%; left: 6%;
    animation: floatCard 5s ease-in-out infinite;
}
.scene-card-2 {
    top: 8%; right: 6%;
    animation: floatCard 5s ease-in-out infinite 1.5s;
}
.scene-card-3 {
    top: 28%; left: 12%;
    animation: floatCard 5s ease-in-out infinite 3s;
}

@keyframes floatCard {
    0%, 100% { transform: translateY(0); opacity: .85; }
    50% { transform: translateY(-5px); opacity: 1; }
}

/* ===== LIVE BADGE ===== */
.scene-live-badge {
    position: absolute; top: 10px; left: 10px; z-index: 20;
    background: rgba(239,68,68,.9);
    color: #fff; padding: 3px 10px;
    border-radius: 20px;
    font-size: .65rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 1px;
    display: flex; align-items: center; gap: 5px;
}
.scene-live-badge::before {
    content: '';
    width: 6px; height: 6px;
    border-radius: 50%; background: #fff;
    animation: livePulse 1.5s infinite;
}
@keyframes livePulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: .3; transform: scale(.6); }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1199.98px) {
    .hero-city-scene { height: 380px; }
}
@media (max-width: 991.98px) {
    .hero-city-scene { height: 320px; border-radius: var(--radius-lg); }
    .scene-card-3 { display: none; }
    .scene-info-card { font-size: .62rem; padding: 5px 9px; }
    .lm-house3 { display: none; }
}
@media (max-width: 767.98px) {
    .hero-city-scene { height: 270px; margin-top: 1.5rem; }
    .satellite-signals, .satellite-icon { display: none; }
    .scene-card-2, .scene-card-3 { display: none; }
    .gps-pin { width: 18px; height: 22px; }
    .landmark-pin { width: 12px; height: 16px; top: -16px; }
    .lm-house2, .lm-house3 { display: none; }
    .city-tree { display: none; }
    .landmark svg { transform: scale(.85); transform-origin: bottom center; }
}
