/* ============================================================
   Raditone Vote — لایک/دیسلایک سبک اینستاگرامی + امتیاز ستاره‌ای
   هماهنگ با نمونه: سبز برای لایک، صورتی برای دیسلایک، کهربایی برای ستاره
   ============================================================ */

/* ===== کانتینر ===== */
.rt-vote-container,
.rt-comment-vote-container {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    direction: rtl;
    user-select: none;
    position: relative;
}

.rt-vote-duo {
    gap: 8px;
}

/* دکمه‌های لایک و دیسلایک نظرات */
.rt-comment-vote-duo {
    gap: 6px;
}

/* خنثی‌کردن جایگاه‌گذاری قدیمی مطلق */
.info-vote {
    position: static;
    left: auto;
    margin-bottom: 0;
}

.raditone-vote-section {
    position: static;
}

/* ===== دکمه‌های لایک/دیسلایک ===== */
.rt-vote-container.rt-vote-duo .rt-vote-btn,
.rt-comment-vote-container .rt-comment-vote-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    width: auto;
    height: auto;
    min-height: 34px;
    padding: 6px 12px;
    border-radius: 0.75rem;
    border: 1px solid transparent;
    background: #f1f5f9;
    color: #64748b;
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    position: relative;
    overflow: visible;
    transition: background-color 0.18s ease, color 0.18s ease, transform 0.18s ease, border-color 0.18s ease, box-shadow 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

/* سایز متناسب در بخش نظرات */
.rt-comment-vote-duo .rt-vote-btn {
    min-height: 28px;
    padding: 4px 10px;
    font-size: 11px;
    border-radius: 8px;
    gap: 5px;
}

/* حالت پیش‌فرض: لایک سبز، دیسلایک صورتی/رز */
.rt-vote-container.rt-vote-duo .rt-vote-like {
    background: #ecfdf5;
    color: #059669;
    border-color: rgba(16, 185, 129, 0.15);
}

.rt-vote-container.rt-vote-duo .rt-vote-like:hover {
    background: #10b981;
    color: #ffffff;
    border-color: #10b981;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.28);
}

.rt-vote-container.rt-vote-duo .rt-vote-dislike {
    background: #fff1f2;
    color: #e11d48;
    border-color: rgba(244, 63, 94, 0.15);
}

.rt-vote-container.rt-vote-duo .rt-vote-dislike:hover {
    background: #f43f5e;
    color: #ffffff;
    border-color: #f43f5e;
    box-shadow: 0 4px 12px rgba(244, 63, 94, 0.28);
}

/* حالت انتخاب‌شده (فعال) */
.rt-vote-container.rt-vote-duo .rt-vote-like.active {
    background: #10b981 !important;
    color: #ffffff !important;
    border-color: #10b981 !important;
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.42) !important;
}

.rt-vote-container.rt-vote-duo .rt-vote-dislike.active {
    background: #f43f5e !important;
    color: #ffffff !important;
    border-color: #f43f5e !important;
    box-shadow: 0 4px 16px rgba(244, 63, 94, 0.42) !important;
}

.rt-vote-container.rt-vote-duo .rt-vote-btn:active,
.rt-comment-vote-container .rt-comment-vote-btn:active {
    transform: scale(0.92);
}

.rt-vote-container.rt-vote-duo .rt-vote-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.3);
}

.rt-vote-container.rt-vote-duo .rt-vote-dislike:focus-visible {
    box-shadow: 0 0 0 3px rgba(244, 63, 94, 0.3);
}

/* ===== آیکون‌ها ===== */
.rt-vote-container.rt-vote-duo .rt-vote-btn .rt-icon,
.rt-vote-container.rt-vote-duo .rt-vote-btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: currentColor;
    stroke: currentColor;
    fill: currentColor;
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.15s ease, fill 0.15s ease;
}

.rt-comment-vote-duo .rt-vote-btn .rt-icon,
.rt-comment-vote-duo .rt-vote-btn svg {
    width: 14px;
    height: 14px;
}

.rt-comment-vote-container .rt-comment-vote-btn .rt-icon {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
    color: currentColor;
    stroke: currentColor;
    fill: none;
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.15s ease, fill 0.15s ease;
}

.rt-vote-container.rt-vote-duo .rt-vote-btn:hover .rt-icon,
.rt-vote-container.rt-vote-duo .rt-vote-btn:hover svg {
    transform: scale(1.15);
}

.rt-comment-vote-container .rt-comment-vote-btn:hover .rt-icon {
    transform: scale(1.15);
}

