/* Simple Likes - Complete & Optimized Styles */

/* ============================================
   Wrapper
   ============================================ */
.like {
    display: inline-flex;
    align-items: center;
    direction: ltr !important; /* قفل کردن جهت برای جلوگیری از تداخل قالب */
}

/* ============================================
   Button - بدون کادر
   ============================================ */
.sl-button {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-direction: row !important; /* اجبار به چیدمان افقی */
    direction: ltr !important; /* عدد همیشه راست، قلب همیشه چپ */
    gap: 6px !important;
    padding: 4px 8px !important;
    border: none !important;
    background: transparent !important;
    color: #666 !important;
    text-decoration: none !important;
    font-size: 14px !important;
    line-height: 1 !important;
    transition: all 0.3s ease !important;
    cursor: pointer !important;
    height: auto !important;
}

.sl-button.liked {
    color: #e74c3c !important;
}

/* ============================================
   Hover فقط برای دسکتاپ
   ============================================ */
@media (hover: hover) and (pointer: fine) {
    .sl-button:hover {
        color: #e74c3c !important;
        text-decoration: none !important;
    }

    .sl-button:hover .sl-icon {
        transform: scale(1.1);
    }
}

/* ============================================
   Focus - دسکتاپ (حذف سایه کلیک ماوس، حفظ کیبورد)
   ============================================ */
.sl-button:focus {
    outline: none !important;
    box-shadow: none !important;
}

.sl-button:focus:not(:focus-visible) {
    outline: none !important;
    box-shadow: none !important;
}

.sl-button:focus-visible {
    outline: 2px solid #e74c3c !important;
    outline-offset: 2px !important;
    border-radius: 6px !important;
}

/* ============================================
   Icon (SVG) - قلب همیشه سمت چپ
   ============================================ */
.sl-button .sl-icon {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    order: 1 !important; /* اول قلب نمایش داده شود */
    height: 22px !important;
    width: 22px !important;
    transition: all 0.3s ease !important;
    margin: 0 !important;
    padding: 0 !important;
}

.sl-button .sl-icon svg {
    width: 22px !important;
    height: 22px !important;
}

 /* ============================================
   ❤️ انیمیشن ضربان قلب
   ============================================ */
.sl-button.liked .sl-icon {
    animation: sl-heart-beat 0.6s ease-in-out;
}

@keyframes sl-heart-beat {
    0%   { transform: scale(1); }
    25%  { transform: scale(1.3); }
    50%  { transform: scale(0.95); }
    75%  { transform: scale(1.15); }
    100% { transform: scale(1); }
}

/* ============================================
   Count (عدد) - همیشه سمت راست
   ============================================ */
.sl-button .sl-count,
.sl-button i.sl-count,
.sl-button span.sl-count {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    order: 2 !important; /* دوم عدد نمایش داده شود */
    font-style: normal !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    margin: 0 !important;
    padding: 0 !important;
    color: #666 !important;
}

/* ============================================
   مخفی کردن عناصر اضافه (لودر و آیکون پیش‌فرض)
   ============================================ */
.sl-button .icon-heart,
.sl-loader {
    display: none !important;
}

/* ============================================
   Responsive - تنظیمات صفحه نمایش‌های کوچک
   ============================================ */
@media (max-width: 768px) {
    .sl-button {
        gap: 4px !important; /* فاصله مناسب بین قلب و عدد در موبایل */
    }

    .sl-button .sl-icon {
        height: 24px !important;
        width: 24px !important;
    }

    .sl-button .sl-icon svg {
        width: 24px !important;
        height: 24px !important;
    }

    .sl-button .sl-count,
    .sl-button i.sl-count,
    .sl-button span.sl-count {
        font-size: 13px !important;
        line-height: 1 !important; 
    }
}

/* ============================================
   مخفی کردن دکمه تا زمان لود واقعی (جلوگیری از پرش)
   ============================================ */
.sl-wrapper {
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.sl-wrapper.sl-synced {
    visibility: visible;
    opacity: 1;
}

/* ============================================
   رفع کامل حالت فوکوس/سایه بعد از لمس در دستگاه‌های لمسی
   ============================================ */
@media (hover: none) and (pointer: coarse) {
    .sl-button,
    .sl-button:focus,
    .sl-button:active,
    .sl-button:focus-visible,
    .sl-button:hover {
        outline: none !important;
        box-shadow: none !important;
        -webkit-box-shadow: none !important;
        -webkit-tap-highlight-color: transparent !important;
    }
}
