/* ===== Hero accueil — Amis de François ===== */
.home-hero {
    --hero-ink: #0c2a3a;
    --hero-foam: #f4faf8;
    --hero-sky: #3d7ea6;
    --hero-forest: #1f5c4a;
    --hero-sun: #e8b84a;
    position: relative;
    overflow: hidden;
    color: var(--hero-foam);
    isolation: isolate;
}

.home-hero-atmosphere {
    position: absolute;
    inset: 0;
    z-index: 0;
    background:
        radial-gradient(ellipse 90% 70% at 15% 10%, rgba(232, 184, 74, 0.35) 0%, transparent 55%),
        radial-gradient(ellipse 70% 60% at 90% 20%, rgba(90, 168, 140, 0.4) 0%, transparent 50%),
        radial-gradient(ellipse 80% 50% at 50% 100%, rgba(12, 42, 58, 0.55) 0%, transparent 55%),
        linear-gradient(165deg, #1a4f6e 0%, #246b5a 42%, #0f3d4a 100%);
}

.home-hero-atmosphere::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0.22;
    background-image:
        radial-gradient(circle at 20% 30%, rgba(255,255,255,0.35) 0 1px, transparent 2px),
        radial-gradient(circle at 70% 60%, rgba(255,255,255,0.2) 0 1px, transparent 2px);
    background-size: 42px 42px, 28px 28px;
    pointer-events: none;
}

.home-hero-atmosphere::after {
    content: '';
    position: absolute;
    inset: auto 0 0 0;
    height: 4.5rem;
    background: linear-gradient(180deg, transparent, rgba(249, 250, 251, 0.95));
    pointer-events: none;
}

