/* Mobile-First Team Page CSS - Completely Redesigned */

/* =================== RESET AND BASE STYLES =================== */
* {
    box-sizing: border-box;
}

body {
    background: #000 url('../images/bg.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: #fff;
    font-family: "Source Sans Pro", Helvetica, sans-serif;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.4;
}

/* =================== NAVIGATION =================== */
.nav-links {
    text-align: center;
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.3);
    margin-bottom: 0;
}
.nav-links a {
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    margin: 0 0.5rem;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}
.nav-links a:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.075);
}

/* =================== MAIN CONTAINER =================== */
.container {
    width: 100%;
    max-width: 100vw;
    margin: 0;
    padding: 0.5rem;
    background: rgba(27, 31, 34, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.125);
    box-shadow: 0 0.25rem 1rem 0 rgba(0, 0, 0, 0.25);
    overflow-x: hidden;
}

/* =================== TEAM COVER SECTION =================== */
.cover {
    position: relative;
    background: linear-gradient(135deg, rgba(155, 241, 255, 0.15), rgba(155, 241, 255, 0.05));
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    border: 1px solid rgba(155, 241, 255, 0.2);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    text-align: center;
}

.team-name {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
    word-wrap: break-word;
}

/* Team Info Sentence */
.team-info-sentence {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.team-description {
    font-size: 1rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
    font-weight: 400;
}

.highlight-year {
    color: #9bf1ff;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.highlight-number {
    color: #9bf1ff;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Medal Showcase - 2x2 grid on mobile */
.medal-showcase {
    margin-bottom: 1rem;
    padding: 1rem;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.2));
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.medal-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.medal-item-showcase {
    text-align: center;
    padding: 0.75rem 0.5rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.medal-item-showcase.gold {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.15), rgba(255, 215, 0, 0.05));
    border: 2px solid rgba(255, 215, 0, 0.3);
}

.medal-item-showcase.silver {
    background: linear-gradient(135deg, rgba(192, 192, 192, 0.15), rgba(192, 192, 192, 0.05));
    border: 2px solid rgba(192, 192, 192, 0.3);
}

.medal-item-showcase.bronze {
    background: linear-gradient(135deg, rgba(205, 127, 50, 0.15), rgba(205, 127, 50, 0.05));
    border: 2px solid rgba(205, 127, 50, 0.3);
}

.medal-item-showcase.total {
    background: linear-gradient(135deg, rgba(155, 241, 255, 0.15), rgba(155, 241, 255, 0.05));
    border: 2px solid rgba(155, 241, 255, 0.3);
}

.medal-icon {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
    display: block;
}

.medal-count-large {
    font-size: 1.4rem;
    font-weight: 800;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    margin-bottom: 0.25rem;
}

.medal-type {
    font-size: 0.8rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
}

/* Action Buttons */
.cover-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-items: center;
    margin-top: 1rem;
}

.btn-custom {
    background: rgba(255, 255, 255, 0.075);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.125);
    padding: 0.6rem 1.2rem;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    width: auto;
    min-width: 120px;
    justify-content: center;
}

.btn-custom:hover {
    background: rgba(255, 255, 255, 0.125);
    border-color: #9bf1ff;
    color: #fff;
    text-decoration: none;
}

/* =================== SECTIONS =================== */
.titles-section {
    margin-bottom: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    border: 1px solid rgba(155, 241, 255, 0.1);
}

.titles-section h5 {
    color: #9bf1ff;
    font-weight: 600;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    text-align: center;
}

/* =================== CHART CONTAINER =================== */
.chart-container {
    margin: 1rem 0;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    min-height: 300px;
}

.chart-header {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1rem;
    text-align: center;
}

.chart-title {
    color: #9bf1ff;
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}

.chart-toggle-buttons {
    display: flex;
    gap: 0.25rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 20px;
    padding: 0.25rem;
    border: 1px solid rgba(155, 241, 255, 0.2);
    justify-content: center;
    align-self: center;
}

.chart-toggle-btn {
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
    border: none;
    padding: 0.4rem 0.8rem;
    border-radius: 16px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 60px;
}

.chart-toggle-btn:hover {
    color: #fff;
    background: rgba(155, 241, 255, 0.1);
}

