/* Hide element utility */
.hidden {
    display: none !important;
}

/* ===========================================
   GLOBAL STYLES — Dark Mode
=========================================== */
body {
    font-family: Arial, sans-serif;
    background: #121212;
    color: #ffffff;
    margin: 0;
    padding: 20px;
    text-align: center;
}

h1 {
    color: #ffffff;
    margin-bottom: 20px;
}

/* ===========================================
   SEARCH BOX
=========================================== */
#search {
    display: block;
    margin: 20px auto;
    padding: 10px;
    width: 220px;
    background: #1e1e1e;
    color: #f5f5f5;
    border: 1px solid #333;
    border-radius: 6px;
}

/* ===========================================
   PREMIUM BUTTONS
=========================================== */
.premium-button {
    display: inline-block;
    padding: 12px 26px;
    margin: 15px auto;
    font-size: 18px;
    font-weight: bold;
    text-decoration: none;
    background: linear-gradient(135deg, #d4af37 0%, #b8860b 50%, #8b6508 100%);
    color: #fff;
    border-radius: 8px;
    box-shadow:
        0 4px 14px rgba(0,0,0,0.5),
        0 0 12px rgba(255,215,0,0.2);
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.premium-button:hover {
    transform: scale(1.07);
    box-shadow:
        0 6px 22px rgba(0,0,0,0.65),
        0 0 18px rgba(255,215,0,0.4);
    filter: brightness(1.1);
}

.back-button {
    background: linear-gradient(135deg, #555 0%, #333 50%, #222 100%);
    color: #eee;
}

.back-button:hover {
    filter: brightness(1.15);
    box-shadow: 0 6px 22px rgba(0,0,0,0.65);
}

/* Fixed top-left return button */
.fixed-top-left {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 100000;
    padding: 10px 20px;
}

/* Prevent overlap on mobile */
@media (max-width: 600px) {
    .fixed-top-left {
        top: 8px;
        left: 8px;
        padding: 6px 14px;
        font-size: 14px;
        transform: scale(0.92);
    }

    h1 {
        margin-top: 40px;
    }
}

/* ===========================================
   SEASON SECTION (Patched)
=========================================== */
.season {
    margin: 40px auto;
    background: #1e1e1e;
    padding: 20px;
    border-radius: 12px;
    max-width: 1400px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.6);
}

/* Header (no more arrows) */
.season-header {
    cursor: pointer;
    user-select: none;
    text-align: center;
    margin-bottom: 12px;
}

/* Year text */
.season-title {
    font-size: 1.8rem;
    font-weight: bold;
}

/* Expand/collapse text */
.season-subtext {
    font-size: 0.8rem;
    color: #bbb;
    margin-top: 3px;
    font-style: italic;
}

/* Newest season locked open */
.season-locked {
    cursor: default !important;
}

/* Collapse content */
.season-collapsed .banner-label-row,
.season-collapsed .banner-grid {
    display: none !important;
}

/* ===========================================
   Coming Soon Styles
=========================================== */
.banner-disabled {
    filter: grayscale(100%) brightness(0.6);
    cursor: default !important;
    box-shadow: none !important;
    transform: none !important;
}
.banner-disabled:hover {
    transform: none !important;
    box-shadow: none !important;
}
.coming-soon-label {
    color: #aaa;
    font-style: italic;
}

/* ===========================================
   LABEL ROW
=========================================== */
.banner-label-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(200px, 1fr));
    gap: 20px;
    justify-items: center;
    margin-bottom: 10px;
}

.banner-label-top {
    font-weight: bold;
    font-size: 16px;
    color: #fff;
}

/* ===========================================
   BANNER GRID
=========================================== */
.banner-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(200px, 1fr));
    gap: 20px;
    justify-items: center;
}

/* ===========================================
   BANNER CARD
=========================================== */
.banner-card {
    text-align: center;
    width: 100%;
    max-width: 320px;
}

.banner-card img {
    width: 100%;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0,0,0,0.65);
    transition: transform 0.25s ease, box-shadow 0.25s ease, filter 0.25s ease;
}

.banner-card img:hover {
    transform: scale(1.06);
    box-shadow: 0 12px 28px rgba(0,0,0,0.75);
    filter: drop-shadow(0 0 8px rgba(255,255,255,0.15));
}

/* ===========================================
   TEAM NAME UNDER BANNER
=========================================== */
.team-label-bottom {
    margin-top: 6px;
    font-size: 15px;
    font-weight: bold;
    color: #ccc;
    position: relative;
    top: 2px;
}

.team-link {
    color: #fff;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: 0.2s;
}

.team-link:hover {
    color: #a8d8ff;
    border-bottom-color: #a8d8ff;
}

