/* ===== MODERN RANKING PAGE STYLES ===== */
/* Matches the index page "Top Players" card style with golden animated border */

.ranking-page-wrapper {
    min-height: 100vh;
    padding: 2rem 0;
}

/* Main Card with Golden Animated Border */
.ranking-card-modern {
    position: relative;
    background: rgba(15, 15, 35, 0.85);
    border-radius: 20px;
    overflow: visible;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4);
}

.ranking-card-modern::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 20px;
    padding: 2px;
    background: linear-gradient(
        var(--gold-angle, 0deg),
        #ffd700,
        #ffec8b,
        #daa520,
        #b8860b,
        #ffd700,
        #fff8dc,
        #ffd700
    );
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    animation: goldBorderRotate 3s linear infinite;
    z-index: -1;
}

.ranking-card-modern::after {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    border-radius: 22px;
    background: linear-gradient(
        var(--gold-angle, 0deg),
        rgba(255, 215, 0, 0.4),
        rgba(255, 236, 139, 0.2),
        rgba(218, 165, 32, 0.4),
        rgba(184, 134, 11, 0.2),
        rgba(255, 215, 0, 0.4)
    );
    filter: blur(8px);
    opacity: 0.6;
    animation: goldBorderRotate 3s linear infinite, goldPulseModern 2s ease-in-out infinite;
    z-index: -2;
}

@property --gold-angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}

@keyframes goldBorderRotate {
    0% { --gold-angle: 0deg; }
    100% { --gold-angle: 360deg; }
}

@keyframes goldPulseModern {
    0%, 100% { opacity: 0.5; filter: blur(8px); }
    50% { opacity: 0.8; filter: blur(12px); }
}

/* Header Section */
.ranking-header-modern {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    background: rgba(15, 15, 35, 0.95);
    border-radius: 18px 18px 0 0;
    border-bottom: 1px solid rgba(255, 215, 0, 0.2);
    flex-wrap: wrap;
    gap: 1rem;
}

.ranking-title-section {
    flex: 1;
    min-width: 200px;
}

.ranking-main-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ranking-main-title i {
    filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.5));
}

/* Toggle Section */
.ranking-toggle-section {
    flex-shrink: 0;
}

.ranking-page-wrapper .ranking-toggle-modern {
    display: inline-flex !important;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 6px;
    gap: 6px !important;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.ranking-page-wrapper .ranking-toggle-modern .toggle-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px !important;
    border: none;
    background: rgba(255, 255, 255, 0.03);
    color: rgba(255, 255, 255, 0.6);
    border-radius: 8px !important;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    white-space: nowrap;
    font-size: 0.9rem;
    width: auto !important;
    height: auto !important;
}

.ranking-page-wrapper .ranking-toggle-modern .toggle-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.ranking-page-wrapper .ranking-toggle-modern .toggle-btn.active {
    background: linear-gradient(135deg, #ffd700, #daa520) !important;
    color: #1a1a2e !important;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
}

.ranking-page-wrapper .ranking-toggle-modern .toggle-btn i {
    font-size: 0.9rem;
}

.ranking-page-wrapper .ranking-toggle-modern .toggle-divider {
    display: none;
}

.toggle-label {
    font-size: 0.85rem;
    font-weight: 500;
}

/* Job Filters */
.job-filters-modern {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 1rem 2rem;
    background: rgba(15, 15, 35, 0.9);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    justify-content: center;
}

.job-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.job-chip:hover {
    background: rgba(147, 51, 234, 0.3);
    border-color: rgba(147, 51, 234, 0.5);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(147, 51, 234, 0.3);
}

.job-chip-icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
    filter: brightness(1.1);
}

.job-chip-text {
    font-weight: 500;
}

/* Rankings List */
.rankings-list-modern {
    background: rgba(15, 15, 35, 0.95);
    border-radius: 0 0 18px 18px;
    overflow: visible;
}

.rank-item-modern {
    display: grid;
    grid-template-columns: 60px 1fr 180px 120px;
    align-items: center;
    padding: 1rem 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
    gap: 1.5rem;
}

.rank-item-modern:last-child {
    border-bottom: none;
}

.rank-item-modern:hover {
    background: rgba(102, 126, 234, 0.1);
    z-index: 10;
    position: relative;
}

