/**
 * ============================================================================
 * PULSAR CARD CITY ANIMATION - Cidade 3D Miniatura nos Cards
 * ============================================================================
 * 
 * Versão reduzida da animação de cidade 3D do banner principal
 * Para uso nos cards de estados, cidades e bairros
 * 
 * ============================================================================
 */

/* Container da cidade 3D no topo do card */
.geo-card-city {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    overflow: hidden;
    z-index: 15;
    pointer-events: none;
    background: linear-gradient(to bottom, 
        rgba(10, 0, 30, 0.5) 0%, 
        rgba(10, 0, 30, 0.2) 50%,
        transparent 100%
    );
}

/* Perspectiva 3D */
.geo-card-city-perspective {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50px;
    perspective: 400px;
    perspective-origin: 50% 100%;
}

/* Container dos prédios */
.geo-card-buildings {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) rotateX(65deg);
    transform-style: preserve-3d;
    display: flex;
    gap: 4px;
    align-items: flex-end;
}

/* Prédio individual */
.geo-card-building {
    width: 12px;
    background: linear-gradient(to bottom, 
        rgba(142, 45, 226, 0.4) 0%,
        rgba(142, 45, 226, 0.2) 100%
    );
    border: 1px solid rgba(0, 229, 255, 0.3);
    border-bottom: 2px solid rgba(0, 229, 255, 0.6);
    position: relative;
    animation: buildingPulse 3s ease-in-out infinite;
    box-shadow: 
        0 0 10px rgba(142, 45, 226, 0.3),
        inset 0 -2px 5px rgba(0, 229, 255, 0.2);
}

/* Alturas variadas dos prédios */
.geo-card-building:nth-child(1) { height: 25px; animation-delay: 0s; }
.geo-card-building:nth-child(2) { height: 35px; animation-delay: 0.2s; }
.geo-card-building:nth-child(3) { height: 20px; animation-delay: 0.4s; }
.geo-card-building:nth-child(4) { height: 40px; animation-delay: 0.6s; }
.geo-card-building:nth-child(5) { height: 30px; animation-delay: 0.8s; }
.geo-card-building:nth-child(6) { height: 38px; animation-delay: 1s; }
.geo-card-building:nth-child(7) { height: 22px; animation-delay: 1.2s; }
.geo-card-building:nth-child(8) { height: 33px; animation-delay: 1.4s; }

/* Janelas dos prédios */
.geo-card-building::before {
    content: '';
    position: absolute;
    top: 3px;
    left: 2px;
    right: 2px;
    bottom: 3px;
    background: 
        repeating-linear-gradient(
            0deg,
            transparent 0px,
            transparent 3px,
            rgba(0, 229, 255, 0.2) 3px,
            rgba(0, 229, 255, 0.2) 4px
        ),
        repeating-linear-gradient(
            90deg,
            transparent 0px,
            transparent 3px,
            rgba(0, 229, 255, 0.2) 3px,
            rgba(0, 229, 255, 0.2) 4px
        );
    opacity: 0.6;
}

/* Luzes piscando nas janelas */
.geo-card-building::after {
    content: '';
    position: absolute;
    width: 2px;
    height: 2px;
    background: rgba(255, 255, 0, 0.8);
    border-radius: 50%;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 
        0 0 3px rgba(255, 255, 0, 0.8),
        0 0 6px rgba(255, 200, 0, 0.4);
    animation: windowLight 2s ease-in-out infinite;
}

/* Animação de pulsação dos prédios */
@keyframes buildingPulse {
    0%, 100% { 
        opacity: 0.7;
        border-color: rgba(0, 229, 255, 0.3);
    }
    50% { 
        opacity: 1;
        border-color: rgba(0, 229, 255, 0.6);
        box-shadow: 
            0 0 15px rgba(142, 45, 226, 0.5),
            inset 0 -3px 8px rgba(0, 229, 255, 0.3);
    }
}

/* Animação das luzes das janelas */
@keyframes windowLight {
    0%, 100% { 
        opacity: 0.3; 
    }
    50% { 
        opacity: 1;
        box-shadow: 
            0 0 5px rgba(255, 255, 0, 1),
            0 0 10px rgba(255, 200, 0, 0.6);
    }
}