.chart-toggle-btn.active {
    background: linear-gradient(135deg, #9bf1ff, #7dd3d8);
    color: #000;
    box-shadow: 0 2px 8px rgba(155, 241, 255, 0.3);
}

/* =================== TABLE WRAPPER =================== */
.table-wrapper {
    margin-bottom: 1.5rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    padding: 0.75rem;
    border: 1px solid rgba(155, 241, 255, 0.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.table-wrapper h2 {
    margin-bottom: 1rem;
    color: #fff;
    font-weight: 600;
    font-size: 1rem;
    text-align: center;
}

.table-wrapper .btn-link {
    color: #fff !important;
    text-decoration: none !important;
    font-size: 1rem !important;
    font-weight: 600 !important;
    padding: 0 !important;
    border: none !important;
    background: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.5rem !important;
    width: 100% !important;
}

.table-wrapper .btn-link:hover {
    color: #9bf1ff !important;
}

.toggle-icon {
    font-size: 1rem;
    color: #9bf1ff;
    font-weight: bold;
}

/* =================== TABLE RESPONSIVE DESIGN =================== */
.table-responsive {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    border: 1px solid rgba(155, 241, 255, 0.15);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.02);
    position: relative;
}

.table {
    width: 100%;
    min-width: 500px;
    margin: 0;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.75rem;
    background: transparent;
}

.table th {
    background: linear-gradient(135deg, rgba(155, 241, 255, 0.15), rgba(155, 241, 255, 0.08));
    color: #fff;
    border: none;
    border-bottom: 2px solid rgba(155, 241, 255, 0.3);
    text-align: center;
    padding: 0.75rem 0.5rem;
    font-weight: 600;
    font-size: 0.75rem;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 2;
}

.table td {
    background: rgba(255, 255, 255, 0.02);
    color: rgba(255, 255, 255, 0.9);
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    text-align: center;
    padding: 0.6rem 0.4rem;
    font-size: 0.7rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
}

.table th:first-child,
.table td:first-child {
    position: sticky;
    left: 0;
    background: rgba(27, 31, 34, 0.98);
    z-index: 3;
    border-right: 2px solid rgba(155, 241, 255, 0.3);
    min-width: 50px;
}

.table a {
    color: #9bf1ff;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.table a:hover {
    color: #fff;
    text-decoration: underline;
}

.table tbody tr:hover {
    background: rgba(155, 241, 255, 0.08);
}

/* Scroll indicator */
.table-responsive::after {
    content: "← Scroll for more →";
    display: block;
    text-align: center;
    font-size: 0.7rem;
    color: rgba(155, 241, 255, 0.8);
    padding: 0.5rem;
    background: rgba(0, 0, 0, 0.3);
    border-top: 1px solid rgba(155, 241, 255, 0.2);
    position: sticky;
    bottom: 0;
    z-index: 2;
}

/* =================== DETAILED STATS =================== */
.detailed-medal-stats {
    margin: 1rem 0;
    padding: 1rem;
    background: linear-gradient(135deg, rgba(155, 241, 255, 0.1), rgba(155, 241, 255, 0.05));
    border-radius: 8px;
    border: 1px solid rgba(155, 241, 255, 0.2);
}

.detailed-medal-stats h6 {
    text-align: center;
    color: #9bf1ff;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.stat-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
    border: 1px solid rgba(155, 241, 255, 0.15);
    border-radius: 6px;
    padding: 0.75rem;
    text-align: center;
}

.card-title {
    color: #9bf1ff;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.medal-breakdown {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.4rem;
    margin-bottom: 0.5rem;
}

.medal-item {
    text-align: center;
    padding: 0.4rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.medal-count {
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    display: block;
    margin-bottom: 0.2rem;
}

.medal-label {
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
}

.gold-percentage {
    color: #ffd700;
    font-weight: 600;
    font-size: 0.8rem;
}

/* =================== CHAMPIONS GRID =================== */
.champions-cards-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.champion-year-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.02));
    border: 1px solid rgba(155, 241, 255, 0.2);
    border-radius: 6px;
    padding: 0.75rem;
}

.year-header-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid rgba(155, 241, 255, 0.2);
}

.year-number {
    font-size: 1rem;
    font-weight: 700;
    color: #9bf1ff;
}