/* Top 5 special backgrounds */
.rank-item-modern.top-1 {
    background: linear-gradient(90deg, rgba(255, 215, 0, 0.15), transparent);
}

.rank-item-modern.top-2 {
    background: linear-gradient(90deg, rgba(192, 192, 192, 0.12), transparent);
}

.rank-item-modern.top-3 {
    background: linear-gradient(90deg, rgba(205, 127, 50, 0.12), transparent);
}

.rank-item-modern.top-4 {
    background: linear-gradient(90deg, rgba(147, 51, 234, 0.1), transparent);
}

.rank-item-modern.top-5 {
    background: linear-gradient(90deg, rgba(102, 126, 234, 0.1), transparent);
}

/* Rank Position */
.rank-position {
    width: 50px;
    text-align: center;
    flex-shrink: 0;
}

.rank-icon-gold {
    font-size: 1.5rem;
    color: #ffd700;
    filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.6));
    animation: crownPulse 2s ease-in-out infinite;
}

.rank-icon-silver {
    font-size: 1.3rem;
    color: #c0c0c0;
    filter: drop-shadow(0 0 6px rgba(192, 192, 192, 0.5));
}

.rank-icon-bronze {
    font-size: 1.3rem;
    color: #cd7f32;
    filter: drop-shadow(0 0 6px rgba(205, 127, 50, 0.5));
}

.rank-icon-top5 {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.8);
}

.rank-num-modern {
    font-size: 0.9rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.05);
    padding: 6px 10px;
    border-radius: 8px;
}

@keyframes crownPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Character Preview on Name Click */
.char-preview-trigger {
    position: relative;
    cursor: default;
}

.char-preview-eye {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.3);
    margin-left: 4px;
    transition: all 0.3s ease;
    vertical-align: middle;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 4px;
}

.char-preview-eye:hover {
    color: rgba(147, 51, 234, 0.9);
    filter: drop-shadow(0 0 4px rgba(147, 51, 234, 0.4));
    background: rgba(147, 51, 234, 0.1);
}

.char-preview-trigger.char-preview-open .char-preview-eye {
    color: #9333ea;
    filter: drop-shadow(0 0 6px rgba(147, 51, 234, 0.6));
    background: rgba(147, 51, 234, 0.15);
}

/* Avatar popup on name click */
.char-preview-trigger .char-avatar-popup {
    position: absolute;
    bottom: calc(100% + 14px);
    left: 0;
    transform: scale(0.85) translateY(10px);
    width: 175px;
    height: 175px;
    border-radius: 18px;
    background: 
        radial-gradient(ellipse at center, rgba(30, 20, 60, 0.5) 0%, transparent 70%),
        linear-gradient(135deg, rgba(15, 15, 35, 0.3), rgba(25, 15, 50, 0.2));
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 2px solid rgba(147, 51, 234, 0.4);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5), 0 0 24px rgba(147, 51, 234, 0.15);    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 100;
    /* Ensure children can be absolutely positioned within */
    position: absolute;
}

.char-preview-trigger.char-preview-open .char-avatar-popup {
    opacity: 1;
    transform: scale(1) translateY(0);
    pointer-events: auto;
}

.char-avatar-popup img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    filter: drop-shadow(2px 3px 6px rgba(0, 0, 0, 0.7));
}

/* Chair background image */
.char-avatar-popup .chair-bg {
    position: absolute;
    bottom: 10%;
    left: 50%;
    transform: translateX(-50%);
    width: 65%;
    height: auto;
    max-height: 50%;
    object-fit: contain;
    filter: drop-shadow(1px 2px 4px rgba(0, 0, 0, 0.5));
    z-index: 1;
    pointer-events: none;
}

/* Character avatar sits on top of the chair */
.char-avatar-popup .char-avatar-img {
    position: relative;
    z-index: 2;
    width: 80%;
    height: 80%;
    margin-bottom: 5%;
}

/* Popup arrow */
.char-preview-trigger .char-avatar-popup::after {
    content: '';
    position: absolute;
    bottom: -7px;
    left: 24px;
    transform: rotate(45deg);
    width: 12px;
    height: 12px;
    background: rgba(20, 15, 40, 0.3);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-right: 2px solid rgba(147, 51, 234, 0.4);
    border-bottom: 2px solid rgba(147, 51, 234, 0.4);
}

