@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;700;800&display=swap');

:root {
    --primary: #1d428a;
    /* NBA Blue */
    --secondary: #c8102e;
    /* NBA Red */
    --accent: #ffb81c;
    /* NBA Gold */
    --bg-dark: #020617;
    --sidebar-bg: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.4);
    --glass: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --text-main: #f8fafc;
    --text-muted: #cbd5e1;
    /* Increased contrast for A11y from #94a3b8 */
    --sidebar-width: 280px;
    --header-height: 70px;
    --radius-lg: 1.25rem;
    --radius-md: 0.75rem;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.5;
    background-image:
        radial-gradient(circle at 0% 0%, rgba(29, 66, 138, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 100% 100%, rgba(200, 16, 46, 0.1) 0%, transparent 50%);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Layout Structure */
.app-container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
    transition: transform 0.3s ease;
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 2rem;
}

/* Sidebar Elements */
.sidebar-header {
    padding: 2rem;
    text-align: center;
    border-bottom: 1px solid var(--glass-border);
}

.sidebar-logo {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -1px;
    background: linear-gradient(135deg, #fff, var(--accent));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-nav {
    flex: 1;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-link:hover {
    background: var(--glass);
    color: var(--text-main);
}

.nav-link.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 15px rgba(29, 66, 138, 0.3);
}

.nav-link i {
    font-size: 1.2rem;
}

/* Sections & Cards */
.section {
    max-width: 1400px;
    margin: 0 auto;
    animation: fadeIn 0.4s ease-out;
}

.section-header {
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.section-title {
    font-size: clamp(1.4rem, 4vw, 2.2rem);
    font-weight: 800;
}

.header-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.date-navigator {
    background: var(--glass);
    padding: 0.5rem 1rem;
    border-radius: 0.8rem;
    display: flex;
    gap: 1.25rem;
    align-items: center;
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
}

.date-navigator input[type="date"] {
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    font-family: inherit;
    font-weight: 700;
    font-size: 0.9rem;
    outline: none;
}

.sidebar-date-filter {
    padding: 1.5rem;
    margin-top: 1rem;
    border-top: 1px solid var(--glass-border);
}

.sidebar-date-filter input[type="date"] {
    width: 100%;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    color: white;
    outline: none;
}

/* Data Tables */
.table-container {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    overflow-x: auto;
    backdrop-filter: blur(10px);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.data-table th {
    padding: 1rem;
    text-align: left;
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 800;
    border-bottom: 1px solid var(--glass-border);
}

.data-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--glass-border);
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table tr:hover {
    background: var(--glass);
}

.stats-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    backdrop-filter: blur(10px);
}

.stat-card .label {
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-card .value {
    font-size: clamp(1.5rem, 5vw, 2.2rem);
    font-weight: 800;
    margin: 0.5rem 0;
    color: var(--accent);
}

.games-grid {
    display: none;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 1.5rem;
}

.games-grid.active {
    display: grid;
}

/* Premium Game Card */
.game-card {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    backdrop-filter: blur(12px);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    position: relative;
    overflow: hidden;
}

.game-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--primary);
    opacity: 0.5;
}

.game-card:hover {
    transform: translateY(-5px);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.game-card header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 800;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.team-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.team-name {
    font-size: clamp(0.9rem, 3vw, 1.35rem);
    font-weight: 800;
    letter-spacing: -0.5px;
}

.score-display {
    font-size: clamp(1.2rem, 4vw, 1.75rem);
    font-weight: 950;
    color: var(--accent);
    text-shadow: 0 0 10px rgba(255, 184, 28, 0.2);
}

.result-card {
    background: var(--glass);
    display: inline-flex;
    align-items: center;
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--glass-border);
    gap: 1.5rem;
    backdrop-filter: blur(10px);
}

.result-card .label {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.result-card .value {
    font-size: 1.8rem;
    font-weight: 900;
    color: var(--accent);
}

@media (max-width: 640px) {
    .result-card {
        width: 100%;
        justify-content: space-between;
        padding: 0.75rem 1rem;
    }

    .result-card .value {
        font-size: 1.4rem;
    }
}

/* Badges */
.badge {
    padding: 0.4rem 0.8rem;
    border-radius: 999px;
    font-weight: 800;
    font-size: 0.7rem;
}

.badge-live {
    background: #ef4444;
    color: white;
    animation: pulse 2s infinite;
}

.badge-upcoming {
    background: var(--primary);
    color: white;
}

.badge-final {
    background: #334155;
    color: #94a3b8;
}

/* Buttons */
.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary:hover {
    background: #2563eb;
    transform: translateY(-1px);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }

    100% {
        opacity: 1;
    }
}

/* Bottom Tab Navigation (Mobile Only) */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 70px;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--glass-border);
    z-index: 1000;
    justify-content: space-around;
    align-items: center;
    padding: 0 0.5rem;
    padding-bottom: env(safe-area-inset-bottom);
}

.bottom-nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    transition: all 0.2s;
    width: 20%;
    padding: 0.5rem 0;
}

.bottom-nav-link i {
    font-size: 1.25rem;
}

.bottom-nav-link:active {
    transform: scale(0.9);
}

.bottom-nav-link.active {
    color: var(--accent);
}

.bottom-nav-link.active i {
    text-shadow: 0 0 10px rgba(255, 184, 28, 0.4);
}

/* Responsive Overrides */
@media (max-width: 1024px) {
    .bottom-nav {
        display: flex !important;
    }

    .sidebar {
        display: none;
        /* Fully hide sidebar on mobile in favor of bottom nav */
    }

    .main-content {
        margin-left: 0;
        padding: 1.5rem;
        padding-bottom: 90px;
        /* Space for bottom nav */
    }
}

@media (max-width: 768px) {
    .data-table thead {
        display: none;
    }

    .data-table,
    .data-table tbody,
    .data-table tr,
    .data-table td {
        display: block;
        width: 100%;
    }

    .data-table tr {
        margin-bottom: 1rem;
        background: rgba(255, 255, 255, 0.02);
        border: 1px solid var(--glass-border);
        border-radius: 0.8rem;
    }

    .data-table td {
        text-align: right;
        padding: 0.75rem 1rem;
        position: relative;
        border-bottom: 1px solid var(--glass-border);
    }

    .data-table td:last-child {
        border-bottom: none;
    }

    .data-table td::before {
        content: attr(data-label);
        position: absolute;
        left: 1rem;
        width: 45%;
        text-align: left;
        font-weight: 800;
        font-size: 0.7rem;
        text-transform: uppercase;
        color: var(--text-muted);
    }
}

@media (max-width: 640px) {
    .section-header {
        flex-direction: column;
        gap: 1rem;
        margin-bottom: 1.5rem;
    }

    .section-header>div:last-child {
        width: 100%;
    }

    .date-navigator {
        width: 100%;
        justify-content: space-between;
    }

    .container {
        padding: 0.75rem;
    }

    .games-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .main-content {
        padding: 1rem 0.75rem;
    }

    .section-title {
        font-size: 1.3rem;
    }

    .game-card {
        padding: 1.25rem 1rem;
        gap: 1rem;
    }

    .stat-card {
        padding: 1.25rem 1rem;
    }

    .sidebar-header {
        padding: 1.5rem 1rem;
    }

    .sidebar-nav {
        padding: 1rem;
    }
}