.champions-count-card {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.8);
    background: rgba(0, 0, 0, 0.2);
    padding: 0.2rem 0.4rem;
    border-radius: 6px;
}

.champion-item-card {
    margin-bottom: 0.4rem;
    padding: 0.4rem;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.champion-name-link {
    color: #fff;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.85rem;
}

.champion-name-link:hover {
    color: #9bf1ff;
    text-decoration: underline;
}

.division-tag-card {
    background: rgba(155, 241, 255, 0.2);
    color: #9bf1ff;
    padding: 0.15rem 0.4rem;
    border-radius: 6px;
    font-size: 0.65rem;
    font-weight: 500;
}

/* =================== SHOW MORE BUTTONS =================== */
button[id*="expand-"],
button[id*="show-more"] {
    background: rgba(155, 241, 255, 0.1) !important;
    color: #9bf1ff !important;
    border: 1px solid rgba(155, 241, 255, 0.3) !important;
    padding: 0.5rem 1rem !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    font-size: 0.75rem !important;
    font-weight: 500 !important;
    transition: all 0.3s ease !important;
    display: block !important;
    margin: 0.5rem auto !important;
    width: auto !important;
}

button[id*="expand-"]:hover,
button[id*="show-more"]:hover {
    background: rgba(155, 241, 255, 0.2) !important;
    border-color: rgba(155, 241, 255, 0.5) !important;
}

/* =================== TEAM REGISTRATIONS =================== */
.event-header-row {
    background: rgba(155, 241, 255, 0.1) !important;
    border-top: 2px solid rgba(155, 241, 255, 0.3) !important;
    cursor: pointer;
    transition: all 0.2s ease;
}

.event-header-row:hover {
    background: rgba(155, 241, 255, 0.15) !important;
}

.event-header-cell {
    text-align: left !important;
    padding: 8px 12px !important;
    font-weight: 600 !important;
    color: #fff !important;
    font-size: 0.8rem !important;
}

.event-toggle-icon {
    color: #9bf1ff;
    font-weight: bold;
    margin-right: 8px;
    font-size: 0.8rem;
}

.event-icon {
    margin-right: 8px;
}

.event-name {
    font-weight: 700;
    margin-right: 8px;
    color: #9bf1ff;
}

.event-date {
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
    margin-right: 8px;
}

.event-count {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.8rem;
    background: rgba(0, 0, 0, 0.2);
    padding: 2px 6px;
    border-radius: 8px;
    margin-left: 8px;
}

.event-registration-row {
    background: rgba(255, 255, 255, 0.02) !important;
}

.event-registration-row:hover {
    background: rgba(155, 241, 255, 0.05) !important;
}

/* =================== LOADING STATES =================== */
.loading-indicator {
    opacity: 0.7;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { opacity: 0.7; }
    50% { opacity: 1; }
    100% { opacity: 0.7; }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* =================== MOBILE TABLE OPTIMIZATIONS =================== */
@media screen and (max-width: 768px) {
    /* Black Belt Major Titles - ensure at least 2 cards per row on mobile */
    #major-titles-grid {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 0.5rem !important;
        margin-bottom: 1rem;
    }
    
    /* Remove horizontal scrolling and make tables fit mobile screen */
    .table-responsive {
        border: none;
        margin-bottom: 0;
        overflow-x: visible !important;
    }
    
    .table-responsive::after {
        display: none !important;
    }
    
    .table {
        width: 100% !important;
        min-width: 100% !important;
        font-size: 0.75rem !important;
        margin-bottom: 0;
    }
    
    .table th,
    .table td {
        padding: 6px 4px !important;
        font-size: 0.7rem !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 80px;
        border: 1px solid rgba(255, 255, 255, 0.1) !important;
    }
    
    .table th:first-child,
    .table td:first-child {
        position: static !important;
        background: transparent !important;
        border-right: none !important;
        max-width: 60px;
        font-weight: 600;
    }
    
    /* Top Fighters ELO table mobile optimizations */
    #top-fighters-body .table th:nth-child(4),
    #top-fighters-body .table td:nth-child(4),
    #top-fighters-body .table th:nth-child(5),
    #top-fighters-body .table td:nth-child(5),
    #topFightersTable th:nth-child(4),
    #topFightersTable td:nth-child(4),
    #topFightersTable th:nth-child(5),
    #topFightersTable td:nth-child(5) {
        display: none !important; /* Hide World ELO Rank and Total Medals columns on mobile */
    }
    
    #topFightersTable th:nth-child(1),
    #topFightersTable td:nth-child(1),
    #topFightersTable th:nth-child(2),
    #topFightersTable td:nth-child(2) {
        white-space: normal !important;
        word-wrap: break-word;
        word-break: break-word;
        max-width: none !important;
        overflow: visible !important;
        text-overflow: clip !important;
    }
    
    #topFightersTable th:nth-child(1),
    #topFightersTable td:nth-child(1) {
        width: 15%;
        text-align: center;
    }
    
    #topFightersTable th:nth-child(2),
    #topFightersTable td:nth-child(2) {
        width: 40%;
    }
    
    #topFightersTable th:nth-child(3),
    #topFightersTable td:nth-child(3) {
        width: 25%;
        text-align: center;
    }
    
    #topFightersTable th:nth-child(6),
    #topFightersTable td:nth-child(6) {
        width: 20%;
        text-align: center;
    }
    
    /* Most Active This Year table mobile optimizations */
    #topFightersThisYearTable th:nth-child(3),
    #topFightersThisYearTable td:nth-child(3) {
        display: none !important; /* Hide Gold Medals column on mobile */
    }
    
    #topFightersThisYearTable th:nth-child(1),
    #topFightersThisYearTable td:nth-child(1),
    #topFightersThisYearTable th:nth-child(2),
    #topFightersThisYearTable td:nth-child(2) {
        white-space: normal !important;
        word-wrap: break-word;
        word-break: break-word;
        max-width: none !important;
        overflow: visible !important;
        text-overflow: clip !important;
    }
    
    #topFightersThisYearTable th:nth-child(1),
    #topFightersThisYearTable td:nth-child(1) {
        width: 15%;
        text-align: center;
    }
    
    #topFightersThisYearTable th:nth-child(2),
    #topFightersThisYearTable td:nth-child(2) {
        width: 50%;
    }
    
    #topFightersThisYearTable th:nth-child(4),
    #topFightersThisYearTable td:nth-child(4) {
        width: 20%;
        text-align: center;
    }
    
    #topFightersThisYearTable th:nth-child(5),
    #topFightersThisYearTable td:nth-child(5) {
        width: 15%;
        text-align: center;
    }
    
    /* Change "Total Medals" to "Medals" on mobile for Most Active This Year table */
    #topFightersThisYearTable th:nth-child(4)::before {
        content: "Medals";
        display: block;
    }
    
    #topFightersThisYearTable th:nth-child(4) {
        font-size: 0; /* Hide original text */
    }
    
    /* Undefeated Fighters table mobile optimizations */
    #undefeatedFightersTable th:nth-child(4),
    #undefeatedFightersTable td:nth-child(4) {
        display: none !important; /* Hide Division column on mobile */
    }
    
    #undefeatedFightersTable th:nth-child(1),
    #undefeatedFightersTable td:nth-child(1),
    #undefeatedFightersTable th:nth-child(2),
    #undefeatedFightersTable td:nth-child(2) {
        white-space: normal !important;
        word-wrap: break-word;
        word-break: break-word;
        max-width: none !important;
        overflow: visible !important;
        text-overflow: clip !important;
    }
    
    #undefeatedFightersTable th:nth-child(1),
    #undefeatedFightersTable td:nth-child(1) {
        width: 15%;
        text-align: center;
    }
    
    #undefeatedFightersTable th:nth-child(2),
    #undefeatedFightersTable td:nth-child(2) {
        width: 60%;
    }
    
    #undefeatedFightersTable th:nth-child(3),
    #undefeatedFightersTable td:nth-child(3) {
        width: 25%;
        text-align: center;
    }
    
    /* Medal Count by Belt table mobile optimizations */
    #medalCountTable th:nth-child(4),
    #medalCountTable td:nth-child(4),
    #medalCountTable th:nth-child(5),
    #medalCountTable td:nth-child(5) {
        display: none !important; /* Hide Bronze and Total columns on mobile */
    }
    
    #medalCountTable th:nth-child(1),
    #medalCountTable td:nth-child(1) {
        white-space: normal !important;
        word-wrap: break-word;
        word-break: break-word;
        max-width: none !important;
        overflow: visible !important;
        text-overflow: clip !important;
        width: 40%;
    }
    
    #medalCountTable th:nth-child(2),
    #medalCountTable td:nth-child(2),
    #medalCountTable th:nth-child(3),
    #medalCountTable td:nth-child(3),
    #medalCountTable th:nth-child(6),
    #medalCountTable td:nth-child(6) {
        width: 20%;
        text-align: center;
    }
    
    /* Weight Class table mobile optimizations */
    #weightClassTable th:nth-child(4),
    #weightClassTable td:nth-child(4),
    #weightClassTable th:nth-child(5),
    #weightClassTable td:nth-child(5) {
        display: none !important; /* Hide Bronze and Total columns on mobile */
    }
    
    #weightClassTable th:nth-child(1),
    #weightClassTable td:nth-child(1) {
        white-space: normal !important;
        word-wrap: break-word;
        word-break: break-word;
        max-width: none !important;
        overflow: visible !important;
        text-overflow: clip !important;
        width: 40%;
    }
    
    #weightClassTable th:nth-child(2),
    #weightClassTable td:nth-child(2),
    #weightClassTable th:nth-child(3),
    #weightClassTable td:nth-child(3),
    #weightClassTable th:nth-child(6),
    #weightClassTable td:nth-child(6) {
        width: 20%;
        text-align: center;
    }
    
    /* Historical Trends table mobile optimizations */
    #historicalTrendsTable th:nth-child(4),
    #historicalTrendsTable td:nth-child(4),
    #historicalTrendsTable th:nth-child(5),
    #historicalTrendsTable td:nth-child(5) {
        display: none !important; /* Hide Bronze and Total columns on mobile */
    }
    
    #historicalTrendsTable th:nth-child(1),
    #historicalTrendsTable td:nth-child(1) {
        width: 25%;
        text-align: center;
    }
    
    #historicalTrendsTable th:nth-child(2),
    #historicalTrendsTable td:nth-child(2),
    #historicalTrendsTable th:nth-child(3),
    #historicalTrendsTable td:nth-child(3),
    #historicalTrendsTable th:nth-child(6),
    #historicalTrendsTable td:nth-child(6) {
        width: 25%;
        text-align: center;
    }
    
    /* Team Registrations table mobile optimizations */
    #teamRegistrationsTable th:nth-child(1),
    #teamRegistrationsTable td:nth-child(1) {
        display: none !important; /* Hide Event Start Date column on mobile */
    }
    
    #teamRegistrationsTable th:nth-child(2),
    #teamRegistrationsTable td:nth-child(2),
    #teamRegistrationsTable th:nth-child(3),
    #teamRegistrationsTable td:nth-child(3) {
        white-space: normal !important;
        word-wrap: break-word;
        word-break: break-word;
        max-width: none !important;
        overflow: visible !important;
        text-overflow: clip !important;
    }
    
    #teamRegistrationsTable th:nth-child(2),
    #teamRegistrationsTable td:nth-child(2) {
        width: 40%;
    }
    
    #teamRegistrationsTable th:nth-child(3),
    #teamRegistrationsTable td:nth-child(3) {
        width: 60%;
    }
    
    /* Individual Medal Achievements table mobile optimizations */
    #individualMedalsTable th:nth-child(3),
    #individualMedalsTable td:nth-child(3),
    #individualMedalsTable th:nth-child(5),
    #individualMedalsTable td:nth-child(5) {
        display: none !important; /* Hide Category/Division and Year columns on mobile */
    }
    
    #individualMedalsTable th:nth-child(1),
    #individualMedalsTable td:nth-child(1),
    #individualMedalsTable th:nth-child(2),
    #individualMedalsTable td:nth-child(2) {
        white-space: normal !important;
        word-wrap: break-word;
        word-break: break-word;
        max-width: none !important;
        overflow: visible !important;
        text-overflow: clip !important;
    }
    
    #individualMedalsTable th:nth-child(1),
    #individualMedalsTable td:nth-child(1) {
        width: 40%;
    }
    
    #individualMedalsTable th:nth-child(2),
    #individualMedalsTable td:nth-child(2) {
        width: 45%;
    }
    
    #individualMedalsTable th:nth-child(4),
    #individualMedalsTable td:nth-child(4) {
        width: 15%;
        text-align: center;
    }
    
    /* Event header styling for mobile */
    .event-header-cell {
        padding: 6px 8px !important;
        font-size: 0.75rem !important;
    }
    
    .event-name {
        font-size: 0.8rem !important;
    }
    
    .event-count {
        font-size: 0.7rem !important;
    }
}