/* Top rank rows get themed popup borders */
.rank-item-modern.top-1 .char-avatar-popup {
    border-color: rgba(255, 215, 0, 0.5);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5), 0 0 28px rgba(255, 215, 0, 0.2);
    background: 
        radial-gradient(ellipse at center, rgba(60, 50, 10, 0.4) 0%, transparent 70%),
        linear-gradient(135deg, rgba(35, 30, 10, 0.25), rgba(25, 20, 5, 0.15));
}
.rank-item-modern.top-1 .char-avatar-popup::after {
    border-right-color: rgba(255, 215, 0, 0.5);
    border-bottom-color: rgba(255, 215, 0, 0.5);
}

.rank-item-modern.top-2 .char-avatar-popup {
    border-color: rgba(192, 192, 192, 0.45);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5), 0 0 24px rgba(192, 192, 192, 0.15);
    background: 
        radial-gradient(ellipse at center, rgba(50, 50, 55, 0.4) 0%, transparent 70%),
        linear-gradient(135deg, rgba(30, 30, 35, 0.25), rgba(20, 20, 25, 0.15));
}
.rank-item-modern.top-2 .char-avatar-popup::after {
    border-right-color: rgba(192, 192, 192, 0.45);
    border-bottom-color: rgba(192, 192, 192, 0.45);
}

.rank-item-modern.top-3 .char-avatar-popup {
    border-color: rgba(205, 127, 50, 0.45);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5), 0 0 24px rgba(205, 127, 50, 0.15);
    background: 
        radial-gradient(ellipse at center, rgba(55, 35, 15, 0.4) 0%, transparent 70%),
        linear-gradient(135deg, rgba(30, 20, 10, 0.25), rgba(20, 15, 8, 0.15));
}
.rank-item-modern.top-3 .char-avatar-popup::after {
    border-right-color: rgba(205, 127, 50, 0.45);
    border-bottom-color: rgba(205, 127, 50, 0.45);
}

/* Player Info */
.player-info-modern {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    overflow: visible;
}

.job-icon-modern {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    padding: 6px;
    flex-shrink: 0;
}

.player-details-modern {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: visible;
}

