/* =============================================================
 FILE: Leaderboard.css
 PURPOSE: Global CSS include for Leaderboard, shared across multiple pages.

 USED BY:
   - /Leaderboard/index.php
 ============================================================= */
/* Leaderboard Page Styles */

.lb-hero {
    text-align: center;
    padding: clamp(3rem, 5vw, 6rem) clamp(1rem, 3vw, 2rem) clamp(2rem, 3vw, 4rem);
}

.lb-hero-label {
    display: inline-block;
    font-family: 'DM Serif Display', Georgia, serif;
    font-size: 0.8rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #6b7280;
    margin-bottom: 12px;
}

.lb-hero h1 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: clamp(2rem, 5vw, 3.2rem);
    font-weight: 700;
    color: #1a1f36;
    margin: 0 0 16px 0;
    letter-spacing: -0.02em;
    line-height: 1.15;
}

.lb-hero p {
    font-family: 'Playfair Display', Georgia, serif;
    max-width: 640px;
    margin: 0 auto;
    font-size: clamp(0.95rem, 1.5vw, 1.1rem);
    color: #4a5568;
    line-height: 1.7;
}

/* Filter Bar */
.lb-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 0 clamp(1rem, 3vw, 2rem);
    margin-bottom: clamp(1.5rem, 3vw, 2.5rem);
    justify-content: center;
    align-items: center;
}

.lb-filter-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.lb-filter-group label {
    font-family: 'DM Serif Display', Georgia, serif;
    font-size: 0.8rem;
    color: #4a5568;
    white-space: nowrap;
}

.lb-filter-select {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 0.85rem;
    padding: 8px 32px 8px 12px;
    border: 1px solid rgba(26, 86, 219, 0.15);
    border-radius: 63% 37% 54% 46% / 55% 48% 52% 45%;
    background: #ffffff;
    color: #1a1f36;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg fill='%234a5568' height='12' viewBox='0 0 24 24' width='12' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/></svg>");
    background-repeat: no-repeat;
    background-position: right 10px center;
    transition: border-color 280ms cubic-bezier(0.4, 0, 0.2, 1), box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow:
        0 2px 4px rgba(0,0,0,0.02),
        0 8px 16px rgba(0,0,0,0.03),
        0 16px 32px rgba(0,0,0,0.02);
}

.lb-filter-select:hover {
    border-color: rgba(26, 86, 219, 0.35);
}

.lb-filter-select:focus {
    outline: none;
    border-color: #1a56db;
    box-shadow:
        0 0 0 3px rgba(26, 86, 219, 0.1),
        0 2px 4px rgba(0,0,0,0.02);
}

.lb-search-input {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 0.85rem;
    padding: 8px 14px;
    border: 1px solid rgba(26, 86, 219, 0.15);
    border-radius: 63% 37% 54% 46% / 55% 48% 52% 45%;
    background: #ffffff;
    color: #1a1f36;
    min-width: 180px;
    transition: border-color 280ms cubic-bezier(0.4, 0, 0.2, 1), box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow:
        0 2px 4px rgba(0,0,0,0.02),
        0 8px 16px rgba(0,0,0,0.03),
        0 16px 32px rgba(0,0,0,0.02);
}

.lb-search-input::placeholder {
    color: #8492a6;
}

.lb-search-input:focus {
    outline: none;
    border-color: #1a56db;
    box-shadow:
        0 0 0 3px rgba(26, 86, 219, 0.1),
        0 2px 4px rgba(0,0,0,0.02);
}

/* Leaderboard Table */
.lb-table-wrap {
    padding: 0 clamp(1rem, 3vw, 2rem);
    margin-bottom: clamp(2rem, 4vw, 3rem);
    overflow-x: auto;
}

.lb-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 8px;
    min-width: 700px;
}

.lb-table thead th {
    font-family: 'DM Serif Display', Georgia, serif;
    font-size: 0.78rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: #6b7280;
    padding: 10px 14px;
    text-align: left;
    border-bottom: 2px solid rgba(26, 86, 219, 0.08);
    white-space: nowrap;
}

.lb-table thead th.sortable {
    cursor: pointer;
    user-select: none;
    transition: color 220ms cubic-bezier(0.4, 0, 0.2, 1);
}

.lb-table thead th.sortable:hover {
    color: #1a56db;
}

.lb-table thead th.sort-active {
    color: #1a56db;
}

.lb-sort-arrow {
    display: inline-block;
    margin-left: 4px;
    font-size: 0.65rem;
    vertical-align: middle;
    opacity: 0.4;
    transition: opacity 220ms cubic-bezier(0.4, 0, 0.2, 1);
}

