:root {
    /* Light mode colors (Apple-esque) */
    --bg-primary: #FFFFFF;
    --bg-secondary: #F5F5F7;
    --text-primary: #1D1D1F;
    --text-secondary: #6E6E73;
    --text-muted: #86868B;
    --accent-primary: #0071E3;
    --accent-hover: #0077ED;
    --border-color: rgba(0, 0, 0, 0.08);
    --hover-bg: rgba(0, 0, 0, 0.04);
    --card-bg: #FFFFFF;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
    --glass-bg: rgba(255, 255, 255, 0.72);
    --glass-border: rgba(255, 255, 255, 0.18);
    --sidebar-bg: #E8E8ED;
    --tab-active: #FFFFFF;
    --tab-hover: #F0F0F5;
}

[data-theme="dark"] {
    /* Dark mode colors */
    --bg-primary: #222222;
    --bg-secondary: #1C1C1E;
    --text-primary: #F5F5F7;
    --text-secondary: #A1A1A6;
    --text-muted: #86868B;
    --accent-primary: #0A84FF;
    --accent-hover: #409CFF;
    --border-color: rgba(255, 255, 255, 0.12);
    --hover-bg: rgba(255, 255, 255, 0.08);
    --card-bg: #222222;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --glass-bg: rgba(34, 34, 34, 0.72);
    --glass-border: rgba(255, 255, 255, 0.18);
    --sidebar-bg: #1A1A1C;
    --tab-active: #2C2C2E;
    --tab-hover: #252527;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    display: flex;
    height: 100vh;
    overflow: hidden;
    transition: background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1), color 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Sidebar Navigation */
.sidebar {
    width: 200px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 20px 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-tabs {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-tab {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    user-select: none;
    /* Default to block/flex, but on traditional sites links are anchors */
    text-decoration: none;
}

.nav-tab:hover {
    background: var(--tab-hover);
    color: var(--text-primary);
}

.nav-tab.active {
    background: var(--tab-active);
    color: var(--accent-primary);
    box-shadow: var(--shadow-sm);
}

.nav-tab .material-icons {
    font-size: 20px;
}

.portfolio-section {
    flex: 1;
    padding: 40px;
    overflow-y: auto;
    background: var(--bg-secondary);
    position: relative;
}

/* Page content visibility */
.page-content {
    /* Changed for multi-page: always block if present, but we might keep this class for transition hooks or similar */
    display: block;
    animation: fadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.header-buttons {
    position: absolute;
    top: 32px;
    right: 32px;
    display: flex;
    gap: 12px;
    align-items: center;
}

.theme-toggle,
.ai-toggle,
.linkedin-toggle {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    padding: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-md);
    width: 44px;
    height: 44px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    text-decoration: none;
}

.theme-toggle:hover,
.ai-toggle:hover,
.linkedin-toggle:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-lg);
    background: var(--card-bg);
}

.theme-icon,
.ai-icon,
.linkedin-icon {
    font-size: 20px;
}

/* Removed duplicate styles */

/* Hide AI toggle on desktop - only show on mobile */
.ai-toggle {
    display: none;
}

.iframe-section {
    width: 33.33%;
    height: 100vh;
    display: none;
    flex-direction: column;
    background: #222222;
}

/* Show iframe section only on Portfolio page - now we use classes on body based on current page */
body.portfolio-active .iframe-section {
    display: flex;
}

/* Full width content when iframe-section is hidden */
body.about-active .portfolio-section,
body.basketball-active .portfolio-section {
    width: 100%;
}

