/* Reusable Ranking Badge Styles for Discovery Cards */
.ranking-badge {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    z-index: 12;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem 0.55rem;
    font-family: 'IBM Plex Sans Arabic', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.02em;
    color: #F8FAFC;
    background: rgba(13, 18, 40, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
    user-select: none;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Ensure absolute position in top-right regardless of RTL/LTR direction */
[dir="rtl"] .ranking-badge,
[dir="ltr"] .ranking-badge {
    left: auto;
    right: 0.75rem;
}

/* Prevent card-badges (featured/verified/nitro) from overlapping ranking-badge in RTL */
[dir="rtl"] .card-badges {
    left: 0.75rem;
    right: auto;
}

/* Top 3 Ranks Premium Styling */
.ranking-badge.rank-1 {
    color: #FBBF24;
    background: rgba(30, 24, 15, 0.85);
    border-color: rgba(245, 158, 11, 0.5);
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.2), 0 2px 8px rgba(0, 0, 0, 0.4);
}

.ranking-badge.rank-2 {
    color: #F1F5F9;
    background: rgba(24, 30, 42, 0.85);
    border-color: rgba(203, 213, 225, 0.45);
    box-shadow: 0 4px 14px rgba(148, 163, 184, 0.15), 0 2px 8px rgba(0, 0, 0, 0.4);
}

.ranking-badge.rank-3 {
    color: #F59E0B;
    background: rgba(32, 22, 16, 0.85);
    border-color: rgba(217, 119, 6, 0.45);
    box-shadow: 0 4px 14px rgba(217, 119, 6, 0.15), 0 2px 8px rgba(0, 0, 0, 0.4);
}

/* Hover effect on server-card / profile-card */
.server-card:hover .ranking-badge,
.profile-card:hover .ranking-badge {
    transform: translateY(-1px) scale(1.03);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45);
}

.server-card:hover .ranking-badge.rank-1,
.profile-card:hover .ranking-badge.rank-1 {
    border-color: rgba(245, 158, 11, 0.75);
    box-shadow: 0 6px 18px rgba(245, 158, 11, 0.35);
}

.server-card:hover .ranking-badge.rank-2,
.profile-card:hover .ranking-badge.rank-2 {
    border-color: rgba(203, 213, 225, 0.7);
    box-shadow: 0 6px 18px rgba(203, 213, 225, 0.25);
}

.server-card:hover .ranking-badge.rank-3,
.profile-card:hover .ranking-badge.rank-3 {
    border-color: rgba(217, 119, 6, 0.7);
    box-shadow: 0 6px 18px rgba(217, 119, 6, 0.25);
}
