/* ===========================
   Engagement Section 
   - Visitor Counter & Like Button
   =========================== */

.engagement-section {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

/* --- Visitor Stats --- */
.visitor-stat {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 5px 12px;
    background: rgba(37, 99, 235, 0.04);
    border-radius: 10px;
    border: 1px solid rgba(37, 99, 235, 0.06);
    transition: all 0.3s;
}

.visitor-stat:hover {
    background: rgba(37, 99, 235, 0.08);
    border-color: rgba(37, 99, 235, 0.12);
}

.visitor-stat-icon {
    width: 15px;
    height: 15px;
    color: var(--primary, #6366f1);
    opacity: 0.7;
    flex-shrink: 0;
}

.visitor-count {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-main, #1e293b);
    min-width: 18px;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.visitor-label {
    font-size: 0.7rem;
    color: var(--text-muted, #94a3b8);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.visitor-divider {
    width: 1px;
    height: 18px;
    background: rgba(0, 0, 0, 0.08);
    flex-shrink: 0;
}

/* Live pulse indicator on the eye icon */
.visitor-stat-icon.live-pulse {
    animation: livePulse 2s ease-in-out infinite;
}

@keyframes livePulse {

    0%,
    100% {
        opacity: 0.7;
    }

    50% {
        opacity: 1;
    }
}

/* --- Like Button --- */
.like-btn {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 7px 16px 7px 12px;
    background: rgba(255, 255, 255, 0.7);
    border: 1.5px solid rgba(0, 0, 0, 0.08);
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
    position: relative;
    overflow: visible;
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.like-btn:hover {
    background: #fff5f5;
    border-color: rgba(255, 71, 87, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(255, 71, 87, 0.12);
}

.like-btn:active {
    transform: translateY(0) scale(0.97);
}

/* Heart Icon */
.heart-icon {
    width: 20px;
    height: 20px;
    transition: all 0.3s ease;
    color: #cbd5e1;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    flex-shrink: 0;
}

.like-btn.liked .heart-icon {
    color: #ff4757;
    fill: #ff4757;
    filter: drop-shadow(0 0 6px rgba(255, 71, 87, 0.4));
}

.like-btn.liked {
    background: rgba(255, 71, 87, 0.06);
    border-color: rgba(255, 71, 87, 0.2);
}

/* Heart pop animation on like */
.like-btn.animate .heart-icon {
    animation: heartPop 0.5s cubic-bezier(0.17, 0.89, 0.32, 1.49);
}

@keyframes heartPop {
    0% {
        transform: scale(1);
    }

    25% {
        transform: scale(1.35);
    }

    50% {
        transform: scale(0.9);
    }

    75% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

/* Button bounce */
.like-btn.animate {
    animation: btnBounce 0.5s cubic-bezier(0.17, 0.89, 0.32, 1.49);
}

@keyframes btnBounce {
    0% {
        transform: translateY(0) scale(1);
    }

    30% {
        transform: translateY(-5px) scale(1.03);
    }

    60% {
        transform: translateY(1px) scale(0.98);
    }

    100% {
        transform: translateY(0) scale(1);
    }
}

/* Like count */
.like-count-text {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary, #64748b);
    min-width: 16px;
    text-align: center;
    font-variant-numeric: tabular-nums;
    transition: color 0.3s;
}

.like-btn.liked .like-count-text {
    color: #ff4757;
}

/* Like message */
.like-message {
    font-size: 0.78rem;
    color: var(--text-muted, #94a3b8);
    margin: 0;
    font-weight: 400;
    line-height: 1.4;
    letter-spacing: -0.01em;
}

/* --- Heart Particles --- */
.heart-particle {
    position: absolute;
    top: 50%;
    left: 40%;
    font-size: 11px;
    pointer-events: none;
    z-index: 10;
    opacity: 0;
    animation: particleFly 0.85s ease-out forwards;
}

@keyframes particleFly {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1) rotate(0deg);
    }

    60% {
        opacity: 0.8;
    }

    100% {
        opacity: 0;
        transform: translate(calc(-50% + var(--tx)),
                calc(-50% + var(--ty))) scale(0.2) rotate(var(--rot));
    }
}

/* Glow ring on like */
.like-btn::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50px;
    border: 2px solid transparent;
    transition: border-color 0.4s;
    pointer-events: none;
}

.like-btn.liked::after {
    animation: glowRing 0.8s ease-out;
}

@keyframes glowRing {
    0% {
        border-color: rgba(255, 71, 87, 0.5);
        transform: scale(1);
    }

    100% {
        border-color: transparent;
        transform: scale(1.15);
    }
}

/* --- Responsive --- */

/* MacBook / smaller height screens */
@media (max-height: 900px) {
    .engagement-section {
        margin-top: 8px;
        padding-top: 8px;
        gap: 8px;
    }

    .visitor-stat {
        padding: 3px 8px;
        gap: 4px;
    }

    .visitor-count {
        font-size: 0.85rem;
    }

    .visitor-label {
        font-size: 0.6rem;
    }

    .visitor-stat-icon {
        width: 12px;
        height: 12px;
    }

    .visitor-divider {
        height: 14px;
    }

    .like-btn {
        padding: 4px 10px 4px 8px;
        gap: 4px;
    }

    .heart-icon {
        width: 16px;
        height: 16px;
    }

    .like-count-text {
        font-size: 0.75rem;
    }
}

/* Very small height screens */
@media (max-height: 750px) {
    .engagement-section {
        margin-top: 6px;
        padding-top: 6px;
        gap: 6px;
    }

    .visitor-stat {
        padding: 2px 6px;
        gap: 3px;
        border-radius: 6px;
    }

    .visitor-count {
        font-size: 0.8rem;
    }

    .visitor-label {
        font-size: 0.55rem;
    }

    .visitor-stat-icon {
        width: 11px;
        height: 11px;
    }

    .visitor-divider {
        height: 12px;
    }

    .like-btn {
        padding: 3px 8px 3px 6px;
        gap: 3px;
        border-radius: 30px;
    }

    .heart-icon {
        width: 14px;
        height: 14px;
    }

    .like-count-text {
        font-size: 0.7rem;
    }
}

/* Tablet */
@media (max-width: 1024px) {
    .engagement-section {
        margin-top: 14px;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .engagement-section {
        gap: 8px;
    }
}