/**
 * GTG Cuori - Frontend Styles
 *
 * @package GTG_Cuori
 * @author G Tech Group
 * @link https://gtechgroup.it
 */

/* Container */
.jepi-heart-like-wrapper {
    display: inline-block;
    margin: 10px 0;
    line-height: 1;
}

/* Button Reset */
.jepi-heart-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.2s ease;
    border-radius: 20px;
    font-family: inherit;
    color: inherit;
}

.jepi-heart-button:hover {
    transform: scale(1.05);
}

.jepi-heart-button:focus {
    outline: 2px solid #e74c3c;
    outline-offset: 2px;
}

.jepi-heart-button:focus:not(:focus-visible) {
    outline: none;
}

.jepi-heart-button:focus-visible {
    outline: 2px solid #e74c3c;
    outline-offset: 2px;
}

.jepi-heart-button.jepi-loading {
    pointer-events: none;
    opacity: 0.6;
}

/* Heart Icon Container */
.jepi-heart-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
    color: #e74c3c;
}

/* SVG Heart */
.jepi-heart-icon svg {
    display: block;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: fill 0.3s ease, transform 0.3s ease;
}

/* Liked State */
.jepi-heart-icon.liked svg {
    fill: currentColor;
}

/* Sizes */
.jepi-heart-size-small .jepi-heart-icon svg {
    width: 18px;
    height: 18px;
}

.jepi-heart-size-small .jepi-heart-count {
    font-size: 12px;
}

.jepi-heart-size-medium .jepi-heart-icon svg {
    width: 24px;
    height: 24px;
}

.jepi-heart-size-medium .jepi-heart-count {
    font-size: 14px;
}

.jepi-heart-size-large .jepi-heart-icon svg {
    width: 32px;
    height: 32px;
}

.jepi-heart-size-large .jepi-heart-count {
    font-size: 16px;
}

.jepi-heart-size-xlarge .jepi-heart-icon svg {
    width: 48px;
    height: 48px;
}

.jepi-heart-size-xlarge .jepi-heart-count {
    font-size: 20px;
}

/* Count */
.jepi-heart-count {
    font-weight: 600;
    min-width: 1em;
    color: #333;
    transition: transform 0.2s ease;
}

/* Animation - Pulse */
.jepi-heart-icon.jepi-animate {
    animation: jepiHeartPulse 0.4s ease-in-out;
}

@keyframes jepiHeartPulse {
    0% {
        transform: scale(1);
    }
    25% {
        transform: scale(1.3);
    }
    50% {
        transform: scale(0.9);
    }
    75% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

/* Animation - Count bounce */
.jepi-heart-count.jepi-count-animate {
    animation: jepiCountBounce 0.3s ease-out;
}

@keyframes jepiCountBounce {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

/* Toast Notifications */
.jepi-toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    padding: 12px 24px;
    background: #333;
    color: #fff;
    border-radius: 8px;
    z-index: 99999;
    opacity: 0;
    transition: all 0.3s ease;
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.jepi-toast.jepi-toast-show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.jepi-toast-error {
    background: #e74c3c;
}

.jepi-toast-success {
    background: #27ae60;
}

/* Context Variations */
.jepi-heart-context-content {
    margin: 20px 0;
}

.jepi-heart-context-title {
    margin-left: 10px;
    vertical-align: middle;
}

.jepi-heart-context-elementor {
    margin: 0;
}

/* Elementor Posts Widget Integration */
.jepi-heart-context-elementor-posts {
    margin: 8px 0 0 0;
}

/* Inline style - accanto ai metadata */
.jepi-heart-inline {
    display: inline-flex;
    vertical-align: middle;
    margin-left: 10px;
}

.jepi-heart-inline .jepi-heart-button {
    padding: 4px 8px;
    gap: 4px;
}

.jepi-heart-elementor-wrapper {
    margin-top: 10px;
}

/* Overlay Position */
.jepi-heart-overlay {
    position: absolute;
    bottom: 10px;
    right: 10px;
    z-index: 10;
    margin: 0;
}

.jepi-heart-overlay .jepi-heart-button {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(4px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.jepi-heart-overlay .jepi-heart-button:hover {
    background: rgba(255, 255, 255, 1);
}

/* Top-left overlay variant */
.jepi-heart-overlay-top-left {
    top: 10px;
    left: 10px;
    bottom: auto;
    right: auto;
}

/* Elementor Cards Skin */
.elementor-posts--skin-cards .jepi-heart-like-wrapper {
    padding: 0 20px 15px;
}

/* Elementor Classic Skin */
.elementor-posts--skin-classic .jepi-heart-like-wrapper {
    margin-top: 15px;
}

/* Loop Grid */
.e-loop-item .jepi-heart-like-wrapper {
    margin-top: 10px;
}

/* UAEL Posts Integration */
.jepi-heart-uael {
    margin: 0;
}

.jepi-heart-uael.jepi-heart-inline {
    display: inline-flex;
    vertical-align: middle;
    margin-left: 10px;
}

.jepi-heart-uael .jepi-heart-button {
    padding: 4px 8px;
    gap: 4px;
}

.uael-post__meta-data .jepi-heart-uael {
    display: inline-flex;
    align-items: center;
}

/* UAEL context */
.jepi-heart-context-uael-posts {
    margin: 0;
}

/* UAEL: Riga pulsante + cuore */
.uael-post__cta-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.uael-post__cta-wrap .jepi-heart-uael {
    display: inline-flex;
}

/* White heart for dark overlays */
.jepi-heart-overlay-white .jepi-heart-icon {
    color: #fff;
}

.jepi-heart-overlay-white .jepi-heart-count {
    color: #fff;
}

.jepi-heart-overlay-white .jepi-heart-button {
    background: rgba(0, 0, 0, 0.5);
}

/* Responsive */
@media (max-width: 768px) {
    .jepi-heart-button {
        padding: 6px 10px;
    }

    .jepi-heart-size-large .jepi-heart-icon svg {
        width: 28px;
        height: 28px;
    }

    .jepi-heart-size-xlarge .jepi-heart-icon svg {
        width: 36px;
        height: 36px;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .jepi-heart-count {
        color: #e0e0e0;
    }

    .jepi-toast {
        background: #444;
    }
}

/* Print - Hide */
@media print {
    .jepi-heart-like-wrapper {
        display: none !important;
    }
}