/* =================== TABLET STYLES (768px+) =================== */
@media screen and (min-width: 768px) {
    .container {
        max-width: 1200px;
        margin: 0 auto;
        padding: 2rem;
        border-radius: 4px;
    }
    
    .nav-links {
        padding: 1rem;
    }
    
    .cover {
        padding: 2rem;
        margin-bottom: 2rem;
        border-radius: 12px;
    }
    
    .team-name {
        font-size: 2.5rem;
        margin-bottom: 2rem;
    }
    
    .team-info-sentence {
        padding: 1.5rem;
        margin-bottom: 2rem;
    }
    
    .team-description {
        font-size: 1.1rem;
    }
    
    .medal-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 1rem;
    }
    
    .medal-item-showcase {
        padding: 1rem 0.75rem;
    }
    
    .medal-icon {
        font-size: 2rem;
        margin-bottom: 0.5rem;
    }
    
    .medal-count-large {
        font-size: 1.8rem;
    }
    
    .cover-actions {
        flex-direction: row;
        justify-content: center;
        gap: 1rem;
    }
    
    .chart-container {
        padding: 1.5rem;
        min-height: 500px;
    }
    
    .chart-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
    
    .chart-title {
        font-size: 1.2rem;
    }
    
    .table-wrapper {
        padding: 1.5rem;
        margin-bottom: 2rem;
    }
    
    .table-wrapper h2 {
        font-size: 1.2rem;
        text-align: left;
    }
    
    .table-wrapper .btn-link {
        justify-content: flex-start !important;
    }
    
    .table {
        font-size: 0.9rem;
    }
    
    .table th {
        padding: 1rem 0.75rem;
        font-size: 0.9rem;
    }
    
    .table td {
        padding: 0.75rem 0.75rem;
        font-size: 0.85rem;
    }
    
    .stats-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 1rem;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .card-title {
        font-size: 0.9rem;
        margin-bottom: 0.75rem;
    }
    
    .medal-breakdown {
        gap: 0.5rem;
        margin-bottom: 0.75rem;
    }
    
    .medal-item {
        padding: 0.5rem;
    }
    
    .medal-count {
        font-size: 1.2rem;
        margin-bottom: 0.25rem;
    }
    
    .medal-label {
        font-size: 0.7rem;
    }
    
    .gold-percentage {
        font-size: 0.9rem;
    }
    
    .champions-cards-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 1rem;
    }
    
    /* Black Belt Major Titles - responsive layout for tablet */
    #major-titles-grid {
        display: grid !important;
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)) !important;
        gap: 1rem !important;
    }
    
    .champion-year-card {
        padding: 1rem;
        border-radius: 8px;
    }
    
    .year-header-card {
        margin-bottom: 0.75rem;
        padding-bottom: 0.5rem;
    }
    
    .year-number {
        font-size: 1.2rem;
    }
    
    .champions-count-card {
        font-size: 0.8rem;
        padding: 0.25rem 0.5rem;
        border-radius: 8px;
    }
    
    .champion-item-card {
        margin-bottom: 0.5rem;
        padding: 0.5rem;
    }
    
    .champion-name-link {
        font-size: 1rem;
    }
    
    .division-tag-card {
        padding: 0.2rem 0.5rem;
        border-radius: 8px;
        font-size: 0.7rem;
    }
}

/* =================== DESKTOP STYLES (1024px+) =================== */
@media screen and (min-width: 1024px) {
    .table {
        min-width: auto;
    }
    
    .table-responsive::after {
        display: none;
    }
    
    .chart-toggle-btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
        min-width: 80px;
    }
    
    /* Black Belt Major Titles - desktop layout */
    #major-titles-grid {
        display: grid !important;
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)) !important;
        gap: 1rem !important;
    }
}