/* Grid de linhas futurísticas no fundo */
.geo-card-city::before {
    content: '';
    position: absolute;
    inset: 0;
    background: 
        repeating-linear-gradient(
            90deg,
            transparent 0,
            rgba(0, 229, 255, 0.05) 1px,
            transparent 2px,
            transparent 20px
        ),
        repeating-linear-gradient(
            0deg,
            transparent 0,
            rgba(142, 45, 226, 0.05) 1px,
            transparent 2px,
            transparent 20px
        );
    opacity: 0.5;
    animation: gridScan 3s linear infinite;
}

/* Scan de grid */
@keyframes gridScan {
    0% { 
        transform: translateY(0); 
    }
    100% { 
        transform: translateY(20px); 
    }
}

/* Partículas flutuantes (estrelas/luzes) */
.geo-card-city::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: 
        radial-gradient(1px 1px at 15% 20%, rgba(255, 255, 255, 0.4), transparent),
        radial-gradient(1px 1px at 85% 30%, rgba(0, 229, 255, 0.3), transparent),
        radial-gradient(1px 1px at 45% 15%, rgba(255, 0, 255, 0.3), transparent),
        radial-gradient(1px 1px at 70% 25%, rgba(255, 255, 255, 0.2), transparent);
    background-repeat: no-repeat;
    animation: particlesFloat 4s ease-in-out infinite;
}

@keyframes particlesFloat {
    0%, 100% { 
        opacity: 0.3;
        transform: translateY(0);
    }
    50% { 
        opacity: 0.8;
        transform: translateY(-5px);
    }
}

/* Hover effect - cidade se ilumina */
.geo-card:hover .geo-card-building {
    border-color: rgba(0, 229, 255, 0.8);
    box-shadow: 
        0 0 20px rgba(142, 45, 226, 0.6),
        inset 0 -3px 10px rgba(0, 229, 255, 0.4);
    animation-duration: 1.5s;
}

.geo-card:hover .geo-card-building::after {
    box-shadow: 
        0 0 8px rgba(255, 255, 0, 1),
        0 0 15px rgba(255, 200, 0, 0.8);
}

/* Ajuste para cards pequenos (bairros) */
.geo-card-small .geo-card-city {
    height: 50px;
}

.geo-card-small .geo-card-city-perspective {
    height: 40px;
}

.geo-card-small .geo-card-building {
    width: 10px;
}

.geo-card-small .geo-card-building:nth-child(1) { height: 20px; }
.geo-card-small .geo-card-building:nth-child(2) { height: 28px; }
.geo-card-small .geo-card-building:nth-child(3) { height: 16px; }
.geo-card-small .geo-card-building:nth-child(4) { height: 32px; }
.geo-card-small .geo-card-building:nth-child(5) { height: 24px; }
.geo-card-small .geo-card-building:nth-child(6) { height: 30px; }
.geo-card-small .geo-card-building:nth-child(7) { height: 18px; }
.geo-card-small .geo-card-building:nth-child(8) { height: 26px; }

/* Responsivo */
@media (max-width: 768px) {
    .geo-card-city {
        height: 50px;
    }

    .geo-card-city-perspective {
        height: 40px;
    }

    .geo-card-building {
        width: 10px;
        gap: 3px;
    }
}

@media (max-width: 480px) {
    .geo-card-city {
        height: 45px;
    }

    .geo-card-city-perspective {
        height: 35px;
    }

    .geo-card-building {
        width: 8px;
        gap: 2px;
    }

    .geo-card-building:nth-child(1) { height: 18px; }
    .geo-card-building:nth-child(2) { height: 25px; }
    .geo-card-building:nth-child(3) { height: 15px; }
    .geo-card-building:nth-child(4) { height: 28px; }
    .geo-card-building:nth-child(5) { height: 22px; }
    .geo-card-building:nth-child(6) { height: 26px; }
    .geo-card-building:nth-child(7) { height: 16px; }
    .geo-card-building:nth-child(8) { height: 24px; }
}
