/* === PING EFFECTS CSS === */
/* Animations pour les pings lumineux sur la carte mondiale */

/* Animation de pulsation principale avec clignotement */
@keyframes ping-pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    25% {
        transform: scale(1.15);
        opacity: 0.6;
    }
    50% {
        transform: scale(1.3);
        opacity: 1;
    }
    75% {
        transform: scale(1.15);
        opacity: 0.6;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Animation de clignotement rapide */
@keyframes ping-blink {
    0%, 100% {
        opacity: 1;
        box-shadow:
            0 0 15px rgba(0, 212, 255, 1),
            0 0 30px rgba(0, 212, 255, 0.8),
            0 0 45px rgba(0, 212, 255, 0.6);
    }
    50% {
        opacity: 0.4;
        box-shadow:
            0 0 5px rgba(0, 212, 255, 0.5),
            0 0 10px rgba(0, 212, 255, 0.3),
            0 0 15px rgba(0, 212, 255, 0.2);
    }
}

/* Animation des ondes qui s'expandent */
@keyframes ping-ripple {
    0% {
        transform: scale(1);
        opacity: 0.8;
    }
    100% {
        transform: scale(2.5);
        opacity: 0;
    }
}

/* Animation de fade-out progressif (dernières minutes) */
@keyframes ping-fadeout {
    0% {
        opacity: 1;
    }
    100% {
        opacity: 0.2;
    }
}

/* Conteneur du ping marker */
.ping-marker-container {
    position: relative;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Cercle principal du ping */
.ping-marker {
    width: 10px;
    height: 10px;
    background: radial-gradient(circle, #00d4ff, #7c3aed);
    border: 2px solid rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    position: relative;
    z-index: 2;
    box-shadow:
        0 0 8px rgba(0, 212, 255, 1),
        0 0 15px rgba(0, 212, 255, 0.8),
        0 0 22px rgba(0, 212, 255, 0.6),
        0 0 30px rgba(124, 58, 237, 0.4);
    animation:
        ping-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite,
        ping-blink 1.5s ease-in-out infinite;
    cursor: pointer;
    transition: all 0.3s ease;
}

/* Effet au hover */
.ping-marker:hover {
    transform: scale(1.3);
    box-shadow:
        0 0 8px rgba(0, 212, 255, 1),
        0 0 15px rgba(0, 212, 255, 0.8),
        0 0 22px rgba(0, 212, 255, 0.6),
        0 0 30px rgba(124, 58, 237, 0.5);
}

/* Première onde d'expansion */
.ping-ripple {
    position: absolute;
    width: 8px;
    height: 8px;
    border: 1px solid rgba(0, 212, 255, 0.6);
    border-radius: 50%;
    animation: ping-ripple 2s cubic-bezier(0, 0, 0.2, 1) infinite;
    z-index: 1;
}

/* Deuxième onde d'expansion (délai) */
.ping-ripple-2 {
    position: absolute;
    width: 8px;
    height: 8px;
    border: 1px solid rgba(124, 58, 237, 0.5);
    border-radius: 50%;
    animation: ping-ripple 2s cubic-bezier(0, 0, 0.2, 1) infinite;
    animation-delay: 0.5s;
    z-index: 1;
}

/* Troisième onde d'expansion (délai plus long) */
.ping-ripple-3 {
    position: absolute;
    width: 8px;
    height: 8px;
    border: 1px solid rgba(245, 158, 11, 0.4);
    border-radius: 50%;
    animation: ping-ripple 2s cubic-bezier(0, 0, 0.2, 1) infinite;
    animation-delay: 1s;
    z-index: 1;
}

/* Badge "NEW" retiré - remplacé par le système de couleur verte (0-2h) */

/* ============================================ */
/* SYSTÈME DE COULEURS TEMPORELLES */
/* ============================================ */

/* 🟢 VERT : Nouveau ping (0-2h) */
.ping-marker.ping-new {
    background: radial-gradient(circle, #10b981, #059669);
    box-shadow:
        0 0 8px rgba(16, 185, 129, 1),
        0 0 15px rgba(16, 185, 129, 0.8),
        0 0 22px rgba(16, 185, 129, 0.6),
        0 0 30px rgba(5, 150, 105, 0.4);
}

.ping-ripple.ping-new,
.ping-ripple-2.ping-new,
.ping-ripple-3.ping-new {
    border-color: rgba(16, 185, 129, 0.6);
}

/* 🔵 BLEU : Ping normal (2h-22h) - couleurs par défaut */
/* Déjà défini dans .ping-marker */

/* 🟠 ORANGE : Ping expirant bientôt (22h-24h) */
.ping-marker.ping-expiring {
    background: radial-gradient(circle, #f59e0b, #d97706);
    box-shadow:
        0 0 8px rgba(245, 158, 11, 1),
        0 0 15px rgba(245, 158, 11, 0.8),
        0 0 22px rgba(245, 158, 11, 0.6),
        0 0 30px rgba(217, 119, 6, 0.4);
}

.ping-ripple.ping-expiring,
.ping-ripple-2.ping-expiring,
.ping-ripple-3.ping-expiring {
    border-color: rgba(245, 158, 11, 0.6);
}

/* Tooltip au hover */
.ping-tooltip {
    position: absolute;
    bottom: 120%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(10px);
    color: white;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1000;
    border: 1px solid rgba(0, 212, 255, 0.3);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Flèche du tooltip */
.ping-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: rgba(10, 10, 10, 0.95);
}

.ping-marker-container:hover .ping-tooltip {
    opacity: 1;
}

/* Contenu du tooltip */
.ping-tooltip-city {
    display: block;
    color: #00d4ff;
    font-size: 0.9rem;
    margin-bottom: 2px;
}

.ping-tooltip-country {
    display: block;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.75rem;
    margin-bottom: 4px;
}

.ping-tooltip-time {
    display: block;
    color: #00d4ff;
    font-size: 0.85rem;
    font-weight: 600;
    font-style: normal;
}

/* Responsive */
@media (max-width: 768px) {
    .ping-marker-container {
        width: 14px;
        height: 14px;
    }

    .ping-marker {
        width: 8px;
        height: 8px;
        min-width: 8px;
        min-height: 8px;
        border: 1px solid rgba(255, 255, 255, 0.9);
        border-radius: 50% !important;
        box-shadow:
            0 0 4px rgba(0, 212, 255, 1),
            0 0 8px rgba(0, 212, 255, 0.8),
            0 0 12px rgba(0, 212, 255, 0.6);
        /* Désactiver animations qui déforment sur mobile */
        animation: none !important;
        transform-origin: center center;
    }

    .ping-ripple,
    .ping-ripple-2,
    .ping-ripple-3 {
        width: 6px;
        height: 6px;
        min-width: 6px;
        min-height: 6px;
        border-radius: 50% !important;
    }

    .ping-badge-photo {
        font-size: 0.7rem;
        padding: 0;
        top: -3px;
        right: -3px;
    }

    .ping-tooltip {
        font-size: 0.65rem;
        padding: 3px 6px;
    }
}

/* ============================================ */
/* BADGE PHOTO */
/* ============================================ */

.ping-badge-photo {
    position: absolute;
    top: -4px;
    right: -4px;
    background: none;
    color: white;
    font-size: 0.85rem;
    padding: 0;
    z-index: 3;
    filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.8));
}

.ping-tooltip-hint {
    display: block;
    font-size: 0.75rem;
    color: #00d4ff;
    margin-top: 4px;
    font-style: italic;
}

/* ============================================ */
/* LIGHTBOX PHOTO */
/* ============================================ */

.ping-photo-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease-out;
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    font-size: 2.5rem;
    color: white;
    cursor: pointer;
    z-index: 10001;
    transition: transform 0.3s ease, color 0.3s ease;
    text-shadow: 0 0 10px rgba(0, 212, 255, 0.8);
}

.lightbox-close:hover {
    transform: scale(1.2) rotate(90deg);
    color: #00d4ff;
}

.lightbox-loading {
    color: white;
    font-size: 1.2rem;
    padding: 2rem;
    text-align: center;
}

.lightbox-image {
    max-width: 100%;
    max-height: 80vh;
    border-radius: 10px;
    box-shadow: 0 20px 60px rgba(0, 212, 255, 0.3);
    border: 2px solid rgba(0, 212, 255, 0.5);
}

.lightbox-info {
    text-align: center;
    color: white;
}

.lightbox-location {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0;
    color: #00d4ff;
}

.lightbox-time {
    font-size: 0.9rem;
    margin: 0.5rem 0 0 0;
    opacity: 0.8;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}