.content-card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.content-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.header-card {
    position: sticky;
    top: 0;
    background: var(--card-bg);
    z-index: 100;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Hide header tabs on desktop - sidebar navigation is used instead */
.header-card .nav-tabs {
    display: none;
}


/* Recruiter Panel Styling */
.recruiter-panel {
    height: 25vh;
    background: #222222;
    padding: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.recruiter-content {
    width: 100%;
    max-width: 320px;
}

.question-step {
    text-align: center;
    animation: fadeInUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.question-step.hidden {
    display: none;
}

.question-text {
    font-size: 15px;
    font-weight: 500;
    color: #F5F5F7;
    margin-bottom: 20px;
    line-height: 1.5;
    letter-spacing: -0.01em;
}

.button-group {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.btn {
    font-family: -apple-system, BlinkMacSystemFont, "Inter", sans-serif;
    font-size: 14px;
    font-weight: 500;
    padding: 10px 20px;
    border: none;
    background: #0A84FF;
    color: #FFFFFF;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(10, 132, 255, 0.3);
    letter-spacing: -0.01em;
}

.btn:hover {
    background: #409CFF;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(10, 132, 255, 0.4);
}

.btn:active {
    transform: translateY(0);
}

.btn-no {
    background: rgba(255, 255, 255, 0.1);
    color: #A1A1A6;
    box-shadow: none;
}

.btn-no:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #F5F5F7;
    box-shadow: none;
}

.text-input,
.text-area {
    width: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Inter", sans-serif;
    font-size: 14px;
    padding: 12px 16px;
    margin-bottom: 16px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    color: #F5F5F7;
    outline: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: -0.01em;
}

.text-input:focus,
.text-area:focus {
    border-color: #0A84FF;
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 0 0 4px rgba(10, 132, 255, 0.1);
}

.text-input::placeholder,
.text-area::placeholder {
    color: #86868B;
}

.text-area {
    resize: vertical;
    min-height: 80px;
    max-height: 120px;
}

.loading-spinner {
    width: 24px;
    height: 24px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-top: 2px solid #0A84FF;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 12px;
}

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

    100% {
        transform: rotate(360deg);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Strudel Container */
.strudel-container {
    height: 75vh;
    flex: 1;
}

.strudel-iframe {
    width: 100%;
    height: 100%;
    border: none;
    zoom: 0.67;
}

/* Summary Modal */
.summary-modal {
    display: none;
    position: fixed;
    z-index: 1001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    animation: fadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.summary-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 640px;
    width: 90%;
    max-height: 85vh;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 40px;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: scaleIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }

    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.summary-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 24px;
    text-align: center;
    letter-spacing: -0.02em;
}

.summary-text {
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 20px;
    letter-spacing: -0.01em;
}

.summary-text a {
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 500;
}

.summary-text a:hover {
    text-decoration: underline;
}

.summary-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 24px;
    font-weight: 300;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 50%;
    background: var(--hover-bg);
}

.summary-close:hover {
    background: var(--border-color);
    color: var(--text-primary);
}

/* Portfolio highlighting */
.highlighted-section {
    background: rgba(10, 132, 255, 0.08) !important;
    border-left: 3px solid var(--accent-primary) !important;
    transform: translateX(8px) !important;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* Keyword highlighting */
.keyword-highlight {
    background: rgba(10, 132, 255, 0.12);
    color: var(--accent-primary);
    padding: 2px 6px;
    border-radius: 6px;
    font-weight: 600;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.keyword-highlight:hover {
    background: rgba(10, 132, 255, 0.2);
}

.name {
    font-size: 42px;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.03em;
    color: var(--text-primary);
}

.contact {
    font-size: 15px;
    color: var(--text-secondary);
    margin-top: 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    letter-spacing: -0.01em;
}

.contact-item {
    transition: color 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.contact-item:hover {
    color: var(--accent-primary);
}

.section-title {
    font-weight: 700;
    font-size: 20px;
    margin-bottom: 16px;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.subsection {
    margin-bottom: 24px;
}

.job-title,
.project-title {
    font-weight: 600;
    font-size: 18px;
    color: var(--text-primary);
    margin-bottom: 4px;
    letter-spacing: -0.01em;
}

.company,
.school {
    font-weight: 500;
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: 4px;
    letter-spacing: -0.01em;
}

.date-location {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 12px;
    letter-spacing: -0.01em;
}

.description {
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-secondary);
    margin-bottom: 12px;
    letter-spacing: -0.01em;
}

.description strong {
    color: var(--text-primary);
    font-weight: 600;
}

.skills-list {
    font-size: 14px;
    line-height: 1.6;
}

.skills-category {
    font-weight: 600;
    color: var(--text-primary);
    display: block;
    margin-bottom: 8px;
    letter-spacing: -0.01em;
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    body {
        flex-direction: column;
    }

    .sidebar {
        display: none;
    }

    .header-card .nav-tabs {
        display: none;
    }

    @media (max-width: 768px) {
        .header-card .nav-tabs {
            display: flex;
            flex-direction: row;
            gap: 8px;
            margin-top: 16px;
        }
    }

    .nav-tab {
        flex: 1;
        justify-content: center;
        padding: 10px 12px;
        font-size: 13px;
        background: var(--glass-bg);
        border: 1px solid var(--glass-border);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        box-shadow: var(--shadow-md);
        border-radius: 12px;
    }

    .nav-tab.active {
        background: var(--card-bg);
        box-shadow: var(--shadow-lg);
    }

    .nav-tab:hover {
        background: var(--card-bg);
        box-shadow: var(--shadow-lg);
    }

    .nav-tab .material-icons {
        font-size: 18px;
    }

    .portfolio-section {
        width: 100%;
        height: 100vh;
        padding: 20px;
        padding-top: 20px;
    }

    .header-buttons {
        position: absolute;
        top: 12px;
        right: 24px;
        gap: 8px;
    }

    .theme-toggle,
    .ai-toggle,
    .linkedin-toggle {
        width: 40px;
        height: 40px;
        padding: 10px;
    }

    /* Show AI toggle on mobile */
    .ai-toggle {
        display: flex;
    }

    .theme-icon,
    .ai-icon,
    .linkedin-icon {
        font-size: 18px;
    }

    .strudel-container {
        display: none;
    }

    .iframe-section {
        width: auto;
        height: auto;
        position: fixed;
        top: 20px;
        right: 20px;
        z-index: 1001;
        pointer-events: none;
    }

    /* Hide the old floating recruiter panel button on mobile */
    .recruiter-panel {
        display: none;
    }

    .recruiter-content {
        display: none;
        position: fixed;
        top: 90px;
        right: 20px;
        left: 20px;
        max-width: 400px;
        margin: 0 auto;
        background: var(--card-bg);
        border: 1px solid var(--border-color);
        border-radius: 20px;
        padding: 32px;
        box-shadow: var(--shadow-lg);
        max-height: calc(100vh - 110px);
        overflow-y: auto;
        z-index: 1002;
        pointer-events: all;
    }

    .recruiter-content.expanded {
        display: block;
    }

    .recruiter-content::before {
        content: '×';
        position: absolute;
        top: 16px;
        right: 20px;
        font-size: 32px;
        font-weight: 300;
        color: var(--text-secondary);
        cursor: pointer;
        z-index: 1003;
        width: 32px;
        height: 32px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        background: var(--hover-bg);
        transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .recruiter-content::before:hover {
        background: var(--border-color);
    }

    .content-card {
        padding: 24px;
        border-radius: 12px;
    }

    .header-card {
        position: sticky;
        top: 0;
        padding: 24px;
        border-radius: 12px;
        z-index: 1005;
        margin-bottom: 16px;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .header-card .contact {
        overflow: hidden;
        flex-wrap: nowrap;
        width: 100%;
        transition: max-height 0.2s cubic-bezier(0.4, 0, 0.2, 1),
            margin-top 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .header-card .contact-item {
        transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    }
}

.advanced-stats-subtable .stat-row:hover {
    background: var(--hover-bg);
}

/* Mobile responsive for basketball page */
@media (max-width: 768px) {
    #basketballPage>div:first-of-type {
        flex-direction: column !important;
    }

    .basketball-main-section,
    .basketball-blog-section {
        flex: 1 !important;
        width: 100% !important;
    }

    .basketball-blog-section {
        margin-top: 16px;
    }

    .basketball-stats-table {
        font-size: 13px;
    }

    .basketball-stats-table th,
    .basketball-stats-table td {
        padding: 10px 8px;
    }

    .basketball-stats-table th:first-child,
    .basketball-stats-table td:first-child {
        padding-left: 12px;
    }

    .player-name {
        font-size: 22px;
    }

    .player-header {
        padding: 16px;
    }

    .stats-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .stats-toggle,
    .stats-tabs {
        width: 100%;
    }

    .stats-tabs {
        justify-content: center;
    }

    .shooting-stats {
        flex-direction: column;
    }

    /* Fantasy Tools Styles */
    .roster-list {
        background: var(--bg-primary);
        border: 1px solid var(--border-color);
        border-radius: 8px;
        min-height: 280px;
        padding: 8px;
        max-height: 450px;
        overflow-y: auto;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 6px;
        align-content: start;
    }

    .player-card {
        background: var(--card-bg);
        border: 1px solid var(--border-color);
        border-radius: 6px;
        padding: 6px;
        margin-bottom: 0;
        cursor: grab;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        align-items: flex-start;
        transition: all 0.2s;
        font-size: 11px;
        gap: 3px;
    }

    .player-card:hover {
        border-color: var(--accent-color);
        transform: translateY(-1px);
        box-shadow: var(--shadow-sm);
    }

    .player-card:active {
        cursor: grabbing;
    }

    .player-info {
        display: flex;
        flex-direction: column;
    }

    .player-name {
        font-weight: 500;
        font-size: 12px;
    }

    .player-meta {
        font-size: 10px;
        color: var(--text-muted);
    }

    .player-score {
        font-weight: 700;
        color: var(--accent-primary);
        font-size: 13px;
        align-self: flex-end;
    }

    .trade-bin {
        background: var(--bg-secondary);
        border: 2px dashed var(--border-color);
        border-radius: 10px;
        min-height: 80px;
        padding: 10px;
        flex: 1;
        display: flex;
        flex-direction: column;
        gap: 6px;
        transition: all 0.2s;
    }

    .trade-bin.drag-over {
        border-color: var(--accent-color);
        background: rgba(var(--accent-rgb), 0.05);
    }

    .bin-label {
        text-align: center;
        font-size: 11px;
        color: var(--text-muted);
        margin-bottom: 4px;
    }

    .trade-value {
        text-align: center;
        margin-top: 8px;
        font-weight: 600;
        font-size: 15px;
    }

    .prediction-result {
        background: var(--bg-tertiary);
        border-radius: 8px;
        padding: 24px;
        text-align: center;
    }

    .input-label {
        display: block;
        margin-bottom: 6px;
        font-weight: 500;
        color: var(--text-secondary);
        font-size: 11px;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }
}

/* ==========================================================================
   MISSING STYLES RECONSTRUCTION
   Restoring styles that were lost during extraction (expandables, basketball UI)
   ========================================================================== */

/* --- Portfolio Expandable Sections --- */

.expandable-subsection {
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 16px;
    padding-bottom: 16px;
}

.expandable-subsection:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.expandable-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    cursor: pointer;
    padding: 8px 0;
    width: 100%;
    user-select: none;
    transition: opacity 0.2s ease;
}

.expandable-header:hover {
    opacity: 0.7;
}

.expandable-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
    opacity: 0;
}

.expandable-content.expanded {
    max-height: 2000px;
    opacity: 1;
    margin-top: 12px;
}

.expand-icon {
    font-size: 14px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--accent-primary);
    margin-top: 4px;
    margin-left: 8px;
}

.expandable-header.expanded .expand-icon {
    transform: rotate(90deg);
}

.project-images {
    display: flex;
    gap: 12px;
    margin: 16px 0;
    overflow-x: auto;
    padding-bottom: 8px;
}

.project-image {
    height: 120px;
    width: auto;
    border-radius: 8px;
    cursor: zoom-in;
    transition: transform 0.2s ease;
    border: 1px solid var(--border-color);
}

.project-image:hover {
    transform: scale(1.05);
}

/* --- Basketball Stats UI --- */

/* Controls (Toggle & Tabs) */
.stats-controls {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.stats-toggle {
    display: flex;
    background: var(--bg-secondary);
    padding: 4px;
    border-radius: 10px;
    align-self: flex-start;
}

.toggle-btn {
    padding: 8px 16px;
    border: none;
    background: transparent;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.toggle-btn.active {
    background: var(--card-bg);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

.stats-tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.tab-btn {
    padding: 8px 16px;
    border: 1px solid var(--border-color);
    background: transparent;
    border-radius: 20px;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.tab-btn:hover {
    background: var(--hover-bg);
    color: var(--text-primary);
}

.tab-btn.active {
    background: var(--accent-primary);
    color: #FFFFFF;
    border-color: var(--accent-primary);
}

/* Panels */
.stats-panel {
    display: none;
    animation: fadeIn 0.3s ease;
}

.stats-panel.active {
    display: block;
}

/* Base Table Styles */
.basketball-stats-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
    /* Reset from previous definitions if any */
}

.basketball-stats-table th {
    text-align: right;
    padding: 12px 8px;
    font-weight: 500;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
    position: sticky;
    top: 0;
    background: var(--card-bg);
}

.basketball-stats-table th:first-child {
    text-align: left;
    position: sticky;
    left: 0;
    background: var(--card-bg);
    z-index: 10;
}

.basketball-stats-table td {
    text-align: right;
    padding: 12px 8px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.basketball-stats-table td:first-child {
    text-align: left;
    font-weight: 500;
    color: var(--text-secondary);
    position: sticky;
    left: 0;
    background: var(--card-bg);
    /* Opaque to cover scrollers */
}

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

/* Advanced Stats Grid */
.advanced-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.advanced-section {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 16px;
    border: 1px solid var(--border-color);
}

.advanced-section-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.advanced-stats-subtable {
    width: 100%;
}

.advanced-stats-subtable td {
    text-align: right;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 13px;
}

.advanced-stats-subtable td:first-child {
    text-align: left;
    color: var(--text-secondary);
}

/* Shooting Breakdown Sidebar */
.shooting-sidebar {
    width: 200px;
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 16px;
    border: 1px solid var(--border-color);
}

.shooting-sidebar-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 16px;
}

.shooting-compact-section {
    margin-bottom: 16px;
}

.shooting-compact-header {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.shooting-compact-pct {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.shooting-compact-detail {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.progress-bar-compact {
    height: 4px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 2px;
}

/* Stat Colors */
.stat-excellent {
    color: #34C759;
    font-weight: 600;
}

.stat-good {
    color: #30D158;
}

.stat-average {
    color: var(--text-primary);
}

.stat-poor {
    color: #FF3B30;
}

.stat-projected {
    font-style: italic;
    color: var(--accent-primary);
}

/* Empty & Loading States */
.basketball-empty-state,
.basketball-loading,
.basketball-error {
    text-align: center;
    padding: 60px 20px;
    background: var(--bg-secondary);
    border-radius: 12px;
    margin-top: 20px;
}

.empty-icon,
.error-icon {
    font-size: 48px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.error-icon {
    color: #FF3B30;
}

.btn-retry {
    margin-top: 16px;
    padding: 8px 16px;
    background: var(--text-primary);
    color: var(--bg-primary);
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

/* Injury Badges */
.injury-badge {
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    background: #FF3B30;
    color: white;
    font-weight: 600;
    margin-left: 8px;
}

.injury-out {
    background: #FF3B30;
}

.injury-day-to-day {
    background: #FF9500;
}

/* Modal Styles (Ensure they are present) */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(5px);
}

.modal-content {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 1000px;
    max-height: 90vh;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.modal-image {
    width: 100%;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
    z-index: 2001;
}

.close:hover,
.close:focus {
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
}

/* Responsive */
@media (max-width: 768px) {
    .nineCat-container {
        flex-direction: column;
    }

    .shooting-sidebar {
        width: 100%;
        margin-top: 16px;
    }

    .stats-tabs {
        justify-content: flex-start;
    }

    .project-image {
        height: 100px;
    }
}

/* ==========================================================================
   MISSING STYLES RECONSTRUCTION - ROUND 2
   Restoring styles for Skill Items (Hover) and Fantasy Tools (Trade/Predictor)
   ========================================================================== */

/* --- Skill Items (Portfolio) --- */

.skill-item {
    display: inline-block;
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    margin-right: 8px;
    margin-bottom: 8px;
    border: 1px solid var(--border-color);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: default;
    user-select: none;
}

.skill-item:hover {
    background: var(--text-primary);
    color: var(--bg-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
    border-color: transparent;
}

/* --- Fantasy Tools UI (Basketball) --- */

.fantasy-tool-section {
    animation: fadeIn 0.3s ease;
}

.trade-container {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid var(--border-color);
}

.trade-column {
    display: flex;
    flex-direction: column;
}

.roster-list {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    height: 400px;
    overflow-y: auto;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.roster-list .empty-state {
    padding: 24px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.player-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: grab;
    transition: all 0.2s ease;
    user-select: none;
}

.player-card:hover {
    border-color: var(--accent-primary);
    transform: translateX(2px);
    box-shadow: var(--shadow-sm);
}

.player-card.dragging {
    opacity: 0.5;
    background: var(--bg-secondary);
}

.player-info {
    display: flex;
    flex-direction: column;
}

.player-name {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-primary);
}

.player-meta {
    font-size: 11px;
    color: var(--text-muted);
}

.player-score {
    font-weight: 700;
    color: var(--accent-primary);
    font-size: 14px;
}

/* Drag & Drop Targets */
.trade-center {
    justify-content: center;
}

.trade-bin {
    background: var(--card-bg);
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    transition: all 0.2s ease;
    overflow-y: auto;
    min-height: 120px;
}

.trade-bin.drag-over {
    border-color: var(--accent-primary);
    background: rgba(10, 132, 255, 0.05);
    /* Blue tint */
}

.bin-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 4px;
    pointer-events: none;
}

.trade-value {
    text-align: center;
    font-weight: 600;
    margin-top: 12px;
    font-size: 15px;
    color: var(--text-primary);
    padding: 8px;
    background: var(--card-bg);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

/* Matchup Predictor */
.input-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    display: block;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#h2h-results {
    margin-top: 24px;
    animation: fadeIn 0.3s ease;
}

.prediction-card {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    border: 1px solid var(--border-color);
}

.prediction-score {
    font-size: 36px;
    font-weight: 800;
    color: var(--accent-primary);
    margin: 16px 0;
}

.prediction-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 20px;
}

.prediction-stat {
    background: var(--card-bg);
    padding: 12px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.prediction-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.prediction-value {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

@media (max-width: 768px) {
    .trade-container {
        flex-direction: column;
    }

    .trade-center {
        flex-direction: row;
        gap: 12px;
    }

    .trade-bin {
        min-height: 100px;
    }
}

/* ==========================================================================
   FANTASY TOOLS REFINEMENT
   Grid layout for roster, updated card design (Top-Left/Top-Right/Bottom)
   ========================================================================== */

/* Roster List Grid Layout */
.roster-list {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    /* Half-width cards */
    gap: 8px;
    /* Slightly larger gap for grid */
    align-content: start;
    /* Don't stretch rows */
}

/* Updated Player Card Layout */
.player-card {
    display: flex;
    flex-direction: column;
    /* Stack main area and footer */
    justify-content: space-between;
    height: 100%;
    /* Ensure uniform height in grid */
    min-height: 80px;
    padding: 0;
    /* Clear padding, use inner containers */
    overflow: hidden;
    /* For border radius */
}

.card-main {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 8px 10px;
    flex: 1;
}

.player-info-container {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    max-width: 65%;
    /* Prevent overlapping with score */
}

.player-score-container {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    text-align: right;
}

.score-label {
    font-size: 9px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 2px;
}

.player-score {
    font-size: 16px;
    /* Larger score */
    font-weight: 700;
    color: var(--accent-primary);
    line-height: 1.2;
}

/* Card Footer (Trends) */
.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-secondary);
    padding: 4px 10px;
    border-top: 1px solid var(--border-color);
    font-size: 10px;
}

.trend-group {
    display: flex;
    align-items: center;
    gap: 4px;
}

.trend-label {
    color: var(--text-muted);
    font-weight: 500;
}

/* Adjusted Icon Sizes */
.trend-icon.material-icons {
    font-size: 14px !important;
    /* Smaller icons matching text size */
}

.trend-neutral {
    font-size: 12px;
    color: var(--text-muted);
}

/* ==========================================================================
   CLEAN PLAYER CARD REIMPLEMENTATION
   Robust layout handling for player cards in grid
   ========================================================================== */

/* Clean Card Layout */
.player-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    min-height: 90px;
    margin: 0;
    padding: 0;
    overflow: hidden;
    box-shadow: none;
    /* Clean look */
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    cursor: grab;
}

.player-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
    border-color: var(--accent-primary);
    z-index: 10;
}

.player-card:active {
    cursor: grabbing;
}

/* Injury Tints */
.card-injury-out {
    background-color: rgba(255, 59, 48, 0.08) !important;
    /* Red tint */
    border-color: rgba(255, 59, 48, 0.3) !important;
}

.card-injury-out .player-name {
    color: #D32F2F;
    /* Darker red for text compatibility */
}

.card-injury-dtd {
    background-color: rgba(255, 149, 0, 0.08) !important;
    /* Orange tint */
    border-color: rgba(255, 149, 0, 0.3) !important;
}

/* Top Row: Info & Score */
.card-top-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 10px 10px 6px;
    /* Top padding */
    gap: 8px;
    flex: 1;
}

.player-info-container {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    overflow: hidden;
    /* Handle long names */
}

.player-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.player-meta {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

.player-score-container {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    flex-shrink: 0;
    /* Keep score visible */
}

.score-label {
    font-size: 9px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 2px;
}

.player-score {
    font-size: 18px;
    font-weight: 700;
    color: var(--accent-primary);
    line-height: 1;
}

.games-badge {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    padding: 2px 6px;
    border-radius: 4px;
    margin-top: 2px;
}

.badge-high {
    color: #34C759;
    /* Green for 4+ games */
    background: rgba(52, 199, 89, 0.1);
}

.badge-zero {
    color: var(--text-muted);
    opacity: 0.7;
}

.badge-oos {
    color: #D32F2F;
    background: rgba(255, 59, 48, 0.1);
}

.badge-return {
    color: #FF9500;
    /* Orange to match DTD/Warning */
    background: rgba(255, 149, 0, 0.1);
}

/* Bottom Row: Trends */
.card-bottom-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-secondary);
    padding: 4px 10px;
    border-top: 1px solid var(--border-color);
    margin-top: auto;
    /* Push to bottom */
}

.trend-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: var(--text-primary);
}

.trend-label {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 10px;
}

.trend-icon.material-icons {
    font-size: 14px !important;
    vertical-align: middle;
}

.trend-up {
    color: #34C759;
}

.trend-down {
    color: #FF3B30;
}

.trend-neutral {
    color: var(--text-muted);
}

/* ==========================================================================
   WIDTH FIX
   Overriding previous max-width constraints to ensure full width usage
   ========================================================================== */

.player-card {
    width: 100%;
}

.card-top-row {
    width: 100%;
    box-sizing: border-box;
}

.player-info-container {
    max-width: none;
    /* Reset previous constraint */
    flex: 1;
    /* Grow to fill available space */
    min-width: 0;
    /* Allow flex item to shrink for text truncation */
    margin-right: 8px;
    /* Spacing between name and score */
}

.player-score-container {
    flex-shrink: 0;
    /* Don't shrink the score */
}

.card-bottom-row {
    width: 100%;
    box-sizing: border-box;
}