.rt-vote-container.rt-vote-duo .rt-vote-btn.active .rt-icon,
.rt-vote-container.rt-vote-duo .rt-vote-btn.active svg {
    fill: currentColor;
    stroke: currentColor;
    transform: scale(1.1);
}

.rt-comment-vote-container .rt-comment-vote-btn.active .rt-icon {
    fill: currentColor;
    stroke: currentColor;
    transform: scale(1.1);
}

/* ===== شمارنده ===== */
.rt-vote-container.rt-vote-duo .rt-vote-btn .rt-count,
.rt-comment-vote-container .rt-comment-vote-btn .rt-count {
    min-width: 12px;
    text-align: center;
    font-size: 12px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    padding: 0;
    border-radius: 0;
    background: transparent;
    color: currentColor;
    transition: color 0.15s ease, transform 0.2s ease;
}

.rt-comment-vote-duo .rt-vote-btn .rt-count {
    font-size: 11px;
}

/* ===== دکمهٔ قلب قدیمی (سازگاری با نسخه‌های قبلی نظرات) ===== */
.rt-comment-vote-btn.rt-heart-btn {
    background: #f1f5f9;
    color: #64748b;
}

.rt-comment-vote-btn.rt-heart-btn:hover,
.rt-comment-vote-btn.rt-heart-btn.active {
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444;
}

.rt-comment-vote-btn.rt-heart-btn .rt-count {
    padding: 3px 9px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.05);
}

