/* Global Reset & Base */
* {
    box-sizing: border-box;
}

body {
    background-color: #ffffff;
    color: #000000;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    /* Clean, brutalist font */
    margin: 0;
    padding: 0;
}

a {
    color: #000000;
    text-decoration: underline;
}

a:hover {
    background-color: #000000;
    color: #ffffff;
    text-decoration: none;
}

/* Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    border: 4px solid #000000;
    padding: 20px;
    margin-bottom: 40px;
    display: flex;
    flex-direction: column;
}

.logo {
    font-size: 24px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.tagline {
    font-size: 14px;
    color: #444;
    margin-top: 25px;
    margin-bottom: 25px;
    line-height: 1.5;
}

/* Nav row below tagline */
.header-nav {
    display: flex;
    gap: 35px;
    padding-top: 15px;
    border-top: 1px solid #ddd;
}

.header-nav a,
.header-nav .about-link {
    font-weight: 700;
    font-size: 14px;
    text-decoration: underline;
    cursor: pointer;
}

/* Mobile styles */
@media (max-width: 768px) {
    .logo {
        font-size: 20px;
        letter-spacing: 1px;
    }

    .tagline {
        font-size: 13px;
    }

    h2 {
        font-size: 24px;
    }

    /* Mobile table styles */
    .table-wrapper {
        overflow-x: hidden;
        /* Disable horizontal scroll if we fit */
        width: 100%;
    }

    .leaderboard-table {
        table-layout: fixed;
        width: 100%;
    }

    .leaderboard-table th,
    .leaderboard-table td {
        padding: 4px 2px;
        /* Squeeze horizontal spacing */
        font-size: 10px;
        /* Smaller font */
        white-space: normal;
        /* Allow wrapping */
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    .leaderboard-table th {
        font-size: 9px;
        vertical-align: bottom;
    }

    /* Compact column widths - Percentages for fixed layout */
    /* Rank */
    .leaderboard-table th:nth-child(1),
    .leaderboard-table td:nth-child(1) {
        width: 8%;
    }

    /* University - Main content */
    .leaderboard-table th:nth-child(2),
    .leaderboard-table td:nth-child(2) {
        width: 37%;
        font-weight: 600;
    }

    /* Weighted Students */
    .leaderboard-table th:nth-child(3),
    .leaderboard-table td:nth-child(3) {
        width: 15%;
        text-align: center;
    }

    /* H100 */
    .leaderboard-table th:nth-child(4),
    .leaderboard-table td:nth-child(4) {
        width: 15%;
        text-align: center;
    }

    /* GPUs/Student */
    .leaderboard-table th:last-child,
    .leaderboard-table td:last-child {
        width: 25%;
        text-align: center;
    }

    .container {
        padding: 10px;
    }

    .chart-wrapper {
        height: 500px;
    }
}

/* Sections */
section {
    margin-bottom: 60px;
}

h2 {
    font-size: 36px;
    border-bottom: 4px solid #000000;
    padding-bottom: 10px;
    margin-bottom: 30px;
    text-transform: uppercase;
}

/* Chart */
.chart-container {
    border: 4px solid #000000;
    padding: 20px;
    height: 500px;
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    gap: 10px;
}

.bar-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    height: 100%;
    justify-content: flex-end;
}

.bar {
    background-color: #000000;
    width: 60%;
    min-height: 2px;
    /* Ensure visibility */
    transition: height 0.3s;
}

.bar-label {
    margin-top: 10px;
    font-size: 10px;
    text-align: center;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    text-transform: uppercase;
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-height: 120px;
}

.bar-value {
    margin-bottom: 5px;
    font-size: 12px;
    font-weight: bold;
}

/* Leaderboard Table */
.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    border: 4px solid #000000;
}

.leaderboard-table th,
.leaderboard-table td {
    border: 1px solid #000000;
    padding: 8px;
    text-align: left;
}

.leaderboard-table th {
    background-color: #000000;
    color: #ffffff;
    font-weight: 900;
    text-transform: uppercase;
}

.leaderboard-table tr:hover td {
    background-color: #f0f0f0;
}

/* Utility */
.dispute-btn {
    display: inline-block;
    border: 2px solid #000000;
    padding: 10px 20px;
    font-weight: bold;
    text-transform: uppercase;
    margin-top: 20px;
    background: white;
}