/* Styles pour le système de favoris */

/* Bouton favori de base */
.favorite-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s ease;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.favorite-btn:hover {
    background-color: #f3f4f6;
    color: #ef4444;
    transform: scale(1.1);
}

/* État favori actif */
.favorite-btn.active {
    color: #ef4444;
}

.favorite-btn.active i {
    animation: heartBeat 0.3s ease-in-out;
}

/* Animation de battement de cœur */
@keyframes heartBeat {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

/* Indicateur de chargement */
.favorite-btn.loading {
    pointer-events: none;
    opacity: 0.6;
}

.favorite-btn.loading i {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Notification de succès/erreur */
.favorite-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    z-index: 10000;
    max-width: 300px;
    word-wrap: break-word;
    animation: slideInRight 0.3s ease-out;
}

.favorite-notification.success {
    background: #10b981;
}

.favorite-notification.error {
    background: #ef4444;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Styles pour les cartes d'annonces avec favoris */
.annonce-card .favorite-btn {
    position: relative;
    z-index: 2;
}

/* Hover effect sur les cartes */
.annonce-card:hover .favorite-btn {
    background-color: rgba(239, 68, 68, 0.1);
}

/* État désactivé pour utilisateurs non connectés */
.favorite-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Responsive */
@media (max-width: 768px) {
    .favorite-btn {
        padding: 6px;
        font-size: 0.875rem;
    }
    
    .favorite-notification {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
}