.lb-table thead th.sort-active .lb-sort-arrow {
    opacity: 1;
}

.lb-table tbody tr {
    background: #ffffff;
    box-shadow:
        0 2px 4px rgba(0,0,0,0.02),
        0 8px 16px rgba(0,0,0,0.03),
        0 24px 48px rgba(0,0,0,0.02);
    transition: transform 320ms cubic-bezier(0.16, 1, 0.3, 1), box-shadow 320ms cubic-bezier(0.4, 0, 0.2, 1);
}

.lb-table tbody tr:hover {
    transform: translateY(-2px);
    box-shadow:
        0 2px 4px rgba(0,0,0,0.03),
        0 8px 16px rgba(0,0,0,0.05),
        0 24px 48px rgba(0,0,0,0.04);
}

.lb-table tbody td {
    padding: 14px;
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 0.9rem;
    color: #1a1f36;
    vertical-align: middle;
}

.lb-table tbody td:first-child {
    border-radius: 17px 0 0 17px;
}

.lb-table tbody td:last-child {
    border-radius: 0 17px 17px 0;
}

/* Rank Column */
.lb-rank {
    font-family: 'DM Serif Display', Georgia, serif;
    font-size: 1.1rem;
    font-weight: 400;
    color: #4a5568;
    text-align: center;
    min-width: 48px;
}

/* Top 3 Styling */
.lb-rank-gold {
    color: #D4AF37;
    font-size: 1.3rem;
    text-shadow: 0 1px 3px rgba(212, 175, 55, 0.3);
}

.lb-rank-silver {
    color: #8a8a8a;
    font-size: 1.2rem;
    text-shadow: 0 1px 3px rgba(192, 192, 192, 0.3);
}

.lb-rank-bronze {
    color: #CD7F32;
    font-size: 1.15rem;
    text-shadow: 0 1px 3px rgba(205, 127, 50, 0.3);
}

tr.lb-row-gold {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.06) 0%, rgba(255, 255, 255, 1) 60%);
    border-left: 3px solid #D4AF37;
}

tr.lb-row-silver {
    background: linear-gradient(135deg, rgba(192, 192, 192, 0.06) 0%, rgba(255, 255, 255, 1) 60%);
    border-left: 3px solid #C0C0C0;
}

tr.lb-row-bronze {
    background: linear-gradient(135deg, rgba(205, 127, 50, 0.06) 0%, rgba(255, 255, 255, 1) 60%);
    border-left: 3px solid #CD7F32;
}

/* Nation Cell */
.lb-nation-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.lb-flag {
    width: 40px;
    height: 28px;
    object-fit: cover;
    border-radius: 3px;
    box-shadow:
        0 1px 2px rgba(0,0,0,0.07),
        0 4px 8px rgba(0,0,0,0.05),
        0 8px 16px rgba(0,0,0,0.03);
    flex-shrink: 0;
}

/* Leader Profile Photo */
.lb-leader-photo {
    width: 36px;
    height: 36px;
    object-fit: cover;
    border-radius: 50%;
    box-shadow:
        0 1px 2px rgba(0,0,0,0.09),
        0 4px 8px rgba(0,0,0,0.07),
        0 8px 16px rgba(0,0,0,0.04);
    flex-shrink: 0;
}

/* Corporation Badge */
.lb-corp-badge {
    display: inline-block;
    font-family: 'DM Serif Display', Georgia, serif;
    font-size: 0.6rem;
    padding: 1px 6px;
    border-radius: 3px;
    background: rgba(124, 58, 237, 0.1);
    color: #7c3aed;
    vertical-align: middle;
    margin-left: 4px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.lb-nation-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.lb-nation-name {
    font-family: 'DM Serif Display', Georgia, serif;
    font-size: 0.95rem;
    color: #1a1f36;
    line-height: 1.2;
}

.lb-ruler-info {
    font-size: 0.75rem;
    color: #6b7280;
}

/* Stat Values */
.lb-stat {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 600;
    color: #1a1f36;
}

.lb-stat-secondary {
    font-size: 0.8rem;
    color: #6b7280;
    font-weight: 400;
}

.lb-tag {
    display: inline-block;
    font-family: 'DM Serif Display', Georgia, serif;
    font-size: 0.7rem;
    padding: 3px 9px;
    border-radius: 63% 37% 54% 46% / 55% 48% 52% 45%;
    background: rgba(26, 86, 219, 0.06);
    color: #1a56db;
    white-space: nowrap;
}

/* Pagination */
.lb-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: clamp(1rem, 3vw, 2rem);
    margin-bottom: clamp(2rem, 4vw, 3rem);
}