/* ===== افکت‌های انیمیشن و بازخورد لمسی لایک و دیسلایک ===== */
.rt-vote-btn.rt-animating-like {
    animation: rtLikeRing 0.55s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.rt-vote-btn.rt-animating-like .rt-icon,
.rt-vote-btn.rt-animating-like svg {
    animation: rtLikePop 0.55s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes rtLikePop {
    0% { transform: scale(1); }
    30% { transform: scale(1.52) rotate(-18deg); }
    60% { transform: scale(0.88) rotate(4deg); }
    100% { transform: scale(1.1) rotate(0deg); }
}

@keyframes rtLikeRing {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    100% { box-shadow: 0 0 0 16px rgba(16, 185, 129, 0); }
}

.rt-vote-btn.rt-animating-dislike {
    animation: rtDislikeRing 0.55s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.rt-vote-btn.rt-animating-dislike .rt-icon,
.rt-vote-btn.rt-animating-dislike svg {
    animation: rtDislikeShake 0.55s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes rtDislikeShake {
    0% { transform: scale(1); }
    25% { transform: scale(1.45) rotate(18deg); }
    50% { transform: scale(0.88) rotate(-10deg); }
    75% { transform: scale(1.16) rotate(4deg); }
    100% { transform: scale(1.1) rotate(0deg); }
}

@keyframes rtDislikeRing {
    0% { box-shadow: 0 0 0 0 rgba(244, 63, 94, 0.7); }
    100% { box-shadow: 0 0 0 16px rgba(244, 63, 94, 0); }
}

.rt-vote-like .rt-count.rt-bump {
    animation: rtCountBumpLike 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes rtCountBumpLike {
    0% { transform: translateY(0); }
    50% { transform: translateY(-4px) scale(1.28); color: #059669; }
    100% { transform: translateY(0) scale(1); }
}

.rt-vote-dislike .rt-count.rt-bump {
    animation: rtCountBumpDislike 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes rtCountBumpDislike {
    0% { transform: translateY(0); }
    50% { transform: translateY(4px) scale(1.28); color: #e11d48; }
    100% { transform: translateY(0) scale(1); }
}

.rt-bump {
    animation: rt-bump 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: inline-block;
}

@keyframes rt-bump {
    0% { transform: scale(1); }
    40% { transform: scale(1.4); }
    70% { transform: scale(0.92); }
    100% { transform: scale(1); }
}

/* ===== Toast سبک ===== */
.rt-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 999999;
    padding: 12px 18px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    direction: rtl;
    color: #ffffff;
    background: #3b82f6;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.25s ease, transform 0.25s ease;
    display: inline-flex;
    align-items: center;
}

.rt-toast--success {
    background: #10b981;
}

.rt-toast--dislike {
    background: #f43f5e;
}

.rt-toast--error {
    background: #ef4444;
}

.rt-toast--info {
    background: #3b82f6;
}

.rt-toast-out {
    opacity: 0;
    transform: translateY(14px);
}

/* ============================================================
   امتیاز ستاره‌ای (Rating Stars)
   ============================================================ */
.rt-rating-container {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    direction: rtl;
    user-select: none;
    flex-wrap: wrap;
}

.rt-rating-stars {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #fbbf24;
}

.rt-star {
    background: none;
    border: 0;
    padding: 0;
    margin: 0;
    cursor: pointer;
    color: #fbbf24;
    line-height: 0;
    transition: transform 0.15s ease, color 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

.rt-star svg {
    width: 18px;
    height: 18px;
    display: block;
}

.rt-star:hover,
.rt-star.hover {
    transform: scale(1.25);
}

.rt-star.is-empty {
    color: #e2e8f0;
}

.dark .rt-star.is-empty,
[data-theme="dark"] .rt-star.is-empty {
    color: #334155;
}

.rt-star.is-user {
    color: #f59e0b;
}

.rt-star:disabled {
    cursor: default;
    opacity: 0.7;
}

.rt-rating-container.rt-rating--readonly .rt-star {
    cursor: default;
}

.rt-rating-container.rt-rating--readonly .rt-star:hover {
    transform: none;
}

.rt-rating-score {
    font-size: 12px;
    font-weight: 800;
    color: var(--text-primary, #334155);
    margin-right: 4px;
    white-space: nowrap;
}

.dark .rt-rating-score,
[data-theme="dark"] .rt-rating-score {
    color: #e2e8f0;
}

.rt-rating-votes {
    font-size: 11px;
    color: var(--text-secondary, #94a3b8);
    white-space: nowrap;
}

/* ===== پست‌های پرلایک ===== */
.rt-top-posts ul {
    list-style: none;
    padding: 0;
    margin: 0;
    direction: rtl;
}

.rt-top-posts li {
    padding: 6px 0;
    border-bottom: 1px solid var(--border-primary, #e2e8f0);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.rt-top-posts li a {
    color: var(--text-primary, #1e293b);
    text-decoration: none;
}

.rt-top-posts li a:hover {
    color: #ef4444;
}

/* ===== تیره / Dark Mode ===== */
.dark .rt-vote-container.rt-vote-duo .rt-vote-like,
[data-theme="dark"] .rt-vote-container.rt-vote-duo .rt-vote-like {
    background: rgba(16, 185, 129, 0.12);
    color: #34d399;
    border-color: rgba(16, 185, 129, 0.25);
}

.dark .rt-vote-container.rt-vote-duo .rt-vote-like:hover,
.dark .rt-vote-container.rt-vote-duo .rt-vote-like.active,
[data-theme="dark"] .rt-vote-container.rt-vote-duo .rt-vote-like:hover,
[data-theme="dark"] .rt-vote-container.rt-vote-duo .rt-vote-like.active {
    background: #10b981 !important;
    color: #ffffff !important;
}

.dark .rt-vote-container.rt-vote-duo .rt-vote-dislike,
[data-theme="dark"] .rt-vote-container.rt-vote-duo .rt-vote-dislike {
    background: rgba(244, 63, 94, 0.12);
    color: #fb7185;
    border-color: rgba(244, 63, 94, 0.25);
}

.dark .rt-vote-container.rt-vote-duo .rt-vote-dislike:hover,
.dark .rt-vote-container.rt-vote-duo .rt-vote-dislike.active,
[data-theme="dark"] .rt-vote-container.rt-vote-duo .rt-vote-dislike:hover,
[data-theme="dark"] .rt-vote-container.rt-vote-duo .rt-vote-dislike.active {
    background: #f43f5e !important;
    color: #ffffff !important;
}

.dark .rt-comment-vote-btn.rt-heart-btn,
[data-theme="dark"] .rt-comment-vote-btn.rt-heart-btn {
    background: #1e293b;
    color: #94a3b8;
}

.dark .rt-comment-vote-btn.rt-heart-btn .rt-count,
[data-theme="dark"] .rt-comment-vote-btn.rt-heart-btn .rt-count {
    background: rgba(255, 255, 255, 0.08);
}

/* ===== واکنش‌گرا ===== */
@media (max-width: 640px) {
    .rt-vote-container.rt-vote-duo .rt-vote-btn,
    .rt-comment-vote-container .rt-comment-vote-btn {
        padding: 5px 10px;
        font-size: 11px;
    }

    .rt-star svg {
        width: 16px;
        height: 16px;
    }

    .rt-toast {
        right: 12px;
        left: 12px;
        bottom: 12px;
    }
}