/* ============================================
   Catfish Tournament Live Leaderboard - Styles
   Mobile-first responsive design
   Light theme optimized for outdoor/sunlight viewing
   ============================================ */

/* ---------- Reset & Base ---------- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 18px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f5f7fa;
    color: #1a1a2e;
    min-height: 100vh;
    line-height: 1.5;
}

/* ---------- Header ---------- */
.tournament-header {
    background: linear-gradient(180deg, #ffffff 0%, #e8f4f8 100%);
    border-bottom: 4px solid #1a6b3c;
    text-align: center;
    padding: 0.5rem 0.5rem 0.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
}

.tournament-banner {
    max-width: 100%;
    max-height: 100px;
    object-fit: contain;
    border-radius: 6px;
    margin-bottom: 0.2rem;
}

.tournament-name {
    font-size: 1.1rem;
    font-weight: 900;
    color: #0d3b1e;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.1rem;
    line-height: 1.2;
}

.tournament-date {
    font-size: 0.75rem;
    color: #2a6496;
    font-weight: 700;
    margin-bottom: 0.2rem;
}

.tournament-date:empty {
    display: none;
}

.header-status-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.live-badge {
    display: inline-block;
    background: #fde8e8;
    border: 2px solid #e53e3e;
    color: #c53030;
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: 1px;
    padding: 0.15rem 0.5rem;
    border-radius: 20px;
    animation: pulse-glow 2s ease-in-out infinite;
}

.live-badge.before {
    background: #ebf8ff;
    border-color: #3182ce;
    color: #2b6cb0;
    animation: none;
}

.live-badge.after {
    background: #f0fff4;
    border-color: #38a169;
    color: #276749;
    animation: none;
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 4px rgba(229, 62, 62, 0.2); }
    50% { box-shadow: 0 0 12px rgba(229, 62, 62, 0.4); }
}

.last-updated {
    font-size: 0.65rem;
    color: #3d4a5c;
    font-weight: 700;
}

/* ---------- Disclaimer Banner ---------- */
.disclaimer-banner {
    text-align: center;
    background: #fffbeb;
    border-bottom: 2px solid #f6ad55;
    color: #975a16;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.3rem 0.5rem;
}

/* ---------- Admin Announcement ---------- */
.admin-announcement {
    text-align: center;
    background: #fef9c3;
    border-bottom: 2px solid #d69e2e;
    color: #713f12;
    font-size: 0.85rem;
    font-weight: 700;
    padding: 0.5rem 1rem;
}

/* ---------- Tier Sponsors ---------- */
.presenting-sponsor,
.weighin-sponsor,
.junior-sponsor {
    text-align: center;
}

/* Presenting Sponsor — most prominent */
.presenting-sponsor {
    padding: 1rem 1rem 0.75rem;
    background: linear-gradient(180deg, #fffbeb, #fef3c7);
    border-bottom: 3px solid #d69e2e;
}

.presenting-sponsor .tier-label {
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: #92400e;
    margin-bottom: 0.5rem;
}

.presenting-sponsor .sponsor-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
}

.presenting-sponsor .sponsor-logo {
    max-width: 150px;
    max-height: 60px;
    object-fit: contain;
}

.presenting-sponsor .sponsor-name {
    font-size: 0.9rem;
    font-weight: 700;
    color: #92400e;
}

/* Weigh-In Sponsor — inside adult division, bottom of column */
.weighin-sponsor {
    padding: 0.75rem 1rem;
    background: #f7fafc;
    border-top: 2px solid #e2e8f0;
    border-bottom: 2px solid #e2e8f0;
    margin: 1rem 0 0 0;
}

.weighin-sponsor .tier-label {
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #4a5568;
    margin-bottom: 0.4rem;
}

.weighin-sponsor .sponsor-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
}

.weighin-sponsor .sponsor-logo {
    max-width: 140px;
    max-height: 55px;
    object-fit: contain;
}

.weighin-sponsor .sponsor-name {
    font-size: 0.8rem;
    font-weight: 700;
    color: #2d3748;
}

/* Junior Division Sponsor */
.junior-sponsor {
    padding: 0.6rem 1rem;
    background: #f0fff4;
    border: 1px solid #c6f6d5;
    border-radius: 8px;
    margin: 0.5rem 0;
}

.junior-sponsor .tier-label {
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #276749;
    margin-bottom: 0.4rem;
}

.junior-sponsor .sponsor-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
}