.player-name-modern {
    font-weight: 600;
    font-size: 1rem;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

/* Online player name - green gradient */
.player-name-text.player-online {
    background: linear-gradient(90deg, #22c55e, #4ade80, #86efac, #4ade80, #22c55e);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: onlineGradientShift 3s ease infinite;
}

/* Offline player name - red/muted gradient */
.player-name-text.player-offline {
    background: linear-gradient(90deg, #ef4444, #f87171, #fca5a5, #f87171, #ef4444);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

@keyframes onlineGradientShift {
    0% { background-position: 0% center; }
    50% { background-position: 100% center; }
    100% { background-position: 0% center; }
}

.online-dot-modern {
    display: none;
}

.player-class-modern {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.ua-badge-modern {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(218, 165, 32, 0.2));
    color: #ffd700;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
}

.ua-badge-modern i {
    font-size: 0.6rem;
}

/* Guild Info */
.guild-info-modern {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
}

.guild-icon-modern {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    object-fit: contain;
    flex-shrink: 0;
}

.guild-name-modern {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Stats Section */
.stats-modern {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    text-align: right;
}

.stat-main-modern {
    font-weight: 700;
    font-size: 1.1rem;
    color: #9333ea;
    line-height: 1.2;
}

.stat-sub-modern {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-extra-modern {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
}

.rebirth-badge-modern {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.15), rgba(255, 215, 0, 0.05));
    color: #ffd700;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 600;
}

.rebirth-badge-modern i {
    font-size: 0.65rem;
}

.rb-level-modern {
    color: #fbbf24;
    margin-left: 2px;
}

/* Empty State */
.empty-rankings {
    text-align: center;
    padding: 4rem 2rem;
    color: rgba(255, 255, 255, 0.4);
}

.empty-rankings i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-rankings p {
    margin: 0;
    font-size: 1.1rem;
}

/* ===== RESPONSIVE DESIGN ===== */

@media (max-width: 992px) {
    .ranking-header-modern {
        flex-direction: column;
        align-items: flex-start;
        padding: 1.25rem 1.5rem;
    }
    
    .ranking-toggle-section {
        width: 100%;
    }
    
    .ranking-page-wrapper .ranking-toggle-modern {
        width: 100%;
        justify-content: center;
    }
    
    .ranking-page-wrapper .ranking-toggle-modern .toggle-btn {
        flex: 1;
        justify-content: center;
    }      .guild-info-modern {
        display: none !important;
    }
      .rank-item-modern {
        grid-template-columns: 50px 1fr 100px;
        padding: 0.875rem 1.5rem;
        gap: 1rem;
    }
}

@media (max-width: 768px) {
    .ranking-page-wrapper {
        padding: 1rem 0;
    }      .rank-item-modern {
        grid-template-columns: 45px 1fr 90px;
        gap: 0.75rem;
    }
    
    .char-avatar-popup {
        display: none !important;
    }
    
    .char-preview-eye {
        display: none;
    }
    
    .ranking-card-modern {
        border-radius: 16px;
        margin: 0 0.5rem;
    }
    
    .ranking-card-modern::before,
    .ranking-card-modern::after {
        border-radius: 16px;
    }
    
    .ranking-header-modern {
        padding: 1rem 1.25rem;
    }
      .ranking-main-title {
        font-size: 1.25rem;
    }
    
    .ranking-page-wrapper .ranking-toggle-modern .toggle-btn {
        padding: 8px 12px !important;
    }
    
    .job-filters-modern {
        padding: 0.75rem 1rem;
    }
    
    .job-chip {
        padding: 6px 10px;
        font-size: 0.8rem;
    }
    
    .rank-item-modern {
        padding: 0.75rem 1rem;
        gap: 0.75rem;
    }
    
    .rank-position {
        width: 40px;
    }
    
    .rank-icon-gold {
        font-size: 1.3rem;
    }
    
    .rank-icon-silver,
    .rank-icon-bronze {
        font-size: 1.1rem;
    }
    
    .job-icon-modern {
        width: 36px;
        height: 36px;
    }
      .player-name-modern {
        font-size: 0.9rem;
    }
    
    .stat-main-modern {
        font-size: 1rem;
    }
}

@media (max-width: 576px) {
    .ranking-card-modern {
        margin: 0;
        border-radius: 0;
    }
    
    .ranking-card-modern::before,
    .ranking-card-modern::after {
        border-radius: 0;
    }
    
    .ranking-header-modern {
        padding: 0.875rem 1rem;
    }
      .ranking-main-title {
        font-size: 1.1rem;
    }
    
    .ranking-page-wrapper .ranking-toggle-modern .toggle-btn {
        padding: 6px 10px !important;
        font-size: 0.8rem;
    }
    
    .job-filters-modern {
        gap: 0.375rem;
        padding: 0.5rem 0.75rem;
    }
    
    .job-chip {
        padding: 5px 8px;
        font-size: 0.75rem;
    }
    
    .job-chip-icon {
        width: 18px;
        height: 18px;    }      .rank-item-modern {        grid-template-columns: 40px 1fr 80px;
        padding: 0.625rem 0.75rem;
        gap: 0.5rem;
    }
    
    .rank-position {
        width: 35px;
    }
    
    .rank-icon-gold {
        font-size: 1.1rem;
    }
    
    .rank-icon-silver,
    .rank-icon-bronze,
    .rank-icon-top5 {
        font-size: 1rem;
    }
    
    .rank-num-modern {
        font-size: 0.75rem;
        padding: 4px 8px;
    }
    
    .job-icon-modern {
        width: 32px;
        height: 32px;
        padding: 4px;
    }
    
    .player-name-modern {
        font-size: 0.85rem;
    }
      .player-class-modern {
        font-size: 0.7rem;
    }
    
    .stat-main-modern {
        font-size: 0.9rem;
    }
    
    .rebirth-badge-modern {
        padding: 2px 6px;
        font-size: 0.65rem;
    }
    
    .stat-extra-modern {
        font-size: 0.65rem;
    }
}

/* Fix for very small screens */
@media (max-width: 360px) {
    .player-info-modern {
        gap: 8px;
    }
    
    .job-icon-modern {
        width: 28px;
        height: 28px;
    }
      .stats-modern {
        min-width: 60px;
    }
    
    .rank-item-modern {
        grid-template-columns: 35px 1fr 70px;
    }
}
