/**
 * 🎮 EMOCARD Portfolio Likes - CSS
 * Système de likes gamifié avec cœurs animés (style personnalisation)
 * 
 * @version 2.0.0 - Réutilisation des assets cœurs
 * @date 2025-10-01
 */

/* 🎯 CONTENEUR LIKE - Overlay sur la photo */
.portfolio-like-container {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: all;
}

/* Apparition au hover du carrousel item */
.portfolio-carousel-item:hover .portfolio-like-container {
    opacity: 1;
    transform: translateY(0);
}

/* 🍎 SECTION À PROPOS - Toujours visible (pas dans carousel) */
.about-image .portfolio-like-container,
.about-section .portfolio-like-container {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

/* Toujours visible sur mobile/touch */
@media (hover: none) {
    .portfolio-like-container {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ❤️ BOUTON COEUR - Style identique à .option-checkbox-label */
.like-button {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 50% !important; /* 🔥 FORCER rondeur sur Firefox */
    -webkit-border-radius: 50% !important; /* 🍎 Safari */
    -moz-border-radius: 50% !important; /* 🔥 Firefox */
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.15),
        0 2px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    -webkit-transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1); /* Safari */
    position: relative;
    overflow: visible;
    z-index: 1000; /* 🍎 Safari: assurer visibilité */
    
    /* 🌐 CROSS-BROWSER RESET */
    -webkit-appearance: none !important; /* 🍎 Safari: réinitialiser styles natifs */
    -moz-appearance: none !important; /* 🔥 Firefox: réinitialiser styles natifs */
    appearance: none !important; /* Standard: réinitialiser styles natifs */
    -webkit-tap-highlight-color: transparent; /* 🍎 Safari: supprimer highlight */
    outline: none !important; /* Supprimer outline par défaut */
    box-sizing: border-box !important; /* Forcer box-sizing */
}

.like-button:hover {
    transform: scale(1.1);
    box-shadow: 
        0 6px 16px rgba(170, 123, 76, 0.3),
        0 3px 8px rgba(0, 0, 0, 0.15);
    background: rgba(255, 255, 255, 1);
    
    /* 🔥 FORCER rondeur sur hover Firefox */
    border-radius: 50% !important;
    -webkit-border-radius: 50% !important;
    -moz-border-radius: 50% !important;
    outline: none !important;
}

.like-button:active {
    transform: scale(0.95);
    
    /* 🔥 FORCER rondeur sur active Firefox */
    border-radius: 50% !important;
    -webkit-border-radius: 50% !important;
    -moz-border-radius: 50% !important;
    outline: none !important;
}

.like-button:focus {
    /* 🔥 FORCER rondeur sur focus Firefox */
    border-radius: 50% !important;
    -webkit-border-radius: 50% !important;
    -moz-border-radius: 50% !important;
    outline: none !important;
}

/* 🔥 FIREFOX SPÉCIFIQUE - Supprimer bordures internes */
.like-button::-moz-focus-inner {
    border: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* 💖 CŒUR ANIMÉ - Identique aux checkboxes de personnalisation */
.like-button::before {
    content: '♡';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 28px;
    color: #e74c3c;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    opacity: 1;
    z-index: 10;
    display: block;
    line-height: 1;
}

/* État liké - Cœur plein */
.like-button.liked::before {
    content: '♥';
    color: #e74c3c;
    animation: heartFill 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.like-button.liked {
    animation: heartBounce 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    background: linear-gradient(135deg, rgba(231, 76, 60, 0.1) 0%, rgba(231, 76, 60, 0.05) 100%);
}

/* Glow effect sur cœur liké */
.like-button.liked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    animation: heartGlow 2s ease-in-out infinite;
    pointer-events: none;
}

/* 💫 ANIMATIONS - Identiques à personnalisation */
@keyframes heartFill {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.3);
        opacity: 0.8;
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

@keyframes heartBounce {
    0% {
        transform: scale(1);
    }
    25% {
        transform: scale(0.95);
    }
    50% {
        transform: scale(1.1);
    }
    75% {
        transform: scale(0.98);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes heartGlow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(231, 76, 60, 0.3);
    }
    50% {
        box-shadow: 0 0 20px rgba(231, 76, 60, 0.6);
    }
}

/* 🎆 PARTICULES BURST - Animation au like */
@keyframes burstParticle {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(var(--tx), var(--ty)) scale(0);
        opacity: 0;
    }
}

.burst-particle {
    position: absolute;
    width: 6px;
    height: 6px;
    background: #e74c3c;
    border-radius: 50%;
    pointer-events: none;
    animation: burstParticle 0.6s ease-out forwards;
}

/* 🔢 COMPTEUR LIKES */
.like-counter {
    background: rgba(255, 255, 255, 0.95);
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 13px;
    font-weight: 600;
    color: #3a2a1f;
    box-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.1),
        0 1px 4px rgba(0, 0, 0, 0.08);
    min-width: 36px;
    text-align: center;
    font-family: 'Inter', -apple-system, system-ui, sans-serif;
    letter-spacing: -0.02em;
    transition: all 0.3s ease;
}

.like-counter.has-likes {
    background: rgba(231, 76, 60, 0.1);
    color: #e74c3c;
}

/* ✨ ANIMATION COUNT-UP */
@keyframes countUp {
    0% {
        transform: translateY(10px) scale(0.8);
        opacity: 0;
    }
    50% {
        transform: translateY(-5px) scale(1.1);
    }
    100% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.like-counter.animate-count {
    animation: countUp 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* 📱 RESPONSIVE */
@media (max-width: 768px) {
    .portfolio-like-container {
        top: 8px;
        right: 8px;
    }
    
    .like-button {
        width: 44px;
        height: 44px;
    }
    
    .like-button::before {
        font-size: 24px;
    }
    
    .like-counter {
        font-size: 12px;
        padding: 4px 10px;
        min-width: 32px;
    }
}

@media (max-width: 480px) {
    .like-button {
        width: 40px;
        height: 40px;
    }
    
    .like-button::before {
        font-size: 22px;
    }
    
    .like-counter {
        font-size: 11px;
        padding: 4px 8px;
        min-width: 28px;
    }
}

/* 🔄 ÉTAT CHARGEMENT */
.like-button.loading {
    pointer-events: none;
    opacity: 0.6;
}

.like-button.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid #e74c3c;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

/* 🚫 Masquer l'icône SVG pendant l'utilisation des cœurs Unicode */
.like-button .like-icon {
    display: none !important;
}

