/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #fff;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px 0;
    border-bottom: 2px solid #000;
}

header h1 {
    font-size: 2.2em;
    font-weight: 700;
    color: #000;
}

/* Main content */
main {
    margin-bottom: 40px;
}

section {
    margin-bottom: 50px;
}

h2 {
    font-size: 1.8em;
    font-weight: 600;
    color: #000;
    margin-bottom: 20px;
    border-left: 4px solid #000;
    padding-left: 15px;
}

/* Introduction */
.introduction p {
    font-size: 1.1em;
    line-height: 1.8;
    color: #333;
    max-width: 900px;
}

/* Team info card */
.definition-card {
    background-color: #f5f5f5;
    border: 1px solid #ccc;
    border-radius: 8px;
    margin: 20px 0;
    padding: 0;
    display: none;
}

.definition-card.show {
    display: block;
}

.card-header {
    background-color: #000;
    color: white;
    padding: 15px 20px;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h3 {
    margin: 0;
    font-size: 1.2em;
    font-weight: 500;
}

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.5em;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.card-content {
    padding: 20px;
}

.card-content p {
    margin: 0;
    font-size: 1em;
    line-height: 1.6;
    color: #333;
}

/* Figure caption */
figcaption {
    text-align: center;
    font-style: italic;
    color: #666;
    margin-top: 15px;
    padding: 10px;
    background-color: #f5f5f5;
    border-radius: 0 0 8px 8px;
    font-size: 0.9em;
}

/* Table styles */
.table-container {
    overflow-x: auto;
    margin: 20px 0;
    border: 1px solid #ccc;
    border-radius: 8px;
}

#nba-stats-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9em;
    background-color: #fff;
}

#nba-stats-table th {
    background-color: #f5f5f5;
    color: #000;
    font-weight: 600;
    padding: 12px 8px;
    text-align: center;
    border-bottom: 2px solid #000;
    white-space: nowrap;
    cursor: help;
}

#nba-stats-table th:first-child {
    text-align: left;
    padding-left: 15px;
}

/* Team name clickable styles */
.team-name {
    cursor: pointer;
}

.team-name:hover {
    background-color: #f0f0f0 !important;
    color: #000 !important;
    font-weight: 600;
}

/* Header tooltip styles */
.header-tooltip {
    cursor: pointer;
    position: relative;
}

.header-tooltip:hover {
    background-color: #e0e0e0 !important;
    color: #000 !important;
}

.header-tooltip-popup {
    position: absolute;
    background-color: #000;
    color: white;
    padding: 10px 15px;
    border-radius: 6px;
    font-size: 0.9em;
    max-width: 250px;
    z-index: 1000;
    display: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    line-height: 1.4;
}

.header-tooltip-popup::after {
    content: '';
    position: absolute;
    top: -5px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-bottom: 5px solid #000;
}

#nba-stats-table td {
    padding: 10px 8px;
    text-align: center;
    border-bottom: 1px solid #ddd;
}

#nba-stats-table td:first-child {
    text-align: left;
    padding-left: 15px;
    font-weight: 500;
    color: #000;
}

#nba-stats-table tbody tr:nth-child(even) {
    background-color: #f9f9f9;
}

/* Row highlight on hover */
.row-highlight {
    background-color: #e0e0e0 !important;
}

/* Wins column highlighting */
.wins-column {
    background-color: #ddd !important;
    color: #000 !important;
}

.wins-data {
    background-color: #ddd;
    color: #000;
    font-weight: 600;
}

/* Analysis Examples section */
.analysis-examples {
    margin-bottom: 50px;
}

.analysis-examples p {
    font-size: 1.1em;
    color: #333;
    margin-bottom: 25px;
}

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

.example-card {
    background-color: #fff;
    border: 1px solid #ccc;
    border-radius: 8px;
    overflow: hidden;
}

.example-card .card-header {
    background-color: #000;
    color: white;
    padding: 20px;
}

.example-card .card-header h3 {
    margin: 0;
    font-size: 1.3em;
    font-weight: 600;
}

.example-card .card-content {
    padding: 25px;
}

.example-card .card-content p {
    margin: 0 0 15px 0;
    line-height: 1.6;
    color: #333;
}

.example-card .card-content p:last-child {
    margin-bottom: 0;
}

/* Key terms section */
.key-terms p {
    font-size: 1.1em;
    color: #333;
    margin-bottom: 25px;
}

.terms-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.term {
    background-color: #f5f5f5;
    color: #000;
    padding: 15px 20px;
    cursor: pointer;
    font-weight: 500;
    margin: 0 0 5px 0;
    border: 1px solid #ccc;
    border-radius: 6px 6px 0 0;
}

.term:hover {
    background-color: #e0e0e0;
    color: #000;
}

.term:active {
    background-color: #000;
    color: white;
}

.term-definition {
    display: none;
    background-color: #fff;
    color: #333;
    padding: 15px 20px;
    border: 1px solid #ccc;
    border-top: none;
    border-radius: 0 0 6px 6px;
    font-size: 0.9em;
    line-height: 1.5;
    margin: 0 0 20px 0;
}

/* Footer */
footer {
    text-align: center;
    padding: 30px 0;
    border-top: 2px solid #000;
    color: #666;
    font-style: italic;
}

/* Responsive design */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    header h1 {
        font-size: 1.8em;
    }
    
    #nba-stats-table {
        font-size: 0.8em;
    }
    
    #nba-stats-table th,
    #nba-stats-table td {
        padding: 8px 4px;
    }
    
    .examples-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .example-card .card-content {
        padding: 20px;
    }
    
    .terms-list {
        grid-template-columns: 1fr;
    }
    
    .definition-card {
        margin: 10px 0;
    }
    
    .card-header {
        padding: 12px 15px;
    }
    
    .card-content {
        padding: 15px;
    }
}