.home-hero-inner {
    position: relative;
    z-index: 1;
    max-width: 72rem;
    margin: 0 auto;
    padding: 1.75rem 1rem 2.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.home-hero-visual {
    width: 100%;
    max-width: 56rem;
    position: relative;
    animation: homeHeroRise 0.9s ease both;
}

.home-hero-visual::before {
    content: '';
    position: absolute;
    inset: 8% 6% auto;
    height: 70%;
    border-radius: 50%;
    background: radial-gradient(ellipse, rgba(255, 236, 179, 0.45), transparent 70%);
    filter: blur(18px);
    z-index: 0;
    pointer-events: none;
    animation: homeHeroGlow 5s ease-in-out infinite;
}

.home-hero-image {
    position: relative;
    z-index: 1;
    display: block;
    width: 100%;
    height: auto;
    max-height: min(52vh, 440px);
    object-fit: contain;
    margin: 0 auto;
    filter: drop-shadow(0 22px 40px rgba(8, 28, 36, 0.45));
    -webkit-mask-image: linear-gradient(180deg, #000 82%, transparent 100%);
    mask-image: linear-gradient(180deg, #000 82%, transparent 100%);
    animation: homeHeroFloat 7s ease-in-out infinite;
}

.home-hero-copy {
    text-align: center;
    max-width: 40rem;
    animation: homeHeroRise 0.9s ease 0.12s both;
}

.home-hero-brand {
    font-family: 'Nunito', system-ui, sans-serif;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(255, 248, 230, 0.92);
    margin: 0 0 0.55rem;
}

.home-hero-title {
    font-family: 'Fraunces', Georgia, serif;
    font-weight: 700;
    font-size: clamp(1.65rem, 4.5vw, 2.65rem);
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: #fffef8;
    margin: 0 0 0.65rem;
    text-shadow: 0 2px 24px rgba(8, 28, 36, 0.35);
}

.home-hero-lead {
    font-family: 'Nunito', system-ui, sans-serif;
    font-size: clamp(0.95rem, 2.2vw, 1.08rem);
    font-weight: 600;
    line-height: 1.5;
    color: rgba(240, 249, 246, 0.9);
    margin: 0 0 1.35rem;
}

.home-hero-cta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.7rem;
}

.home-hero-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: 'Nunito', system-ui, sans-serif;
    font-weight: 800;
    font-size: 0.95rem;
    padding: 0.8rem 1.35rem;
    border-radius: 999px;
    border: 2px solid transparent;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.home-hero-btn:hover {
    transform: translateY(-2px);
}

.home-hero-btn--primary {
    color: #134e4a;
    background: #fffef8;
    box-shadow: 0 12px 28px -12px rgba(8, 28, 36, 0.55);
}

.home-hero-btn--primary:hover {
    background: #fff;
    box-shadow: 0 16px 32px -12px rgba(8, 28, 36, 0.6);
}

.home-hero-btn--warm {
    color: #1c1917;
    background: linear-gradient(135deg, #f6d365, #e8b84a);
    box-shadow: 0 12px 28px -12px rgba(180, 120, 20, 0.65);
}

.home-hero-btn--warm:hover {
    filter: brightness(1.05);
}

.home-hero-btn--ghost {
    color: #fffef8;
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 254, 248, 0.55);
    backdrop-filter: blur(6px);
}

.home-hero-btn--ghost:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: #fffef8;
}

@keyframes homeHeroRise {
    from {
        opacity: 0;
        transform: translateY(18px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes homeHeroFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

@keyframes homeHeroGlow {
    0%, 100% { opacity: 0.7; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.06); }
}

@media (min-width: 768px) {
    .home-hero-inner {
        padding: 2.5rem 1.5rem 3.25rem;
        gap: 1.85rem;
    }

    .home-hero-image {
        max-height: min(58vh, 520px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .home-hero-visual,
    .home-hero-copy,
    .home-hero-image,
    .home-hero-visual::before {
        animation: none !important;
    }
}

/* Style pour la carte */
#map,
.map-container {
    height: 65vh;
    min-height: 360px;
    max-height: 720px;
    width: 100%;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    touch-action: pan-x pan-y;
}

/* Stats accueil — bandeau discret sur mobile */
@media (max-width: 767px) {
    .home-stats .home-stat-card + .home-stat-card {
        border-left: 1px solid #e5e7eb;
    }
}

.map-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: stretch;
}

.map-filter-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #f9fafb;
    border-radius: 0.5rem;
    padding: 0.625rem 0.875rem;
    min-height: 44px;
    flex: 1 1 180px;
}

.map-filter-rayon {
    flex: 1 1 220px;
    flex-wrap: wrap;
}

.map-filter-select {
    flex: 1;
    min-width: 0;
    background: transparent;
    border: none;
    outline: none;
    font-size: 0.95rem;
}

.map-filter-hint {
    width: 100%;
    font-size: 0.75rem;
    color: #6b7280;
    line-height: 1.2;
}

.map-filter-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 44px;
    padding: 0.625rem 1rem;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 0.95rem;
    transition: background-color 0.2s ease;
    flex: 1 1 auto;
}

.map-filter-btn-green { background: #22c55e; color: #fff; }
.map-filter-btn-green:hover { background: #16a34a; }
.map-filter-btn-blue { background: #3b82f6; color: #fff; }
.map-filter-btn-blue:hover { background: #2563eb; }
.map-filter-btn-gray { background: #6b7280; color: #fff; }
.map-filter-btn-gray:hover { background: #4b5563; }

.map-overlay {
    position: absolute;
    inset: 0;
    z-index: 999;
    display: none;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.map-overlay-loading {
    background: rgba(255, 255, 255, 0.55);
}

.map-overlay-box {
    background: #fff;
    padding: 1.25rem 1.5rem;
    border-radius: 0.75rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    text-align: center;
    color: #4b5563;
}

.map-overlay-icon {
    font-size: 1.5rem;
    color: #6b7280;
    margin-bottom: 0.5rem;
}

.map-info-toast {
    position: absolute;
    top: 0.75rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1001;
    max-width: min(36rem, calc(100% - 1.5rem));
    padding: 0.75rem 1rem;
    background: #dbeafe;
    border: 1px solid #93c5fd;
    border-radius: 0.5rem;
    color: #1e40af;
    font-size: 0.875rem;
    text-align: center;
    display: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    line-height: 1.5;
}

.geo-help-link {
    display: inline;
    margin-left: 0.15rem;
    padding: 0;
    border: none;
    background: none;
    color: inherit;
    font: inherit;
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
}

.map-error-toast .geo-help-link {
    color: #b91c1c;
}

.map-info-toast .geo-help-link {
    color: #1d4ed8;
}

.geo-help-modal.flex {
    display: flex;
}

.geo-help-item {
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    overflow: hidden;
    background: #fff;
}

.geo-help-item.geo-help-current {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.geo-help-item summary {
    cursor: pointer;
    font-weight: 600;
    padding: 0.75rem 1rem;
    background: #f9fafb;
    list-style: none;
}

.geo-help-item summary::-webkit-details-marker {
    display: none;
}

.geo-help-item[open] summary {
    border-bottom: 1px solid #e5e7eb;
    background: #eff6ff;
    color: #1d4ed8;
}

.geo-help-item ol {
    margin: 0;
    padding: 0.75rem 1rem 0.75rem 2rem;
    font-size: 0.9rem;
    color: #374151;
    line-height: 1.6;
}

.geo-help-item li + li {
    margin-top: 0.35rem;
}

.geo-help-note {
    margin: 0 1rem 0.75rem;
    padding: 0.5rem 0.75rem;
    background: #f3f4f6;
    border-radius: 0.375rem;
    font-size: 0.85rem;
    color: #4b5563;
}

.map-error-toast {
    position: absolute;
    top: 0.75rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1001;
    max-width: calc(100% - 1.5rem);
    padding: 0.75rem 1rem;
    background: #fee2e2;
    border: 1px solid #fecaca;
    border-radius: 0.5rem;
    color: #dc2626;
    font-size: 0.875rem;
    text-align: center;
    display: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.markers-counter {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    z-index: 1000;
    background: #fff;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
    font-size: 0.75rem;
    font-weight: 700;
    border: 1px solid #e5e7eb;
}

.map-legend {
    background: rgba(255, 255, 255, 0.95);
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    font-size: 0.8rem;
    line-height: 1.4;
}

.map-legend h4 {
    margin: 0 0 0.5rem;
    font-size: 0.875rem;
    font-weight: 700;
}

.legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 0.25rem;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 0.5rem;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1);
}

.legend-online { background: #4CAF50; }
.legend-offline { background: #9E9E9E; }
.legend-approx { background: #f59e0b; box-shadow: inset 0 0 0 2px #fff; }
.legend-cluster { background: #3388ff; }
.legend-user { background: #EF4444; }

.marker-user-position {
    background: #EF4444 !important;
    animation: none !important;
}

.marker-avatar-fallback {
    background: #3B82F6;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
}

.marker-login-hint {
    font-size: 0.8rem;
    color: #6b7280;
}

.marker-login-hint a {
    color: #2563eb;
    text-decoration: underline;
}

.loading-spinner {
    width: 30px;
    height: 30px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3B82F6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 0.75rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@media (max-width: 640px) {
    #map,
    .map-container {
        height: 55vh;
        min-height: 320px;
        max-height: 480px;
    }

    .map-filters {
        flex-direction: column;
    }

    .map-filter-item,
    .map-filter-btn {
        width: 100%;
        flex: 1 1 100%;
    }

    .map-legend {
        display: none;
    }

    .leaflet-popup-content {
        min-width: 180px;
    }
}

@media (min-width: 1024px) {
    #map,
    .map-container {
        height: 620px;
        max-height: 620px;
    }
}

/* ===== CORRECTIONS POUR LES MODALES ===== */

/* Styles pour garantir que les modales soient au-dessus de la carte */
.modal-overlay {
    z-index: 1000 !important;
}

.modal-content {
    z-index: 1001 !important;
    position: relative;
}

/* Réduire le z-index de la carte Leaflet */
.leaflet-container {
    z-index: 1 !important;
}

.leaflet-popup {
    z-index: 2 !important;
}

.leaflet-control {
    z-index: 3 !important;
}

.marker-cluster {
    z-index: 4 !important;
}

/* Styles pour les modales */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1050;
}

.modal-dialog {
    background: white;
    border-radius: 12px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    max-width: 90vw;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    z-index: 1060;
}

/* Animation pour l'ouverture des modales */
@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-dialog {
    animation: modalFadeIn 0.3s ease-out;
}

/* ===== AMÉLIORATIONS POUR L'ESPACE MEMBRE ===== */

/* Style pour l'avatar dans les formulaires */
.avatar-preview {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid #e5e7eb;
    object-fit: cover;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
}

.avatar-preview i {
    font-size: 24px;
}

/* Style pour les notifications */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    border: 1px solid transparent;
    position: relative;
}

.alert-success {
    background-color: #d1fae5;
    border-color: #a7f3d0;
    color: #065f46;
}

.alert-error {
    background-color: #fee2e2;
    border-color: #fecaca;
    color: #dc2626;
}

.alert-warning {
    background-color: #fef3c7;
    border-color: #fde68a;
    color: #92400e;
}

/* Boutons améliorés */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    gap: 8px;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: #3b82f6;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: #2563eb;
    transform: translateY(-1px);
}

.btn-secondary {
    background: #6b7280;
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background: #4b5563;
}

.btn-danger {
    background: #ef4444;
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background: #dc2626;
}

.btn-outline {
    background: transparent;
    border: 2px solid #e5e7eb;
    color: #374151;
}

.btn-outline:hover:not(:disabled) {
    background: #f9fafb;
    border-color: #d1d5db;
}

/* ===== AMÉLIORATIONS RESPONSIVES ===== */

@media (max-width: 768px) {
    .modal-dialog {
        margin: 20px;
        max-width: calc(100vw - 40px);
        max-height: calc(100vh - 40px);
    }
    
    .marker-popup {
        max-width: 250px;
    }
    
    .marker-header {
        padding: 10px 12px;
    }
    
    .marker-body {
        padding: 10px 12px;
    }
    
    /* Ajustement pour les boutons de filtre */
    .filter-buttons {
        flex-direction: column;
        gap: 8px;
    }
    
    .filter-buttons .btn {
        width: 100%;
        justify-content: center;
    }
}

/* ===== AMÉLIORATIONS VISUELLES ===== */

/* Effet de profondeur pour les cartes */
.card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.3s ease;
}

.card:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Style pour les champs de formulaire */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #374151;
}

.form-input {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    transition: all 0.2s ease;
    font-size: 14px;
}

.form-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-input.error {
    border-color: #ef4444;
}

.form-help {
    font-size: 12px;
    color: #6b7280;
    margin-top: 4px;
}

/* ===== ANIMATIONS SUPPLÉMENTAIRES ===== */

@keyframes slideInDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideOutUp {
    from {
        transform: translateY(0);
        opacity: 1;
    }
    to {
        transform: translateY(-100%);
        opacity: 0;
    }
}

/* Animation pour les notifications */
.alert {
    animation: slideInDown 0.3s ease-out;
}

.alert.hiding {
    animation: slideOutUp 0.3s ease-in;
}

/* ===== CORRECTIONS SPÉCIFIQUES POUR LA CARTE ===== */

/* Assurer que les contrôles de la carte sont visibles */
.leaflet-top,
.leaflet-bottom {
    z-index: 5 !important;
}

/* (compteur / overlays carte : voir styles en tête de fichier) */

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* ===== AMÉLIORATIONS POUR LE CHAT ===== */

.chat-message {
    padding: 12px;
    margin-bottom: 8px;
    border-radius: 8px;
    animation: fadeIn 0.3s ease-out;
}

.chat-message.own {
    background: #f0f9ff;
    border-left: 4px solid #3b82f6;
    margin-left: 20px;
}

.chat-message.other {
    background: #f9fafb;
    border-left: 4px solid #10b981;
    margin-right: 20px;
}

.chat-message.system {
    background: #fef3c7;
    border-left: 4px solid #f59e0b;
    font-style: italic;
    text-align: center;
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.message-sender {
    font-weight: bold;
    color: #374151;
}

.message-time {
    font-size: 12px;
    color: #6b7280;
}

.message-content {
    color: #4b5563;
}

/* Styles pour les listes à puces */
ul {
    list-style-type: disc;
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

ol {
    list-style-type: decimal;
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

li {
    margin-bottom: 0.25rem;
}

/* ===== UTILITAIRES ===== */

.text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.shadow-lg {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.border-gradient {
    border: 2px solid transparent;
    background: linear-gradient(white, white) padding-box,
                linear-gradient(135deg, #667eea 0%, #764ba2 100%) border-box;
}

/* ===== CORRECTIONS POUR LES PETITS ÉCRANS ===== */

@media (max-width: 640px) {
    .container {
        padding-left: 16px;
        padding-right: 16px;
    }
    
    /* Ajustement pour la grille de l'espace membre */
    .member-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    /* Réduire la hauteur de la carte sur mobile — géré par #map / .map-container */
    
    /* Ajustement des boutons d'action */
    .action-buttons {
        flex-direction: column;
        gap: 8px;
    }
    
    .action-buttons .btn {
        width: 100%;
    }
}

/* ===== ACCESSIBILITÉ ===== */

/* Focus visible pour l'accessibilité */
.btn:focus-visible,
.form-input:focus-visible,
[tabindex]:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Contraste amélioré pour le texte */
.text-high-contrast {
    color: #1f2937;
}

/* ===== IMPORTS DE POLICES (optionnel) ===== */

/* 
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

body {
    font-family: 'Inter', sans-serif;
}
*/

/* ===== CORRECTIONS FINALES ===== */

/* S'assurer que les modales sont toujours au-dessus */
.fixed {
    position: fixed;
}

.absolute {
    position: absolute;
}

.relative {
    position: relative;
}

/* Z-index hiérarchie */
.z-0 { z-index: 0; }
.z-10 { z-index: 10; }
.z-20 { z-index: 20; }
.z-30 { z-index: 30; }
.z-40 { z-index: 40; }
.z-50 { z-index: 50; }
.z-1000 { z-index: 1000; }
.z-1050 { z-index: 1050; }
.z-1060 { z-index: 1060; }

/* Cache les éléments */
.hidden {
    display: none !important;
}

/* Affiche les éléments en flex */
.flex {
    display: flex;
}

/* Transition de base */
.transition {
    transition: all 0.3s ease;
}

/* ===== STYLES DES MARQUEURS PERSONNALISÉS ===== */

/* Style de base du marqueur */
.custom-marker {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #3388ff;
    border: 2px solid white;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 12px;
    box-shadow: 0 1px 5px rgba(0,0,0,0.4);
    cursor: pointer;
    transition: all 0.2s ease;
}

/* Style du marqueur en ligne */
.custom-marker.online {
    background: #4CAF50;
    animation: pulse-glow-enhanced 2s infinite;
}

/* Style du marqueur hors ligne */
.custom-marker.offline {
    background: #9E9E9E;
}

.custom-marker.approximate {
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px #f59e0b;
}

.custom-marker.approximate.online {
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px #f59e0b, 0 0 8px rgba(76, 175, 80, 0.6);
}

/* Style du texte à l'intérieur du marqueur */
.custom-marker span {
    pointer-events: none;
}

/* Style du popup des marqueurs */
.leaflet-popup-content-wrapper {
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    padding: 0;
    overflow: hidden;
}

.leaflet-popup-content {
    margin: 0;
    width: auto !important;
    min-width: 200px;
}

/* Style de l'en-tête du popup */
.marker-popup {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.marker-header {
    padding: 12px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    align-items: center;
}

.marker-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 12px;
    object-fit: cover;
    background: #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    font-weight: bold;
    font-size: 14px;
}

.marker-info {
    flex: 1;
}

.marker-pseudo {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 4px 0;
    color: #212529;
}

.marker-location {
    font-size: 12px;
    color: #6c757d;
    margin: 0;
    display: flex;
    align-items: center;
}

.marker-status {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
}

.marker-status.online {
    background: #4CAF50;
}

.marker-status.offline {
    background: #9E9E9E;
}

/* Style du corps du popup */
.marker-body {
    padding: 12px;
}

.marker-approx {
    margin: 0 0 10px 0;
    padding: 8px 10px;
    border-radius: 8px;
    background: #fffbeb;
    border: 1px solid #fcd34d;
    color: #92400e;
    font-size: 12px;
    line-height: 1.4;
}

.marker-details {
    margin: 0 0 8px 0;
    font-size: 13px;
    color: #495057;
    display: flex;
    align-items: center;
}

.marker-details i {
    margin-right: 8px;
    color: #6c757d;
    width: 16px;
    text-align: center;
}

.marker-email {
    color: #007bff;
    text-decoration: none;
    font-size: 13px;
    display: block;
    margin-bottom: 8px;
    word-break: break-all;
}

.marker-email:hover {
    text-decoration: underline;
}

/* Styles pour les clusters */
.marker-cluster {
    background-color: rgba(51, 136, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 12px;
    text-shadow: 0 1px 1px rgba(0,0,0,0.5);
}

.marker-cluster-small {
    background-color: rgba(51, 136, 255, 0.6);
    width: 30px !important;
    height: 30px !important;
    line-height: 30px;
}

.marker-cluster-medium {
    background-color: rgba(51, 136, 255, 0.8);
    width: 40px !important;
    height: 40px !important;
    line-height: 40px;
}

.marker-cluster-large {
    background-color: rgba(51, 136, 255, 1);
    width: 50px !important;
    height: 50px !important;
    line-height: 50px;
}

/* Animation de pulse pour les marqueurs en ligne */
@keyframes pulse-glow-enhanced {
    0% {
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(76, 175, 80, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0);
    }
}

/* ===== ANIMATION PULSE AMÉLIORÉE ===== */

@keyframes pulse-glow-enhanced {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }
    50% {
        box-shadow: 0 0 0 15px rgba(16, 185, 129, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

.custom-marker.online {
    animation: pulse-glow-enhanced 2s infinite;
}