/**
 * Le Gazouilleur - Styles pour les interactions des cartes d'événements
 * Remplace complètement la logique JavaScript complexe
 */

/* ===== CARTES D'ÉVÉNEMENTS ===== */

/* Base des cartes avec transitions fluides */
[data-event-id] {
    transition: all 0.2s ease-in-out;
    cursor: pointer;
    position: relative;
}

/* Surbrillance au survol - Version CSS pure */
[data-event-id]:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    z-index: 10;
}

/* Anneau de surbrillance au survol */
[data-event-id]:hover::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border: 2px solid #10b981; /* ring-earth-500 */
    border-radius: inherit;
    opacity: 0.5;
    pointer-events: none;
    z-index: -1;
}

/* ===== BOUTONS DE CHANGEMENT DE VUE ===== */

/* Boutons de basculement */
.view-toggle-btn {
    transition: all 0.2s ease-in-out;
    cursor: pointer;
}

.view-toggle-btn:hover {
    transform: translateY(-1px);
}

/* État actif des boutons */
.view-toggle-btn.active {
    background-color: #f3f4f6; /* bg-earth-100 */
    color: #374151; /* text-earth-700 */
}

.view-toggle-btn:not(.active) {
    color: #34d399; /* text-nature-400 */
}

/* ===== TRANSITIONS DE VUE ===== */

/* Conteneurs de vue avec transitions */
.view-container {
    transition: opacity 0.3s ease-in-out;
}

.view-container.hidden {
    opacity: 0;
    pointer-events: none;
}

/* ===== ANIMATIONS D'ENTRÉE ===== */

/* Animation d'apparition des cartes */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

[data-event-id] {
    animation: fadeInUp 0.3s ease-out;
}

/* ===== BOUTONS FAVORIS ===== */

/* Bouton cœur toggle pour les favoris - UNIQUEMENT pour les cartes */
.event-card .favorite-btn {
    transition: all 0.2s ease;
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    z-index: 10;
    padding: 0.5rem;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(4px);
    transform: scale(1);
}

.event-card .favorite-btn:hover {
    transform: scale(1.1);
}

/* État non favori - UNIQUEMENT pour les cartes */
.event-card .favorite-btn[data-is-favorited="false"] {
    color: #6b7280; /* text-gray-500 */
}

.event-card .favorite-btn[data-is-favorited="false"]:hover {
    color: #374151; /* text-gray-700 */
    background: rgba(243, 244, 246, 0.95) !important;
}

/* État favori - UNIQUEMENT pour les cartes */
.event-card .favorite-btn[data-is-favorited="true"] {
    color: #dc2626; /* text-red-600 */
}

.event-card .favorite-btn[data-is-favorited="true"]:hover {
    color: #b91c1c; /* text-red-700 */
    background: rgba(254, 226, 226, 0.95) !important;
}

/* ===== RESPONSIVE ===== */

/* Ajustements pour mobile */
@media (max-width: 768px) {
    [data-event-id]:hover {
        transform: scale(1.02); /* Moins de zoom sur mobile */
    }
    
    .view-toggle-btn:hover {
        transform: none; /* Pas d'effet hover sur mobile */
    }
    
    .event-card .favorite-btn {
        padding: 0.375rem; /* Plus petit sur mobile */
    }
    
    .event-card .favorite-btn:hover {
        transform: scale(1.05); /* Moins de zoom sur mobile */
    }
}

/* ===== ACCESSIBILITÉ ===== */

/* Focus visible pour la navigation clavier */
[data-event-id]:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Réduction des animations pour les utilisateurs qui les préfèrent */
@media (prefers-reduced-motion: reduce) {
    [data-event-id],
    .view-container,
    .view-toggle-btn {
        transition: none;
        animation: none;
    }
    
    [data-event-id]:hover {
        transform: none;
    }
}