.junior-sponsor .sponsor-logo {
    max-width: 140px;
    max-height: 55px;
    object-fit: contain;
}

.junior-sponsor .sponsor-name {
    font-size: 0.8rem;
    font-weight: 700;
    color: #276749;
}

/* Tier sponsor link styling */
.tier-sponsor-link {
    text-decoration: none;
    color: inherit;
    transition: opacity 0.2s ease;
}

@media (hover: hover) {
    .tier-sponsor-link:hover {
        opacity: 0.8;
    }
}

/* ---------- Main Container ---------- */
.leaderboard-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
}

/* ---------- Divisions ---------- */
.division {
    margin-bottom: 2rem;
}

.division-title {
    font-size: 1.2rem;
    font-weight: 900;
    color: #1a6b3c;
    text-align: center;
    padding: 0.75rem;
    margin-bottom: 1rem;
    border-bottom: 3px solid #1a6b3c;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.junior-division .division-title {
    color: #1a5276;
    border-bottom-color: #1a5276;
}

/* ---------- Category Sections ---------- */
.category-section {
    margin-bottom: 1.5rem;
}

.category-title {
    font-size: 1rem;
    font-weight: 900;
    color: #1a1a2e;
    text-align: center;
    padding: 0.5rem;
    background: #d4edda;
    border-left: 5px solid #1a6b3c;
    border-radius: 0 6px 6px 0;
    margin-bottom: 0.5rem;
}

.prize-inline {
    font-size: 0.65rem;
    color: #b7791f;
    font-weight: 800;
    margin-left: 0.4rem;
    letter-spacing: normal;
    text-transform: none;
    white-space: nowrap;
}

.division-title .prize-inline {
    font-size: 0.6rem;
}

/* Calcutta / added-entry tag — neutral pill to distinguish optional pots */
.calcutta-tag {
    display: inline-block;
    font-size: 0.55rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #475569;
    background: #e2e8f0;
    border: 1px solid #cbd5e0;
    border-radius: 10px;
    padding: 0.1rem 0.45rem;
    margin-left: 0.4rem;
    vertical-align: middle;
    white-space: nowrap;
}

/* ---------- Tables ---------- */
.table-wrapper {
    overflow-x: auto;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.leaderboard-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    background: #ffffff;
    border-radius: 8px;
    overflow: hidden;
}

.leaderboard-table thead th {
    background: #1a6b3c;
    color: #ffffff;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 0.5rem 0.6rem;
    text-align: left;
    border-bottom: none;
}

.junior-division .leaderboard-table thead th {
    background: #1a5276;
}

/* ---------- Women's Category (coral/berry theme) ---------- */
.womens-category .category-title {
    background: #fff0f5;            /* blush */
    border-left-color: #e85d8a;     /* coral */
}

.womens-category .leaderboard-table thead th {
    background: #c53078;            /* berry */
}

.leaderboard-table tbody tr {
    transition: background-color 0.2s ease;
}

.leaderboard-table tbody tr:nth-child(even) {
    background: #f8fafb;
}

@media (hover: hover) {
    .leaderboard-table tbody tr:hover {
        background: #e6f7ed;
    }
}

.leaderboard-table tbody td {
    padding: 0.55rem 0.6rem;
    font-size: 0.85rem;
    font-weight: 700;
    color: #1a1a2e;
    border-bottom: 1px solid #e2e8f0;
}

/* Column widths */
.col-rank {
    width: 55px;
    text-align: center;
}

.col-name {
    width: auto;
}

.leaderboard-table tbody .col-name {
    overflow-wrap: break-word;
    word-break: break-word;
}

.col-weight {
    width: 115px;
    text-align: right;
    white-space: nowrap;
}

.leaderboard-table tbody .col-rank {
    text-align: center;
    font-weight: 900;
}

.leaderboard-table tbody .col-weight {
    text-align: right;
    padding-right: 0.75rem;
    font-weight: 800;
    color: #1a5276;
    font-variant-numeric: tabular-nums;
}

/* ---------- Prize Rows ---------- */
.prize-row-1 {
    background: #fef9e7 !important;
    border-left: 6px solid #d69e2e;
}

.prize-row-2 {
    background: #eef0f2 !important;
    border-left: 6px solid #a0aec0;
}

.prize-row-3 {
    background: #fef0e0 !important;
    border-left: 6px solid #c77c32;
}

.prize-row-4 {
    background: #e8f4fd !important;
    border-left: 6px solid #3182ce;
}

