/* 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;
}

/* Navigation Styles */
.navigation {
    background-color: #1a1a1a;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    gap: 2rem;
}

.nav-link {
    color: #fff;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-weight: 500;
}


.nav-link.active {
    background-color: #007acc;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 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;
}

.subtitle {
    font-size: 1.1rem;
    color: #666;
    font-weight: 400;
    max-width: 600px;
    margin: 0 auto;
}

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

section {
    margin-bottom: 50px;
}

.section {
    padding: 3rem 0;
    border-bottom: 1px solid #e5e5e5;
}

.section:last-child {
    border-bottom: none;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    margin-bottom: 1rem;
    color: #222;
}

h1 { font-size: 2.5rem; margin-bottom: 0.5rem; }
h2 { 
    font-size: 1.8em;
    font-weight: 600;
    color: #000;
    margin-bottom: 20px;
    border-left: 4px solid #000;
    padding-left: 15px;
}
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; margin-bottom: 0.75rem; }

p {
    margin-bottom: 1rem;
    color: #555;
}

a {
    color: #0066cc;
    text-decoration: none;
    border-bottom: 1px solid transparent;
}


/* Cards */
.card {
    background-color: #ffffff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 2rem;
    margin-bottom: 2rem;
}


/* Grid */
.grid {
    display: grid;
    gap: 2rem;
    margin-top: 2rem;
}

.grid-2 { grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }

/* Navigation Button */
.nav-button {
    display: inline-block;
    background-color: #007acc;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
    margin-top: 1rem;
}


/* 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;
}


.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;
}


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


.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;
    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: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;
}

/* W3HW specific styles */
.flex-table-comment {
    display: flex;
    align-items: flex-start;
    margin-bottom: 2rem;
    position: relative;
}

.flex-table-comment .fixed-table {
    flex: 0 0 50%;
    min-width: 300px;
    overflow-x: auto;
}

.flex-table-comment .comment-section {
    flex: 0 0 50%;
    min-width: 200px;
}

.resizer {
    width: 12px;
    background: linear-gradient(to right, #ccc, #888, #ccc);
    cursor: col-resize;
    position: relative;
    border-radius: 6px;
    margin: 0 12px;
    border: 1px solid #aaa;
    min-height: 400px;
}


.resizer:active {
    background: linear-gradient(to right, #888, #444, #888);
    border-color: #666;
}

.fixed-table table {
    border-collapse: collapse;
    width: 100%;
    background: #fafafa;
    border: 2px solid #333;
    border-radius: 4px;
    overflow: hidden;
}

.fixed-table th, .fixed-table td {
    border: 1px solid #e5e5e5;
    padding: 12px 16px;
    text-align: left;
    font-size: 1rem;
}

.fixed-table th {
    background: #f7f7f7;
    font-weight: bold;
    border-bottom: 2px solid #333;
}

.fixed-table tr:last-child td {
    border-bottom: none;
}

.fixed-table td:last-child,
.fixed-table th:last-child {
    border-right: none;
}

.comment-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 0;
}

.comment-section .card {
    background: #fafbfc;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 1.5rem;
    font-size: 1.05rem;
    color: #222;
    margin-bottom: 0;
}

/* Glossary section styles */
.glossary-section {
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 2rem;
    margin-top: 2rem;
}

.glossary-section h2 {
    color: #333;
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #666;
    padding-bottom: 0.5rem;
}

.glossary-section dl {
    margin: 0;
    padding: 0;
}

.glossary-section dt {
    font-weight: bold;
    font-size: 1.1rem;
    color: #555;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    padding: 0.5rem;
    background: #f0f0f0;
    border-left: 4px solid #666;
    border-radius: 4px;
}

.glossary-section dt:first-child {
    margin-top: 0;
}

.glossary-section dd {
    margin: 0 0 1rem 1rem;
    padding: 0.5rem;
    font-size: 1rem;
    line-height: 1.6;
    color: #555;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
}

/* W2HW specific styles */
.source-header {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.logo-placeholder {
    width: 40px;
    height: 40px;
    background-color: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.8rem;
    color: #666;
    margin-right: 1rem;
}

.screenshot-container {
    margin: 1.5rem 0;
    text-align: center;
}

.screenshot {
    width: 100%;
    max-width: 600px;
    height: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.screenshot-container small {
    color: #666;
    font-size: 0.85rem;
    display: block;
    margin-top: 0.5rem;
}

.insights {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e5e5e5;
}

/* Statistics */
.stat-category h4 {
    color: #333;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e5e5e5;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.stat-item:last-child {
    border-bottom: none;
}

.stat-label {
    color: #666;
    font-weight: 500;
}

.stat-value {
    color: #333;
    font-weight: 600;
    font-size: 1.1rem;
}

/* Lists */
.insights-list {
    list-style: none;
    padding: 0;
}

.insights-list li {
    background-color: #ffffff;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    padding: 1rem 1.5rem;
    margin-bottom: 1rem;
    position: relative;
    padding-left: 2.5rem;
}

.insights-list li::before {
    content: "•";
    color: #0066cc;
    font-weight: bold;
    position: absolute;
    left: 1rem;
    top: 1rem;
}

/* Logo Styles */
.logo {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e5e5e5;
    margin: 8px 12px 8px 0;
}


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

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .nav-container {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    h1 { font-size: 2rem; }
    h2 { font-size: 1.5rem; }
    
    .grid-2,
    .grid-3 {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .card {
        padding: 1.5rem;
    }
    
    #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;
    }
    
    .source-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .logo-placeholder {
        margin-right: 0;
        margin-bottom: 0.5rem;
    }
    
    .stat-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
    
    .flex-table-comment {
        flex-direction: column;
    }
    
    .flex-table-comment .fixed-table,
    .flex-table-comment .comment-section {
        flex: none;
        width: 100%;
    }
    
    .resizer {
        display: none;
    }
}
