/**
 * EVE ESI Manager - Leaderboards Styles
 * @since 1.0.0
 */

/* Leaderboards Container */
.eve-leaderboards-container {
    background: #000;
    border: none;
    border-radius: 8px;
    padding: 26px;
    margin: 20px 0;
    color: #e8e8e8;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

/* Tab Navigation */
.leaderboards-tabs {
    margin-top: 20px;
}

.tab-nav {
    list-style: none;
    padding: 0;
    margin: 0 0 20px 0;
    display: flex;
    gap: 8px;
    border-bottom: 2px solid #1a1d23;
    padding-bottom: 0;
}

.tab-nav li {
    margin: 0;
}

.tab-nav a {
    display: block;
    padding: 12px 24px;
    text-decoration: none;
    color: #8ca0c0;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
    font-weight: 600;
    border-radius: 8px 8px 0 0;
    font-size: 15px;
    position: relative;
    bottom: -2px;
    background: transparent;
}

.tab-nav a:hover {
    color: #fff;
    background: #1a1d23;
}

.tab-nav a.active {
    color: #fff;
    background: linear-gradient(135deg, #12141c 0%, #1a1f2e 100%);
    border-bottom-color: #5a9de8;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Leaderboard Section */
.leaderboard-section {
    margin-bottom: 20px;
}

.leaderboard-controls {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
    padding: 16px;
    background: #21252b;
    border-radius: 8px;
    border: 1px solid #2a2f38;
}

.leaderboard-controls label {
    font-weight: 500;
    color: #b0b0b0;
}

.leaderboard-controls select {
    padding: 8px 15px;
    border: 1px solid #3a3f48;
    border-radius: 4px;
    font-size: 14px;
    background: #2a2f38;
    color: #fff;
    cursor: pointer;
}

.leaderboard-filter-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.leaderboard-filter-group label {
    margin: 0;
}

/* Leaderboard Table */
.leaderboard-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: #2a2f38;
    border: 1px solid #3a3f48;
    border-radius: 8px;
    overflow: hidden;
}

.leaderboard-table thead {
    background: transparent;
    color: #fff;
    border-bottom: 2px solid #3a3f48;
}

.leaderboard-table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: linear-gradient(135deg, #12141c 0%, #1a1f2e 100%);
}

.leaderboard-table td {
    padding: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: #e8e8e8;
}

.leaderboard-table tbody tr {
    transition: background 0.2s;
}

.leaderboard-table tbody tr:hover {
    background: #333a45;
}

.leaderboard-table tbody tr:last-child td {
    border-bottom: none;
}

/* Column Sizing */
.rank-col {
    width: 80px;
    text-align: center;
}

.character-col {
    width: 55%;
}

.stat-col {
    width: 30%;
    text-align: right;
    font-weight: bold;
    font-size: 16px;
    color: #5a9de8;
}

/* Rank Badge */
.rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #21252b;
    color: #e8e8e8;
    font-weight: bold;
    font-size: 16px;
}

/* Special Rank Styling */
.rank-gold .rank-badge {
    background: linear-gradient(135deg, #f3c969 0%, #ffea8a 100%);
    color: #3b2603;
    box-shadow: 0 4px 8px rgba(255, 209, 102, 0.45);
    font-size: 18px;
}

.rank-silver .rank-badge {
    background: linear-gradient(135deg, #9aa9c0 0%, #d8e3ff 100%);
    color: #10141d;
    box-shadow: 0 4px 8px rgba(175, 191, 214, 0.35);
}

.rank-bronze .rank-badge {
    background: linear-gradient(135deg, #c86a2c 0%, #ffb076 100%);
    color: #2d1406;
    box-shadow: 0 4px 8px rgba(255, 176, 118, 0.4);
}

.rank-top10 {
    background: rgba(90, 157, 232, 0.08);
}

/* Character Info */
.character-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.character-info img {
    width: 48px;
    height: 48px;
    border-radius: 6px;
    border: 2px solid #3a3f48;
}

.rank-gold .character-info img {
    border-color: #ffd700;
}

.rank-silver .character-info img {
    border-color: #c0c0c0;
}

.rank-bronze .character-info img {
    border-color: #cd7f32;
}

.character-info span {
    font-weight: 500;
    color: #fff;
    font-size: 15px;
}

.leaderboard-section.is-loading .leaderboard-table {
    opacity: 0.4;
    pointer-events: none;
}

.leaderboard-error {
    padding: 20px;
    text-align: center;
    color: #dc3545;
    font-weight: 600;
    background: #21252b;
}

/* Leaderboard Type Specific Styling */
.pvp-leaderboard .leaderboard-table th {
    background: linear-gradient(135deg, #1c1214 0%, #2a1518 100%);
}

.pvp-leaderboard .leaderboard-table th:first-child {
    border-left: 4px solid #dc3545;
}

.pvp-leaderboard .stat-col {
    color: #dc3545;
}

.pve-leaderboard .leaderboard-table th {
    background: linear-gradient(135deg, #0f1a15 0%, #1a2920 100%);
}

.pve-leaderboard .leaderboard-table th:first-child {
    border-left: 4px solid #28a745;
}

.pve-leaderboard .stat-col {
    color: #28a745;
}

.mining-leaderboard .leaderboard-table th {
    background: linear-gradient(135deg, #1a1410 0%, #2a2015 100%);
}

.mining-leaderboard .leaderboard-table th:first-child {
    border-left: 4px solid #ff9800;
}

.mining-leaderboard .stat-col {
    color: #ff9800;
}

/* Empty State */
.leaderboard-section p {
    text-align: center;
    padding: 32px 20px;
    color: #9ca3af;
    font-size: 16px;
    background: #21252b;
    border-radius: 8px;
    border: 1px dashed #3a3f48;
}

/* Character Expansion Styles */
.expand-chars {
    background: #2a2f38;
    border: 1px solid #3a3f48;
    border-radius: 4px;
    color: #9ca3af;
    cursor: pointer;
    padding: 4px 8px;
    margin-right: 8px;
    transition: all 0.2s ease;
    font-size: 16px;
    font-weight: bold;
    line-height: 1;
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.expand-chars:hover {
    background: #333a45;
    border-color: #5a9de8;
    color: #5a9de8;
}

.expand-chars.expanded {
    background: #5a9de8;
    border-color: #5a9de8;
    color: #fff;
}

.expand-chars .expand-icon {
    display: block;
    line-height: 1;
}

.char-count-badge {
    display: inline-block;
    background: #2a2f38;
    color: #9ca3af;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    margin-left: 6px;
    border: 1px solid #3a3f48;
}

.has-alts .char-count-badge {
    background: rgba(90, 157, 232, 0.15);
    color: #5a9de8;
    border-color: rgba(90, 157, 232, 0.3);
}

/* Character Breakdown Row */
.character-breakdown {
    display: none;
    background: #1e2329 !important;
}

.character-breakdown:hover {
    background: #1e2329 !important;
}

.character-breakdown td {
    padding: 0 !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
}

.breakdown-container {
    padding: 2px 20px 2px 60px;
    background: linear-gradient(90deg, rgba(90, 157, 232, 0.03) 0%, transparent 100%);
    border-left: 3px solid rgba(90, 157, 232, 0.3);
}

.breakdown-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    line-height: 1;
}

.breakdown-table thead {
    display: none !important;
}

.breakdown-table tbody tr {
    border-bottom: none;
    height: 26px;
}

.breakdown-table tbody tr:hover {
    background: rgba(90, 157, 232, 0.05) !important;
}

.breakdown-table td {
    padding: 1px 10px !important;
    border-bottom: 1px !important;
    vertical-align: middle;
}

.breakdown-char {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #d0d0d0;
    line-height: 1;
}

.breakdown-char img {
    width: 30px;
    height: 30px;
    border-radius: 3px;
    border: 1px solid #3a3f48;
    flex-shrink: 0;
}

.breakdown-char span {
    font-size: 12px;
    line-height: 1;
}

.breakdown-stat {
    text-align: right;
    font-weight: 600;
    color: #9ca3af;
    font-size: 12px;
    line-height: 1;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .leaderboard-table {
        font-size: 14px;
    }

    .leaderboard-table th,
    .leaderboard-table td {
        padding: 1px;
    }

    .character-info img {
        width: 40px;
        height: 40px;
    }

    .rank-badge {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }
}

@media (max-width: 768px) {
    .leaderboard-controls {
        flex-direction: column;
        align-items: flex-start;
    }

    .leaderboard-controls select {
        width: 100%;
    }

    .leaderboard-filter-group {
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
    }

    .tab-nav {
        flex-wrap: wrap;
    }

    .tab-nav a {
        padding: 10px 16px;
        font-size: 14px;
    }

    .character-col {
        width: 65%;
    }

    .stat-col {
        width: 30%;
    }

    .leaderboard-table {
        font-size: 13px;
    }

    .character-info {
        gap: 8px;
    }

    .character-info img {
        width: 32px;
        height: 32px;
    }

    .character-info span {
        font-size: 14px;
    }

    .breakdown-container {
        padding: 2px 15px 2px 40px;
    }

    .breakdown-table {
        font-size: 11px;
    }

    .breakdown-table tbody tr {
        height: 24px;
    }

    .breakdown-char img {
        width: 22px;
        height: 22px;
    }

    .breakdown-char span {
        font-size: 11px;
    }

    .breakdown-stat {
        font-size: 11px;
    }

    .expand-chars {
        width: 22px;
        height: 22px;
        font-size: 14px;
    }

    .char-count-badge {
        font-size: 11px;
        padding: 2px 6px;
    }
}

@media (max-width: 480px) {
    .eve-leaderboards-container {
        padding: 15px;
    }

    .leaderboard-table th,
    .leaderboard-table td {
        padding: 10px 8px;
    }

    .rank-badge {
        width: 32px;
        height: 32px;
        font-size: 13px;
    }

    .rank-gold .rank-badge,
    .rank-silver .rank-badge,
    .rank-bronze .rank-badge {
        font-size: 14px;
    }

    .character-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .stat-col {
        font-size: 14px;
    }

    .breakdown-container {
        padding: 2px 10px 2px 30px;
    }

    .breakdown-table {
        font-size: 10px;
    }

    .breakdown-table tbody tr {
        height: 22px;
    }

    .breakdown-char img {
        width: 20px;
        height: 20px;
    }

    .breakdown-char {
        gap: 5px;
    }

    .breakdown-char span {
        font-size: 10px;
    }

    .breakdown-stat {
        font-size: 10px;
    }

    .expand-chars {
        width: 20px;
        height: 20px;
        font-size: 12px;
        margin-right: 4px;
    }

    .char-count-badge {
        font-size: 10px;
        padding: 1px 5px;
        margin-left: 4px;
    }
}

/* Print Styles */
@media print {
    .leaderboard-controls,
    .tab-nav {
        display: none;
    }

    .tab-content {
        display: block !important;
    }

    .leaderboard-table {
        border: 1px solid #000;
    }

    .leaderboard-table thead {
        background: #333 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .leaderboard-table tbody tr:hover {
        background: transparent;
    }

    .expand-chars {
        display: none !important;
    }

    .character-breakdown {
        display: table-row !important;
    }

    .breakdown-container {
        padding: 10px 15px;
        border-left: 2px solid #333;
    }
}
