body { font-family: Arial, sans-serif; background-color: #f5f5f5; margin: 0; padding: 20px; width: 100%; overflow-x: hidden; -webkit-text-size-adjust: 100%; }
html { width: 100%; overflow-x: hidden; }
.container { max-width: 1200px; margin: 0 auto; background: white; border-radius: 10px; box-shadow: 0 4px 6px rgba(0,0,0,0.1); }
.team-header { padding: 20px; border-radius: 10px 10px 0 0; color: white; text-align: center; }
.team-logo { width: 120px; height: 120px; border-radius: 10px; box-shadow: 0 2px 4px rgba(0,0,0,0.2); }
.depth-chart-container { padding: 20px; display: block; width: 100%; }
.sidebar { background: #f8f9fa; padding: 20px; border-radius: 10px; min-width: 250px; }
.teams-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; padding: 20px; }
.team-card { background: white; border-radius: 10px; padding: 15px; text-align: center; box-shadow: 0 2px 4px rgba(0,0,0,0.1); transition: transform 0.2s; }
.team-card:hover { transform: translateY(-2px); box-shadow: 0 4px 8px rgba(0,0,0,0.15); }
.team-card img { width: 60px; height: 60px; margin-bottom: 10px; }
.division-header { background: linear-gradient(135deg, #1e3a8a, #3b82f6); color: white; padding: 15px; margin: 20px 0 10px 0; border-radius: 8px; text-align: center; font-weight: bold; }
.conference-section { margin-bottom: 40px; }
.breadcrumb { background: #e5e7eb; padding: 10px 20px; border-radius: 5px; margin-bottom: 20px; }
.nav-links a { color: #2563eb; text-decoration: none; margin-right: 15px; }
.nav-links a:hover { text-decoration: underline; }

/* Depth Chart Table Styling */
.depth-chart-table { width: 100%; border-collapse: collapse; margin: 20px 0; box-shadow: 0 2px 8px rgba(0,0,0,0.1); border-radius: 10px; overflow: hidden; }
.depth-chart-table th { 
    background: linear-gradient(135deg, var(--team-primary, #1e3a8a), var(--team-secondary, #3b82f6));
    color: white; 
    padding: 15px 12px; 
    text-align: center; 
    font-weight: bold; 
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.depth-chart-table td { 
    padding: 12px; 
    text-align: center; 
    border-bottom: 1px solid #e5e7eb; 
    background: white;
    font-weight: 500;
}
.depth-chart-table tr:nth-child(even) td { background-color: #f8fafc; }
.depth-chart-table tr:hover td { 
    background-color: rgba(var(--team-primary-rgb, 30, 58, 138), 0.05);
    transform: scale(1.01);
    transition: all 0.2s ease;
}
.position-header { 
    background: var(--team-primary, #1e3a8a) !important;
    color: white !important;
    font-weight: bold;
    text-transform: uppercase;
}
.player-name { 
    font-weight: 600; 
    color: #1f2937;
}
.player-number { 
    color: var(--team-primary, #1e3a8a);
    font-weight: bold;
}

/* Player cell styling */
.player-cell {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    min-height: 50px;
}
.player-info {
    display: flex;
    flex-direction: column;
    flex: 1;
}
.player-firstname {
    font-size: 0.9em;
    font-weight: 500;
    color: #374151;
    line-height: 1.2;
}
.player-lastname {
    font-size: 1em;
    font-weight: 700;
    color: #1f2937;
    line-height: 1.2;
}
.player-jersey {
    font-size: 1.1em;
    font-weight: bold;
    color: var(--team-primary, #1e3a8a);
    background: rgba(var(--team-primary-rgb, 30, 58, 138), 0.1);
    padding: 4px 8px;
    border-radius: 4px;
    min-width: 35px;
    text-align: center;
}

/* Team logos navigation bar */
.teams-navbar { 
    background: linear-gradient(135deg, #f8fafc, #e2e8f0); 
    padding: 10px 15px; 
    border-radius: 8px; 
    margin-bottom: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}
.teams-navbar h4 {
    margin: 0 0 10px 0;
    color: #374151;
    font-size: 14px;
    text-align: center;
    font-weight: 600;
}
.conference-logos {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 12px;
}
.conference-logos:last-child { margin-bottom: 0; }
.division-group {
    flex: 1;
    text-align: center;
}
.division-title {
    font-size: 10px;
    font-weight: bold;
    color: #6b7280;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.team-logos {
    display: flex;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
}
.team-logo-link {
    display: block;
    transition: all 0.2s ease;
    border-radius: 4px;
    padding: 2px;
}
.team-logo-link:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.team-logo-link.current-team {
    background: var(--team-primary, #1e3a8a);
    box-shadow: 0 0 0 2px var(--team-primary, #1e3a8a);
}
.team-logo-link img {
    width: 28px;
    height: 28px;
    display: block;
}

/* Hide mobile dropdown on desktop */
.mobile-team-selector {
    display: none;
}

/* Tab System */
.tab-container {
    margin-top: 20px;
    width: 100%;
}
.tab-navigation {
    display: flex;
    background: #f1f5f9;
    border-radius: 10px 10px 0 0;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    width: 100%;
}
.tab-button {
    flex: 1;
    padding: 15px 20px;
    background: #f1f5f9;
    border: none;
    color: #64748b;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
}
.tab-button:hover {
    background: #e2e8f0;
    color: #475569;
}
.tab-button.active {
    background: white;
    color: var(--team-primary, #1e3a8a);
    border-bottom-color: var(--team-primary, #1e3a8a);
}
.tab-content {
    background: white;
    border-radius: 0 0 10px 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    min-height: 400px;
    width: 100%;
}
.tab-panel {
    display: none;
    padding: 20px;
    width: 100%;
    box-sizing: border-box;
}
.tab-panel.active {
    display: block;
}
.unit-section {
    margin-bottom: 30px;
}
.unit-title {
    color: var(--team-primary, #1e3a8a);
    border-bottom: 3px solid var(--team-primary, #1e3a8a);
    padding-bottom: 8px;
    margin-bottom: 20px;
    font-size: 24px;
    font-weight: bold;
}

/* Schedule Styling */
.schedule-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-radius: 10px;
    overflow: hidden;
}
.schedule-table th {
    background: linear-gradient(135deg, var(--team-primary, #1e3a8a), var(--team-secondary, #3b82f6));
    color: white;
    padding: 15px 12px;
    text-align: center;
    font-weight: bold;
    font-size: 14px;
}
.schedule-table td {
    padding: 15px 12px;
    text-align: center;
    border-bottom: 1px solid #e5e7eb;
    background: white;
}
.schedule-table tr:nth-child(even) td { background-color: #f8fafc; }
.schedule-table tr:hover td {
    background-color: rgba(var(--team-primary-rgb, 30, 58, 138), 0.05);
}
.game-opponent {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.opponent-logo {
    width: 24px;
    height: 24px;
}
.game-info {
    font-weight: 600;
    color: #1f2937;
}
.game-time {
    color: #6b7280;
    font-size: 0.9em;
}
.game-network {
    background: #f3f4f6;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.85em;
    color: #4b5563;
}
.home-game { color: var(--team-primary, #1e3a8a); font-weight: bold; }
.away-game { color: #6b7280; }
.betting-odds {
    font-size: 0.85em;
    color: #9ca3af;
}

/* Mobile Responsive Styles - Only affects screens 768px and below */
@media (max-width: 768px) {
    * {
        -webkit-box-sizing: border-box;
        box-sizing: border-box;
    }
    
    body {
        margin: 0;
        padding: 10px;
        width: 100vw;
        overflow-x: hidden;
    }
    
    .container {
        max-width: 100% !important;
        margin: 0 !important;
        padding: 10px !important;
        width: 100% !important;
        box-sizing: border-box !important;
        border-radius: 8px;
    }
    
    /* Mobile Navigation Bar - Dropdown */
    .teams-navbar {
        padding: 10px 15px;
        margin-bottom: 15px;
    }
    .teams-navbar h4 {
        font-size: 14px;
        margin-bottom: 10px;
    }
    .conference-logos {
        display: none;
    }
    
    /* Mobile Team Dropdown */
    .mobile-team-selector {
        display: block;
        width: 100%;
        position: relative;
    }
    .team-dropdown {
        width: 100%;
        padding: 12px 40px 12px 50px;
        font-size: 14px;
        border: 2px solid var(--team-primary, #1e3a8a);
        border-radius: 8px;
        background: white;
        color: #1f2937;
        cursor: pointer;
    }
    .dropdown-logo {
        position: absolute;
        left: 12px;
        top: 50%;
        transform: translateY(-50%);
        width: 24px;
        height: 24px;
        pointer-events: none;
    }
    
    /* Mobile Team Header */
    .team-header {
        padding: 15px;
        text-align: center;
    }
    .team-logo {
        width: 80px;
        height: 80px;
    }
    .team-header h1 {
        font-size: 20px;
        margin: 10px 0 5px 0;
    }
    .team-header p {
        font-size: 14px;
    }
    
    /* Mobile Breadcrumb */
    .breadcrumb {
        padding: 8px 15px;
        font-size: 14px;
    }
    
    /* Mobile Tabs */
    .depth-chart-container {
        padding: 10px !important;
        width: 100% !important;
        margin: 0 !important;
        box-sizing: border-box !important;
    }
    
    .tab-container {
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        box-sizing: border-box !important;
    }
    
    .tab-navigation {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        border-radius: 8px;
        background: #f1f5f9;
        overflow: visible;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        box-sizing: border-box !important;
    }
    .tab-button {
        flex: 1 1 auto;
        min-width: 0;
        padding: 10px 8px;
        font-size: 12px;
        text-align: center;
        border-bottom: 2px solid transparent;
        border-left: none;
        border-radius: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .tab-button:first-child {
        border-radius: 8px 0 0 8px;
    }
    .tab-button:last-child {
        border-radius: 0 8px 8px 0;
    }
    .tab-button.active {
        background: white;
        color: var(--team-primary, #1e3a8a);
        border-bottom: 2px solid var(--team-primary, #1e3a8a);
        border-left: none;
    }
    
    .tab-content {
        border-radius: 8px;
        margin-top: 0;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        box-sizing: border-box !important;
    }
    .tab-panel {
        width: 100% !important;
        margin: 0 !important;
        padding: 10px !important;
        box-sizing: border-box !important;
    }
    
    .unit-section {
        width: 100% !important;
        margin: 0 0 20px 0 !important;
        padding: 0 !important;
        box-sizing: border-box !important;
    }
    
    /* Mobile Tables */
    .depth-chart-table, .schedule-table {
        font-size: 12px;
        border-radius: 8px;
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }
    .depth-chart-table thead, .schedule-table thead {
        display: block;
    }
    .depth-chart-table tbody, .schedule-table tbody {
        display: block;
    }
    .depth-chart-table tr, .schedule-table tr {
        display: table;
        width: 100%;
        table-layout: fixed;
    }
    .depth-chart-table th, .schedule-table th {
        padding: 8px 4px;
        font-size: 10px;
        width: 20%;
    }
    .depth-chart-table td, .schedule-table td {
        padding: 8px 4px;
        font-size: 11px;
        width: 20%;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    /* Alternative: Card-based layout for very small screens */
    @media (max-width: 600px) {
        .depth-chart-table, .schedule-table {
            display: block;
            overflow: visible;
            white-space: normal;
        }
        .depth-chart-table thead, .schedule-table thead {
            display: none;
        }
        .depth-chart-table tbody, .schedule-table tbody {
            display: block;
        }
        .depth-chart-table tr, .schedule-table tr {
            display: block;
            background: white;
            border: 1px solid #e5e7eb;
            border-radius: 8px;
            margin-bottom: 10px;
            padding: 12px;
        }
        .depth-chart-table td, .schedule-table td {
            display: block;
            width: 100%;
            padding: 4px 0;
            border: none;
            text-align: left;
        }
        .depth-chart-table td:before, .schedule-table td:before {
            content: attr(data-label) ": ";
            font-weight: bold;
            color: var(--team-primary, #1e3a8a);
        }
        
        /* Simple mobile schedule - just week and opponent */
        .schedule-table td:before {
            display: none;
        }
        .schedule-table tr {
            padding: 8px 12px;
        }
        .schedule-table td:nth-child(1)::after {
            content: " - ";
        }
        .schedule-table td:nth-child(2),
        .schedule-table td:nth-child(4), 
        .schedule-table td:nth-child(5),
        .schedule-table td:nth-child(6) {
            display: none;
        }
        .schedule-table td:nth-child(1),
        .schedule-table td:nth-child(3) {
            display: inline;
            padding: 0;
        }
    }
    
    /* Mobile Player Cells */
    .player-cell {
        padding: 6px 8px;
        min-height: 40px;
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    .player-info {
        flex: none;
        width: 100%;
    }
    .player-firstname {
        font-size: 0.8em;
    }
    .player-lastname {
        font-size: 0.9em;
    }
    .player-jersey {
        font-size: 0.9em;
        padding: 2px 6px;
        align-self: flex-end;
        margin-top: -25px;
    }
    
    /* Mobile Schedule */
    .game-opponent {
        flex-direction: column;
        gap: 4px;
    }
    .opponent-logo {
        width: 20px;
        height: 20px;
    }
    .game-info {
        font-size: 0.9em;
    }
    .game-time {
        font-size: 0.8em;
    }
    .game-network {
        font-size: 0.75em;
        padding: 1px 4px;
    }
    .betting-odds {
        font-size: 0.75em;
    }
    
    /* Mobile Unit Titles */
    .unit-title {
        font-size: 20px;
        margin-bottom: 15px;
    }
    
    /* Hide some columns on very small screens */
    @media (max-width: 480px) {
        .depth-chart-table th:nth-child(5),
        .depth-chart-table td:nth-child(5) {
            display: none;
        }
        .player-cell {
            flex-direction: row;
            justify-content: space-between;
            align-items: center;
        }
        .player-jersey {
            margin-top: 0;
            align-self: center;
        }
    }
}