/* ===========================================
   STATS TABLE SECTION
=========================================== */
#stats-section {
    max-width: 1200px;
    background: #1e1e1e;
    padding: 30px;
    margin: 40px auto 60px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.6);
}

.stats-subtitle {
    color: #bbb;
}

/* desktop stats table */
.stats-table-wrapper {
    overflow-x: auto;
}

.stats-table {
    width: 100%;
    border-collapse: collapse;
    background: #222;
    border-radius: 8px;
    overflow: hidden;
    font-size: 15px;
}

.stats-table th,
.stats-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #444;
    text-align: center;
    color: #ddd;
}

.stats-table th {
    font-weight: bold;
}

.stats-table tbody tr:nth-child(even) {
    background: #252525;
}

.stats-table tbody tr:hover {
    background: #303030;
}

.team-cell {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.team-logo-inline {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
}

/* ===========================================
   MOBILE STATS TABLE
=========================================== */
@media (max-width: 600px) {
    .stats-table thead {
        display: none;
    }

    .stats-table tr {
        display: block;
        background: #1b1b1b;
        margin-bottom: 18px;
        padding: 12px 14px;
        border-radius: 10px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.35);
        text-align: left;
    }

    .stats-table td {
        display: block;
        text-align: left;
        padding: 6px 0;
        border: none;
        font-size: 15px;
    }

    .stats-table td:nth-child(1)::before { content: "Rank: "; font-weight: bold; }
    .stats-table td:nth-child(3)::before { content: "Titles: "; font-weight: bold; }
    .stats-table td:nth-child(4)::before { content: "Runner-Up: "; font-weight: bold; }
    .stats-table td:nth-child(5)::before { content: "Final Fours: "; font-weight: bold; }
    .stats-table td:nth-child(6)::before { content: "Total: "; font-weight: bold; }

    .team-cell {
        gap: 10px;
        margin: 4px 0 8px 0;
    }

    .team-logo-inline {
        width: 32px !important;
        height: 32px !important;
    }
}

/* ===========================================
   TEAM PAGE
=========================================== */
.team-page-logo {
    width: 120px !important;
    height: 120px !important;
    object-fit: cover;
    border-radius: 50%;
    margin: 60px auto 20px auto;
    display: block;
}

.team-stats-box {
    max-width: 400px;
    margin: 20px auto;
    background: #1e1e1e;
    padding: 20px;
    border-radius: 12px;
    line-height: 1.6;
    box-shadow: 0 4px 14px rgba(0,0,0,0.5);
}

.team-history-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.team-history-card {
    background: #1e1e1e;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.6);
}

/* ===========================================
   FIXED TEAM BANNER
=========================================== */
.team-history-banner {
    display: block;
    margin: 0 auto 20px auto;
    width: 100%;
    max-width: 420px;
    height: auto;
    border-radius: 8px;
    cursor: pointer;
    object-fit: contain;
}

@media (max-width: 600px) {
    .team-history-banner {
        max-width: 340px;
    }
}

/* ===========================================
   TROPHY WALL
=========================================== */
.trophy-subtitle {
    margin-top: -10px;
    color: #bbb;
    margin-bottom: 30px;
}

.trophy-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 25px;
    max-width: 1200px;
    margin: 0 auto;
}

.trophy-card {
    background: #1e1e1e;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.6);
}

.trophy-img {
    width: 100%;
    max-width: 260px;
    border-radius: 8px;
    cursor: pointer;
}

/* ===========================================
   LIGHTBOX
=========================================== */
#lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease;
}

#lightbox-overlay:not(.lb-hidden) {
    opacity: 1;
    visibility: visible;
}

#lb-content {
    position: relative;
    max-width: 100vw;
    max-height: 100vh;
    padding: 10px;
}

#lb-img {
    max-width: 100vw;
    max-height: 100vh;
    border-radius: 12px;
    transform: scale(1);
    transition: transform 0.1s ease-out;
}

#lb-close {
    position: absolute;
    top: -40px;
    right: 0;
    font-size: 34px;
    background: none;
    color: white;
    border: none;
    cursor: pointer;
}

.lb-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 46px;
    color: white;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0 10px;
}

#lb-prev { left: -40px; }
#lb-next { right: -40px; }

/* ===========================================
   MOBILE HOMEPAGE
=========================================== */
@media (max-width: 600px) {

    .banner-label-row {
        display: none !important;
    }

    .banner-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 14px !important;
        justify-items: center;
    }

    #search {
        width: 90%;
    }

    body {
        padding: 10px;
    }

    .season {
        max-width: 100%;
        padding: 15px;
        margin: 20px auto;
    }
}
