/* 
 * Heart Icons Module
 * Handles heart icon styling, positioning, and favorite interactions
 * FIXED: Perfect centering and proportions
 */

/* Heart Container Positioning */
.ppg-heart-container {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 10;
}

/* Heart Icon Base Styles */
.ppg-heart {
    display: inline-flex; /* Changed from inline-block to inline-flex for better centering */
    align-items: center; /* Vertical centering */
    justify-content: center; /* Horizontal centering */
    width: 32px;
    height: 32px;
    background: var(--ppg-heart-default-bg-color, rgba(0, 0, 0, 0.7));
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    position: relative;
    opacity: 0;
    color: var(--ppg-heart-default-color);
    /* Shadow only on the circle background for better visibility */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3), 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* Heart Icon Symbol - FIXED: Better positioning and sizing */
.ppg-heart::before {
    content: '♡';
    color: currentColor;
    font-size: 20px;
    line-height: 1;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif; /* Better font rendering */
    transition: all 0.3s ease;
    /* Removed absolute positioning - flexbox handles centering now */
    display: block;
    text-align: center;
    /* Fine-tune positioning with margin if needed */
    margin-top: -1px; /* Slight adjustment for optical centering */
}

/* Enhanced hover behavior - heart appears on image hover */
.ppg-item:hover .ppg-heart {
    opacity: 0.8;
}

/* Active state - always visible when favorited */
.ppg-heart.ppg-heart-active {
    color: var(--ppg-heart-active-color);
    background: var(--ppg-heart-active-bg-color, rgba(0, 0, 0, 0.7));
    opacity: 1;
    /* Enhanced shadow for active state - only on circle */
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.4), 0 2px 6px rgba(231, 76, 60, 0.3);
}

.ppg-heart.ppg-heart-active::before {
    content: '♥';
    color: currentColor;
    /* Filled heart might need slight size adjustment */
    font-size: 20px; /* Slightly smaller for filled heart */
}

/* Heart hover effects */
.ppg-heart:hover {
    transform: scale(1.1);
    opacity: 1 !important;
    /* Enhanced hover shadow - only on circle background */
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3), 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Pulse animation for heart interactions */
.ppg-heart.pulse {
    animation: heartPulse 0.3s ease-in-out;
}

/* Pulse keyframes - make sure this exists */
@keyframes heartPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* FIXED: Ensure inactive hearts properly hide when not hovering */
.ppg-item:not(:hover) .ppg-heart:not(.ppg-heart-active) {
    opacity: 0 !important;
    transition: opacity 0.3s ease;
}

/* Ensure active hearts remain visible */
.ppg-item .ppg-heart.ppg-heart-active {
    opacity: 1 !important;
}

/* Better support for different screen densities */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .ppg-heart::before {
        /* Slightly adjust for high-DPI displays */
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}