/* ================================
   배틀 전적 랭킹 페이지 스타일
================================ */

.battle-ranking-container {
    max-width: 1200px;
    margin: 0 auto;
    background: var(--card-bg);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.battle-ranking-header {
    text-align: center;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.battle-ranking-header h2 {
    color: white;
    font-size: 28px;
    margin-bottom: 8px;
}

.battle-ranking-header .page-desc {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
}

/* 정렬 탭 */
.battle-ranking-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    flex-wrap: wrap;
    justify-content: center;
}

.battle-ranking-tab {
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.battle-ranking-tab:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.battle-ranking-tab.active {
    background: linear-gradient(135deg, var(--pokemon-red), #ff5a36);
    color: white;
    box-shadow: 0 4px 12px rgba(255, 90, 54, 0.3);
}

/* 내 순위 정보 */
.battle-ranking-my-rank {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    margin-bottom: 24px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    flex-wrap: wrap;
}

.my-rank-label {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    font-weight: 500;
}

.my-rank-value {
    font-weight: bold;
    color: var(--gold-primary);
    font-size: 20px;
}

.my-rank-stats {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
}

.my-rank-win-rate {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    font-weight: 600;
}

.my-rank-battles {
    color: rgba(255, 255, 255, 0.6);
    font-size: 13px;
}

/* 랭킹 리스트 */
.battle-ranking-list {
    min-height: 200px;
}

.battle-ranking-table {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.battle-ranking-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 16px 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 20px;
}

.battle-ranking-card:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.battle-ranking-card.rank-1 {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(255, 215, 0, 0.05));
    border-color: rgba(255, 215, 0, 0.5);
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
}

.battle-ranking-card.rank-2 {
    background: linear-gradient(135deg, rgba(192, 192, 192, 0.2), rgba(192, 192, 192, 0.05));
    border-color: rgba(192, 192, 192, 0.5);
    box-shadow: 0 4px 15px rgba(192, 192, 192, 0.3);
}

.battle-ranking-card.rank-3 {
    background: linear-gradient(135deg, rgba(205, 127, 50, 0.2), rgba(205, 127, 50, 0.05));
    border-color: rgba(205, 127, 50, 0.5);
    box-shadow: 0 4px 15px rgba(205, 127, 50, 0.3);
}

.battle-ranking-rank {
    min-width: 80px;
    font-size: 16px;
    font-weight: 700;
    color: white;
    text-align: center;
}

.battle-ranking-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 200px;
    min-width: 200px;
}

.battle-ranking-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.battle-ranking-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.battle-ranking-nickname {
    font-weight: 600;
    font-size: 16px;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.battle-ranking-stats {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 120px;
    align-items: flex-start;
}

.battle-ranking-win-rate {
    font-size: 18px;
    font-weight: 700;
    color: var(--gold-primary);
}

.battle-ranking-battles {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
}

.battle-ranking-team {
    display: flex;
    gap: 8px;
    flex: 1;
    justify-content: flex-start;
}

.battle-ranking-team-slot {
    width: 44px;
    height: 44px;
    position: relative;
    border-radius: 6px;
    overflow: hidden;
    border: 2px solid #ddd;
    background: #333;
}

.battle-ranking-team-slot img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.battle-ranking-star {
    position: absolute;
    top: -2px;
    left: 0;
    width: 100%;
    text-align: center;
    font-size: 9px;
    color: #FFD700;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 1);
    line-height: 1;
    z-index: 2;
}

.battle-ranking-team-slot.rarity-common {
    border-color: #bebebe;
}

.battle-ranking-team-slot.rarity-uncommon {
    border-color: #4CAF50;
}

.battle-ranking-team-slot.rarity-rare {
    border-color: #007bff;
}

.battle-ranking-team-slot.rarity-epic {
    border-color: #800080;
}

.battle-ranking-team-slot.rarity-legendary {
    border-color: #ffd700;
    box-shadow: 0 0 5px rgba(255, 215, 0, 0.5);
}

.battle-ranking-team-slot.rarity-mythical {
    border-color: #ff00ff;
    box-shadow: 0 0 5px rgba(255, 0, 255, 0.5);
}

.battle-ranking-team-slot.enchanted-glow-red {
    position: relative !important;
    border-color: #ff0000 !important;
    box-shadow: 0 0 8px #ff0000, inset 0 0 10px rgba(255, 0, 0, 0.5) !important;
    animation: redGlowPulse 1.5s infinite ease-in-out !important;
}

.battle-ranking-team-slot.enchanted-glow-red::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border-radius: 6px;
    background: transparent;
    box-shadow: 0 0 15px #ff0000;
    opacity: 0.7;
    pointer-events: none;
    z-index: 1;
}

@keyframes redGlowPulse {
    0% {
        box-shadow: 0 0 8px #ff0000, inset 0 0 10px rgba(255, 0, 0, 0.5);
        filter: brightness(1);
    }
    50% {
        box-shadow: 0 0 20px #ff3333, inset 0 0 15px rgba(255, 50, 50, 0.7);
        filter: brightness(1.2);
    }
    100% {
        box-shadow: 0 0 8px #ff0000, inset 0 0 10px rgba(255, 0, 0, 0.5);
        filter: brightness(1);
    }
}

.battle-ranking-actions {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 100px;
}

.battle-ranking-visit-btn {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
    white-space: nowrap;
}

.battle-ranking-visit-btn:hover {
    background: var(--pokemon-blue);
    color: white;
    border-color: var(--pokemon-blue);
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
}

/* 미디어 쿼리 */
@media (max-width: 768px) {
    .battle-ranking-container {
        padding: 16px;
    }

    .battle-ranking-tabs {
        gap: 6px;
    }

    .battle-ranking-tab {
        padding: 8px 14px;
        font-size: 12px;
    }

    .battle-ranking-card {
        flex-wrap: wrap;
        padding: 12px 16px;
        gap: 12px;
    }

    .battle-ranking-rank {
        min-width: 60px;
        font-size: 14px;
    }

    .battle-ranking-profile {
        width: auto;
        flex: 1;
        min-width: 0;
    }

    .battle-ranking-avatar {
        width: 40px;
        height: 40px;
    }

    .battle-ranking-nickname {
        font-size: 14px;
    }

    .battle-ranking-stats {
        min-width: 100px;
    }

    .battle-ranking-win-rate {
        font-size: 16px;
    }

    .battle-ranking-team {
        flex: 1 1 100%;
        order: 10;
        justify-content: center;
        gap: 4px;
        padding-top: 8px;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        margin-top: 4px;
    }

    .battle-ranking-team-slot {
        width: 36px;
        height: 36px;
    }

    .battle-ranking-star {
        font-size: 7px;
    }
}

@media (max-width: 480px) {
    .battle-ranking-tabs {
        gap: 4px;
    }

    .battle-ranking-tab {
        padding: 6px 10px;
        font-size: 11px;
    }

    .battle-ranking-card {
        padding: 10px 12px;
        gap: 8px;
    }

    .battle-ranking-rank {
        min-width: 50px;
        font-size: 13px;
    }

    .battle-ranking-avatar {
        width: 36px;
        height: 36px;
    }

    .battle-ranking-nickname {
        font-size: 13px;
    }

    .battle-ranking-team-slot {
        width: 32px;
        height: 32px;
    }

    .battle-ranking-star {
        font-size: 6px;
    }
}