.lb-page-btn {
    font-family: 'DM Serif Display', Georgia, serif;
    font-size: 0.85rem;
    padding: 8px 16px;
    border: 1px solid rgba(26, 86, 219, 0.15);
    border-radius: 63% 37% 54% 46% / 55% 48% 52% 45%;
    background: #ffffff;
    color: #4a5568;
    cursor: pointer;
    text-decoration: none;
    transition: border-color 260ms cubic-bezier(0.4, 0, 0.2, 1), color 260ms cubic-bezier(0.4, 0, 0.2, 1), box-shadow 260ms cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow:
        0 2px 4px rgba(0,0,0,0.02),
        0 8px 16px rgba(0,0,0,0.02),
        0 16px 28px rgba(0,0,0,0.02);
}

.lb-page-btn:hover {
    border-color: #1a56db;
    color: #1a56db;
}

.lb-page-btn.active {
    background: #1a56db;
    color: #ffffff;
    border-color: #1a56db;
}

.lb-page-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.lb-page-info {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 0.85rem;
    color: #6b7280;
    padding: 0 8px;
}

/* Empty State */
.lb-empty {
    text-align: center;
    padding: clamp(3rem, 6vw, 5rem) clamp(1rem, 3vw, 2rem);
}

.lb-empty-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 16px;
}

.lb-empty h2 {
    font-family: 'DM Serif Display', Georgia, serif;
    font-size: 1.4rem;
    color: #1a1f36;
    margin: 0 0 8px 0;
}

.lb-empty p {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 0.95rem;
    color: #6b7280;
}

/* Scroll animation */
.lb-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 580ms cubic-bezier(0.16, 1, 0.3, 1), transform 580ms cubic-bezier(0.16, 1, 0.3, 1);
}

.lb-reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive */
@media (max-width: 768px) {
    .lb-filters {
        flex-direction: column;
        align-items: stretch;
    }

    .lb-filter-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .lb-filter-select,
    .lb-search-input {
        width: 100%;
        border-radius: 51% 49% 47% 53% / 52% 46% 54% 48%;
    }

    .lb-table {
        min-width: 600px;
    }

    .lb-hero h1 {
        font-size: clamp(1.6rem, 4vw, 2.4rem);
    }

    .lb-pagination {
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    .lb-table {
        min-width: 500px;
        border-spacing: 0 6px;
    }

    .lb-table tbody td {
        padding: 10px;
        font-size: 0.82rem;
    }

    .lb-flag {
        width: 32px;
        height: 22px;
    }

    .lb-leader-photo {
        width: 28px;
        height: 28px;
    }

    .lb-nation-name {
        font-size: 0.85rem;
    }
}

/* 320px - Extra small screens */
@media (max-width: 320px) {
    .lb-hero {
        padding: clamp(2rem, 4vw, 3rem) 10px clamp(1.5rem, 2vw, 2rem);
    }

    .lb-hero h1 {
        font-size: clamp(1.4rem, 5vw, 1.8rem);
    }

    .lb-hero p {
        font-size: 0.9rem;
    }

    .lb-filters {
        padding: 0 10px;
    }

    .lb-table-wrap {
        padding: 0 10px;
    }

    .lb-table {
        min-width: 440px;
        border-spacing: 0 4px;
    }

    .lb-table tbody td {
        padding: 8px 6px;
        font-size: 0.78rem;
    }

    .lb-table thead th {
        font-size: 0.75rem;
        padding: 8px 6px;
    }

    .lb-flag {
        width: 26px;
        height: 18px;
    }

    .lb-leader-photo {
        width: 24px;
        height: 24px;
    }

    .lb-nation-name {
        font-size: 0.78rem;
    }

    .lb-ruler-info {
        font-size: 0.75rem;
    }

    .lb-rank {
        font-size: 0.9rem;
        min-width: 32px;
    }

    .lb-pagination {
        gap: 4px;
        padding: clamp(0.5rem, 2vw, 1rem) 10px;
    }

    .lb-page-btn {
        font-size: 0.78rem;
        padding: 6px 10px;
    }
}

/* Touch targets for coarse pointers */
@media (hover: none) and (pointer: coarse) {
    .lb-filter-select,
    .lb-search-input {
        min-height: 48px;
    }

    .lb-page-btn {
        min-height: 48px;
        min-width: 48px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .lb-table thead th.sortable {
        min-height: 48px;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .lb-reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .lb-table tbody tr {
        transition: none;
    }
}