.rank-icon {
    font-size: 1.2rem;
    margin-right: 0.15rem;
}

/* ---------- Loading & Empty States ---------- */
.loading-message,
.empty-message,
.error-message {
    text-align: center;
    padding: 1.5rem;
    color: #718096;
    font-style: italic;
    white-space: normal;
    overflow: visible;
}

.error-message {
    color: #e53e3e;
    font-weight: 600;
}

/* ---------- Junior "Show All" Toggle ---------- */
.toggle-cell {
    text-align: center;
    padding: 0.5rem !important;
    border-top: 1px solid #e2e8f0;
}

.toggle-btn {
    background: #edf2f7;
    color: #2d3748;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    padding: 0.35rem 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.toggle-btn:hover {
    background: #e2e8f0;
    border-color: #a0aec0;
}

.toggle-btn:active {
    background: #cbd5e0;
}

/* ---------- Sponsors Section ---------- */
.sponsors-section {
    max-width: 1200px;
    margin: 0 auto 2rem;
    padding: 1.5rem 1rem;
    text-align: center;
}

.sponsors-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: #b7791f;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #ecc94b;
}

.sponsors-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
    align-items: center;
}

.sponsor-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    text-decoration: none;
    color: #1a5276;
    min-height: 44px;
    min-width: 44px;
    justify-content: center;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

@media (hover: hover) {
    .sponsor-item:hover {
        transform: scale(1.05);
        opacity: 0.85;
    }
}

.sponsor-logo {
    max-width: 100px;
    max-height: 60px;
    object-fit: contain;
    border-radius: 4px;
}

.sponsor-name {
    font-size: 0.75rem;
    font-weight: 700;
    color: #2a6496;
}

.sponsors-section:empty,
.sponsors-grid:empty {
    display: none;
}

/* ---------- Footer ---------- */
.site-footer {
    text-align: center;
    padding: 1.5rem 1rem;
    background: #e2e8f0;
    border-top: 2px solid #cbd5e0;
    color: #4a5568;
    font-size: 0.8rem;
    font-weight: 600;
}

.site-footer p {
    margin-bottom: 0.25rem;
}

.footer-refresh {
    font-size: 0.7rem;
    color: #718096;
}

/* ---------- Responsive Breakpoints ---------- */

/* Tablets and up */
@media (min-width: 600px) {
    html {
        font-size: 16px;
    }

    .tournament-header {
        padding: 1rem 1rem 1.25rem;
    }

    .tournament-banner {
        max-height: 120px;
        margin-bottom: 0.4rem;
    }

    .tournament-name {
        font-size: 2rem;
    }

    .tournament-date {
        font-size: 1.1rem;
    }

    .live-badge {
        font-size: 0.7rem;
        padding: 0.2rem 0.75rem;
    }

    .last-updated {
        font-size: 0.7rem;
    }

    .division-title {
        font-size: 1.6rem;
    }

    .category-title {
        font-size: 1.2rem;
    }

    .prize-inline {
        font-size: 0.75rem;
    }

    .division-title .prize-inline {
        font-size: 0.7rem;
    }

    .calcutta-tag {
        font-size: 0.65rem;
    }

    .leaderboard-table thead th {
        font-size: 0.8rem;
        padding: 0.75rem 1rem;
    }

    .leaderboard-table tbody td {
        padding: 0.75rem 1rem;
        font-size: 1rem;
    }

    .col-rank {
        width: 70px;
    }

    .sponsor-logo {
        max-width: 130px;
        max-height: 80px;
    }
}

/* Desktop — side-by-side divisions */
@media (min-width: 900px) {
    .tournament-banner {
        max-height: 160px;
    }

    .tournament-name {
        font-size: 2.4rem;
    }

    .leaderboard-container {
        display: flex;
        gap: 2rem;
        align-items: flex-start;
        padding: 1.5rem 2rem;
    }

    /* Adult takes more space (3 tables vs 1) */
    .adult-division {
        flex: 3;
        min-width: 0;
    }

    .junior-division {
        flex: 2;
        min-width: 0;
        border-left: 3px solid #cbd5e0;
        padding-left: 2rem;
        position: sticky;
        top: 1rem;
    }

    /* Allow name truncation to relax on desktop */
    .leaderboard-table tbody .col-name {
        white-space: normal;
        overflow-wrap: break-word;
        word-break: break-word;
    }

    .sponsors-grid {
        gap: 2rem;
    }

    .sponsor-logo {
        max-width: 160px;
        max-height: 100px;
    }
}
