/* ============================================================
   Ranking Page - Mobile Responsive Styles
   CCE Platform
   ============================================================ */

/* ============ Global Ranking Page Mobile Fixes ============ */
.ranking-container {
    max-width: 100%;
    overflow-x: hidden;
    width: 100%;
    box-sizing: border-box;
}

/* Desktop: show full name, hide truncated */
.name-truncated {
    display: none;
}
.name-full {
    display: inline;
}

/* ============ Tablets (992px) ============ */
@media (max-width: 992px) {
    .scoring-layout {
        grid-template-columns: 1fr;
    }

    .als-id-col {
        min-width: 200px;
    }
}

/* ============ Tablets - smaller (900px) ============ */
@media (max-width: 900px) {
    .scoring-layout {
        grid-template-columns: 1fr;
    }

    /* ===== Ranking Header ===== */
    .ranking-header {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .stats-bar {
        display: flex;
        justify-content: center;
        gap: 0.75rem;
    }

    .stat-item {
        padding: 0.6rem 1rem;
        min-width: 0;
        flex: 1;
        text-align: center;
    }

    .stat-value {
        font-size: 1.4rem;
    }

    /* ===== Ranking Controls ===== */
    .ranking-controls {
        display: flex;
        justify-content: center;
        flex-wrap: nowrap;
        gap: 0.75rem;
    }

    .search-bar {
        flex: 1;
        min-width: 0;
    }

    .search-input {
        width: 100%;
    }

    /* ===== Nav Row ===== */
    .ranking-nav-row {
        flex-direction: column;
        gap: 0.75rem;
    }

    .division-tabs {
        width: 100%;
        justify-content: center;
    }

    .scoring-info-btn,
    .mmr-info-btn {
        width: 100%;
        justify-content: center;
    }

    /* ===== Table columns - hide less critical ones ===== */
    .als-id-col,
    .actions-col,
    .mmr-change-col,
    .games-played-col {
        display: none !important;
    }

    /* Compact table cells */
    .leaderboard-table .category-header th,
    .leaderboard-table td {
        padding: 0.85rem 0.75rem;
    }

    .player-col {
        min-width: 150px;
    }
}

/* ============ Mobile devices (768px) ============ */
@media (max-width: 768px) {
    /* Container */
    .ranking-container {
        padding: 1rem;
    }

    /* ===== Nav Row ===== */
    .ranking-nav-row {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .division-tabs {
        width: 100%;
        justify-content: center;
    }

    .division-tab {
        flex: 1;
        padding: 0.65rem 1rem;
        font-size: 0.75rem;
    }

    .scoring-info-btn,
    .mmr-info-btn {
        width: 100%;
        justify-content: center;
        height: 40px;
        font-size: 0.75rem;
    }

    /* ===== Scoring Dropdown ===== */
    .scoring-dropdown-content {
        grid-template-columns: 1fr;
    }

    /* Combat points (Kill, Assist, KP Cap) in a single row */
    .scoring-column {
        display: flex !important;
        flex-wrap: wrap !important;
        align-items: center !important;
        gap: 0.5rem !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .scoring-column h5 {
        width: 100% !important;
        margin-bottom: 0.25rem !important;
    }

    .scoring-item {
        flex: 1 !important;
        min-width: 0 !important;
        padding: 0.4rem 0.5rem !important;
        background: #0d0d0d !important;
        border: 1px solid #2a2a2a !important;
        border-radius: 6px !important;
        text-align: center !important;
        flex-direction: column !important;
        display: flex !important;
        align-items: center !important;
        gap: 0.15rem !important;
        font-size: 0.75rem !important;
    }

    /* Entry fee grid - all 6 ranks in one row */
    .entry-fee-row {
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .entry-fee-grid {
        display: grid !important;
        grid-template-columns: repeat(6, 1fr) !important;
        gap: 0.25rem !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .entry-fee-item {
        flex-direction: column !important;
        gap: 1px !important;
        padding: 4px 0 !important;
        text-align: center !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
    }

    .entry-fee-icon {
        width: 16px !important;
        height: 16px !important;
    }

    .entry-fee-name {
        font-size: 0.5rem !important;
    }

    .entry-fee-value {
        font-size: 0.6rem !important;
    }

    .placement-mini-grid {
        grid-template-columns: repeat(8, 1fr) !important;
        gap: 0.25rem !important;
        width: 100% !important;
        flex: 0 0 100% !important;
        box-sizing: border-box !important;
    }

    .placement-mini {
        padding: 0.3rem 0.15rem !important;
        gap: 0.1rem !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
    }

    .placement-mini span:first-child {
        font-size: 0.5rem !important;
    }

    .placement-mini span:last-child {
        font-size: 0.65rem !important;
    }

    /* ===== Stats Bar - Players, Games Played, Games Counted in one row ===== */
    .ranking-header {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .stats-bar {
        display: flex !important;
        flex-direction: row !important;
        justify-content: center !important;
        gap: 0.4rem !important;
        width: 100%;
    }

    .stat-item {
        flex: 1 !important;
        padding: 0.3rem 0.25rem !important;
        min-width: 0 !important;
        border-radius: 8px !important;
        text-align: center !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 0 !important;
    }

    .stat-value {
        font-size: 1rem !important;
        line-height: 1 !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .stat-label {
        font-size: 0.55rem !important;
        white-space: nowrap !important;
        line-height: 1 !important;
        margin: 0 !important;
        padding: 0 !important;
        margin-top: 2px !important;
    }

    /* ===== Ranking Controls - Search and Session in same row ===== */
    .ranking-controls {
        display: flex !important;
        flex-direction: row !important;
        gap: 0.5rem !important;
        width: 100%;
        align-items: center;
    }

    .session-selector {
        flex: 0 0 auto;
    }

    .session-dropdown {
        width: 115px !important;
        max-width: 115px !important;
        font-size: 0.7rem !important;
        padding: 0.5rem 1.5rem 0.5rem 0.6rem !important;
        text-overflow: ellipsis !important;
        overflow: hidden !important;
        white-space: nowrap !important;
    }

    .search-bar {
        flex: 1 !important;
        min-width: 0 !important;
    }

    .search-input {
        width: 100% !important;
        font-size: 0.75rem !important;
        padding: 0.5rem 0.75rem !important;
    }

    /* ===== Pagination Top ===== */
    .pagination-top {
        justify-content: center;
    }

    /* ===== Leaderboard Table ===== */
    .leaderboard-table-container {
        border-radius: 12px;
        margin-bottom: 1.5rem;
    }

    .leaderboard-table .category-header th,
    .leaderboard-table td {
        padding: 0.75rem 0.5rem;
        font-size: 0.85rem;
    }

    /* Hide less important columns on mobile - keep rank, player, points, mmr-rank, prizes, premium always visible */
    .kills-col,
    .assists-col,
    .als-id-col,
    .actions-col,
    .games-played-col,
    .mmr-change-col {
        display: none !important;
    }

    /* Hide platform icons and shareplay badges on mobile to free space */
    .platform-icon,
    .shareplay-badge {
        display: none !important;
    }

    /* Mobile: show truncated name, hide full name */
    .name-full {
        display: none !important;
    }
    .name-truncated {
        display: inline !important;
    }

    .rank-col {
        width: 50px;
    }

    .rank-badge {
        font-size: 1.2rem;
    }

    .player-col {
        min-width: auto;
    }

    .player-cell {
        gap: 0.4rem;
    }

    .player-avatar-small {
        width: 24px;
        height: 24px;
        min-width: 24px;
        min-height: 24px;
        flex-shrink: 0;
    }

    .player-avatar-small img {
        width: 24px;
        height: 24px;
    }

    .player-name-link {
        font-size: 0.8rem;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        min-width: 0;
    }

    .player-cell {
        overflow: hidden;
    }

    .points-col {
        width: 70px;
    }

    .points-value {
        font-size: 0.95rem;
    }

    .games-col {
        width: 60px;
        font-size: 0.8rem;
    }

    .prizes-col {
        width: 70px;
    }

    .premium-prizes-col {
        width: 80px;
    }

    .prize-amount {
        font-size: 0.85rem;
    }

    /* ===== User Row ===== */
    .user-row-section td {
        padding: 0.75rem 0.5rem;
    }

    .user-rank-info {
        flex-direction: column;
        gap: 0.5rem;
    }

    /* ===== Pagination Bottom ===== */
    .pagination-container {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
        text-align: center;
    }

    .pagination-info {
        font-size: 0.8rem;
    }

    .pagination-controls {
        flex-wrap: wrap;
        justify-content: center;
    }

    .page-btn {
        min-width: 36px;
        height: 36px;
        padding: 0 0.6rem;
        font-size: 0.8rem;
    }

    /* ===== Scoring Section ===== */
    .scoring-header {
        flex-direction: column;
        gap: 0.75rem;
        text-align: center;
        padding: 1rem;
    }

    .scoring-layout {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 1rem;
    }

    .placement-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* ===== Report Modal ===== */
    .report-modal-content {
        width: 95%;
        max-width: 95%;
        margin: 1rem;
    }

    .report-modal-header {
        padding: 1rem;
    }

    .report-modal-content form {
        padding: 1rem;
    }

    .report-form-actions {
        flex-direction: column;
    }

    .btn-cancel,
    .btn-submit {
        width: 100%;
        justify-content: center;
    }
}

/* ============ Small mobile devices (600px) ============ */
@media (max-width: 600px) {
    .scoring-header {
        flex-direction: column;
        gap: 0.75rem;
        text-align: center;
    }

    .placement-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .placement-mini-grid {
        grid-template-columns: repeat(8, 1fr) !important;
        gap: 0.2rem !important;
        width: 100% !important;
        flex: 0 0 100% !important;
        box-sizing: border-box !important;
    }

    .placement-mini {
        padding: 0.25rem 0.1rem !important;
        gap: 0.05rem !important;
        box-sizing: border-box !important;
    }

    .placement-mini span:first-child {
        font-size: 0.45rem !important;
    }

    .placement-mini span:last-child {
        font-size: 0.6rem !important;
    }
}

/* ============ Small mobile devices (480px) ============ */
@media (max-width: 480px) {
    .ranking-container {
        padding: 0.75rem;
    }

    /* Division tabs - compact */
    .division-tabs {
        padding: 0.3rem;
    }

    .division-tab {
        padding: 0.5rem 0.75rem;
        font-size: 0.7rem;
    }

    /* Stats bar - keep all 3 in one row, more compact */
    .stats-bar {
        display: flex !important;
        flex-direction: row !important;
        gap: 0.3rem !important;
    }

    .stat-item {
        flex: 1 !important;
        padding: 0.25rem 0.15rem !important;
        gap: 0 !important;
    }

    .stat-item:nth-child(3) {
        grid-column: unset !important;
    }

    .stat-value {
        font-size: 0.9rem !important;
        line-height: 1 !important;
        margin: 0 !important;
    }

    .stat-label {
        font-size: 0.5rem !important;
        line-height: 1 !important;
        margin: 0 !important;
        margin-top: 1px !important;
    }

    /* Controls - keep in row, more compact */
    .ranking-controls {
        flex-direction: row !important;
        gap: 0.4rem !important;
    }

    .session-dropdown {
        min-width: 100px !important;
        font-size: 0.65rem !important;
        padding: 0.4rem 0.5rem !important;
    }

    .search-input {
        font-size: 0.7rem !important;
        padding: 0.4rem 0.6rem !important;
    }

    /* Table more compact */
    .leaderboard-table .category-header th,
    .leaderboard-table td {
        padding: 0.6rem 0.35rem;
        font-size: 0.8rem;
    }

    .rank-col {
        width: 40px;
    }

    .rank-badge {
        font-size: 1rem;
    }

    .rank-number {
        font-size: 0.85rem;
    }

    .player-avatar-small {
        width: 22px;
        height: 22px;
        min-width: 22px;
        min-height: 22px;
    }

    .player-avatar-small img {
        width: 22px;
        height: 22px;
    }

    .player-name-link {
        font-size: 0.75rem;
    }

    .points-col {
        width: 55px;
    }

    .points-value {
        font-size: 0.85rem;
    }

    /* Hide games and prizes columns on very small screens */
    .games-col,
    .prizes-col {
        display: none !important;
    }

    /* Compact MMR rank column */
    .mmr-rank-col {
        width: 45px;
    }

    .mmr-rank-badge-with-icon .mmr-rank-icon {
        width: 24px;
        height: 24px;
    }

    /* Compact premium prizes column */
    .premium-prizes-col {
        width: 65px;
    }

    .prize-amount {
        font-size: 0.8rem;
    }

    /* Pagination compact */
    .page-btn {
        min-width: 32px;
        height: 32px;
        font-size: 0.75rem;
    }

    .page-btn-mini {
        width: 24px;
        height: 24px;
        font-size: 0.65rem;
    }

    /* Scoring section compact */
    .scoring-section {
        border-radius: 12px;
    }

    /* Entry fee grid - 6 columns, tighter */
    .entry-fee-grid {
        grid-template-columns: repeat(6, 1fr) !important;
        gap: 0.2rem !important;
    }

    .entry-fee-item {
        padding: 3px 1px !important;
    }

    .entry-fee-icon {
        width: 14px !important;
        height: 14px !important;
    }

    .entry-fee-name {
        font-size: 0.45rem !important;
    }

    .entry-fee-value {
        font-size: 0.55rem !important;
    }


    .scoring-title h3 {
        font-size: 0.9rem;
    }

    .scoring-badge {
        font-size: 0.6rem;
        padding: 0.3rem 0.6rem;
    }

    .combat-icon {
        width: 36px;
        height: 36px;
    }

    .combat-label {
        font-size: 0.7rem;
    }

    .combat-value {
        font-size: 0.95rem;
    }

    .placement-item {
        padding: 0.6rem 0.35rem;
    }

    .placement-rank {
        font-size: 0.65rem;
    }

    .placement-points {
        font-size: 0.85rem;
    }
}

/* ============ Extra small devices (360px) ============ */
@media (max-width: 360px) {
    .ranking-container {
        padding: 0.5rem;
    }

    /* Division tabs - very compact */
    .division-tab {
        padding: 0.45rem 0.5rem;
        font-size: 0.65rem;
    }

    .scoring-info-btn,
    .mmr-info-btn {
        font-size: 0.65rem;
        padding: 0.5rem 0.75rem;
        height: 36px;
    }

    /* Stats - keep all 3 in row, ultra compact */
    .stats-bar {
        display: flex !important;
        flex-direction: row !important;
        gap: 0.25rem !important;
    }

    .stat-item {
        flex: 1 !important;
        padding: 0.2rem 0.1rem !important;
        gap: 0 !important;
    }

    .stat-item:nth-child(3) {
        grid-column: unset !important;
    }

    .stat-value {
        font-size: 0.8rem !important;
        line-height: 1 !important;
        margin: 0 !important;
    }

    .stat-label {
        font-size: 0.45rem !important;
        line-height: 1 !important;
        margin: 0 !important;
        margin-top: 1px !important;
    }

    /* Controls - keep in row, ultra compact */
    .ranking-controls {
        flex-direction: row !important;
        gap: 0.3rem !important;
    }

    .session-dropdown {
        min-width: 90px !important;
        font-size: 0.6rem !important;
        padding: 0.35rem 1.2rem 0.35rem 0.4rem !important;
    }

    .search-input {
        font-size: 0.65rem !important;
        padding: 0.35rem 0.5rem !important;
    }

    /* Table very compact */
    .leaderboard-table .category-header th,
    .leaderboard-table td {
        padding: 0.5rem 0.25rem;
        font-size: 0.75rem;
    }

    .rank-col {
        width: 35px;
    }

    .player-avatar-small {
        width: 20px;
        height: 20px;
        min-width: 20px;
        min-height: 20px;
    }

    .player-avatar-small img {
        width: 20px;
        height: 20px;
    }

    .player-name-link {
        font-size: 0.7rem;
    }

    /* Ultra compact MMR rank column */
    .mmr-rank-col {
        width: 35px;
    }

    .mmr-rank-badge-with-icon .mmr-rank-icon {
        width: 20px;
        height: 20px;
    }

    /* Ultra compact premium prizes column */
    .premium-prizes-col {
        width: 55px;
    }

    .points-col {
        width: 50px;
    }

    .points-value {
        font-size: 0.8rem;
    }

    /* Pagination minimal */
    .pagination-container {
        padding: 0.75rem;
    }

    .page-btn {
        min-width: 28px;
        height: 28px;
        font-size: 0.7rem;
        padding: 0 0.4rem;
    }
}

