:root {
    --bg-color: #0d1117;
    --panel-bg: rgba(22, 27, 34, 0.85);
    --border-color: #30363d;
    --neon-blue: #58a6ff;
    --neon-green: #3fb950;
    --neon-red: #ff7b72;
    --neon-purple: #bc8cff;
    --neon-yellow: #e3b341;
    --text-primary: #ffffff;
    --text-secondary: #c9d1d9;
    --font-heading: 'Press Start 2P', cursive;
    --font-body: 'VT323', monospace;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 1.2rem;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    /* Prevent body scroll */
    text-shadow: 1px 1px 0px rgba(0, 0, 0, 0.8);
}

/* Retro CRT Effects */
.scanlines {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom,
            rgba(255, 255, 255, 0),
            rgba(255, 255, 255, 0) 50%,
            rgba(0, 0, 0, 0.1) 50%,
            rgba(0, 0, 0, 0.1));
    background-size: 100% 4px;
    z-index: 1000;
    pointer-events: none;
}

.crt-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    box-shadow: inset 0 0 100px rgba(0, 0, 0, 0.9);
    z-index: 999;
    pointer-events: none;
}

/* Header */
.dashboard-header {
    text-align: center;
    padding: 1rem 0;
    border-bottom: 2px solid var(--neon-blue);
    box-shadow: 0 0 10px var(--neon-blue);
    background: linear-gradient(180deg, #111, var(--bg-color));
}

.dashboard-header h1 {
    font-family: var(--font-heading);
    font-size: 2rem;
    color: var(--neon-blue);
    text-shadow: 0 0 5px var(--neon-blue);
    margin-bottom: 0;
}

.title-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-bottom: 0.5rem;
}

.header-logo {
    height: 2.5rem;
    width: 2.5rem;
}

.dashboard-header .subtitle {
    font-family: var(--font-body);
    font-size: 1.5rem;
    color: var(--neon-yellow);
    letter-spacing: 2px;
}

/* Layout */
.dashboard {
    display: flex;
    flex: 1;
    overflow: hidden;
    padding: 10px;
    gap: 10px;
}

.panel {
    background-color: var(--panel-bg);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.panel-header {
    background: rgba(0, 0, 0, 0.5);
    padding: 10px;
    border-bottom: 2px solid var(--border-color);
}

.panel-header h2 {
    font-family: var(--font-body);
    font-size: 1.8rem;
    color: var(--neon-green);
    text-shadow: 0 0 5px var(--neon-green);
    margin: 0;
    text-transform: uppercase;
}

/* Chart Panel (66.6%) */
.chart-panel {
    flex: 2;
    border-color: var(--neon-purple);
    box-shadow: inset 0 0 10px rgba(188, 140, 255, 0.2);
}

.chart-panel .panel-header h2 {
    color: var(--neon-purple);
    text-shadow: 0 0 5px var(--neon-purple);
}

.chart-container {
    flex: 1;
    position: relative;
    padding: 10px 40px 10px 10px;
    /* Right padding for logos */
    min-height: 0;
}

.x-axis-label {
    text-align: center;
    padding: 5px;
    color: var(--neon-purple);
    font-size: 1.5rem;
}

/* Feed Panel (33.3%) */
.feed-panel {
    flex: 1;
    border-color: var(--neon-green);
    box-shadow: inset 0 0 10px rgba(63, 185, 80, 0.2);
}

.scroll-container {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    scroll-behavior: smooth;
}

/* Game Cards */
.game-card {
    border: 1px solid var(--neon-green);
    border-radius: 4px;
    padding: 10px;
    margin-bottom: 10px;
    background: rgba(0, 20, 0, 0.4);
    transition: transform 0.2s, background 0.2s;
}

.game-card:hover {
    transform: scale(1.02);
    background: rgba(0, 40, 0, 0.6);
}

.game-card .date {
    color: var(--neon-yellow);
    font-weight: bold;
    margin-bottom: 5px;
    font-size: 1.4rem;
}

.game-card .matchup {
    display: flex;
    justify-content: space-between;
    font-size: 1.6rem;
    margin-bottom: 5px;
}

.game-card .score {
    color: #fff;
}

.game-card .note {
    font-family: var(--font-body);
    color: var(--text-secondary);
    font-size: 1.2rem;
    font-style: italic;
    border-top: 1px dashed var(--neon-green);
    padding-top: 5px;
    margin-top: 5px;
    text-align: center;
}

.game-card.upcoming {
    border-color: var(--neon-blue);
    background: rgba(0, 0, 20, 0.4);
}

.game-card.upcoming .note {
    border-top-color: var(--neon-blue);
}

/* Bottom Dashboard */
.bottom-dashboard {
    display: flex;
    margin: 0 10px 10px 10px;
    gap: 10px;
    height: 25vh;
}

/* Notes Panel */
.notes-panel {
    flex: 2;
    border-color: var(--neon-yellow);
    box-shadow: inset 0 0 10px rgba(227, 179, 65, 0.2);
}

.notes-panel .panel-header h2 {
    color: var(--neon-yellow);
    text-shadow: 0 0 5px var(--neon-yellow);
    font-size: 1.5rem;
}

/* Support Panel */
.support-panel {
    flex: 1;
    border-color: var(--neon-red);
    box-shadow: inset 0 0 10px rgba(255, 123, 114, 0.2);
}

.support-panel .panel-header h2 {
    color: var(--neon-red);
    text-shadow: 0 0 5px var(--neon-red);
    font-size: 1.5rem;
}

.support-container {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    display: flex;
    flex-direction: column;
}

.support-panel table {
    width: 100%;
    border-collapse: collapse;
}

.notes-container {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 1.4rem;
}

.note-item {
    display: flex;
    gap: 10px;
}

.note-item .date {
    color: var(--neon-red);
    white-space: nowrap;
}

.note-item .content {
    color: var(--text-primary);
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #000;
}

::-webkit-scrollbar-thumb {
    background: var(--neon-green);
    border-radius: 4px;
}

.feed-panel ::-webkit-scrollbar-thumb {
    background: var(--neon-green);
}

.chart-panel ::-webkit-scrollbar-thumb {
    background: var(--neon-purple);
}

.notes-panel ::-webkit-scrollbar-thumb {
    background: var(--neon-yellow);
}

.support-panel ::-webkit-scrollbar-thumb {
    background: var(--neon-red);
}

/* Chart Tooltip Overrides */
#chartjs-tooltip {
    background: rgba(0, 0, 0, 0.9);
    border: 1px solid var(--neon-purple);
    color: white;
    font-family: var(--font-body);
    font-size: 1.4rem;
    padding: 10px;
    border-radius: 4px;
    pointer-events: none;
    box-shadow: 0 0 10px var(--neon-purple);
}

/* Responsive Design for Mobile */
@media (max-width: 768px) {
    body {
        height: auto;
        overflow-y: auto;
    }

    .dashboard,
    .bottom-dashboard {
        flex-direction: column;
        height: auto;
        overflow: visible;
    }

    .chart-panel {
        flex: none;
        height: 50vh;
    }

    .feed-panel {
        flex: none;
        height: 40vh;
    }

    .notes-panel,
    .support-panel {
        flex: none;
        height: 30vh;
    }
}

/* Header Actions */
.dashboard-header {
    position: relative;
}

.header-actions {
    position: absolute;
    right: 5%;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: row;
    gap: 15px;
}

.header-actions-left {
    position: absolute;
    left: 5%;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: row;
    gap: 15px;
}

.nav-btn {
    font-family: var(--font-body);
    font-size: 1.2rem;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.8);
}

.nav-btn.btn-blue {
    color: var(--neon-blue);
    border-color: var(--neon-blue);
}

.nav-btn.btn-blue:hover {
    background: rgba(88, 166, 255, 0.2);
    box-shadow: 0 0 10px var(--neon-blue);
}

.nav-btn.btn-green {
    color: var(--neon-green);
    border-color: var(--neon-green);
}

.nav-btn.btn-green:hover {
    background: rgba(63, 185, 80, 0.2);
    box-shadow: 0 0 10px var(--neon-green);
}

.nav-btn.btn-yellow {
    color: var(--neon-yellow);
    border-color: var(--neon-yellow);
}

.nav-btn.btn-yellow:hover {
    background: rgba(227, 179, 65, 0.2);
    box-shadow: 0 0 10px var(--neon-yellow);
}

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

.modal-content {
    background-color: var(--panel-bg);
    border: 2px solid var(--neon-purple);
    box-shadow: 0 0 20px rgba(188, 140, 255, 0.4);
    margin: 10% auto;
    padding: 20px;
    width: 80%;
    max-width: 600px;
    border-radius: 8px;
    position: relative;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.close-btn {
    color: var(--neon-red);
    position: absolute;
    right: 15px;
    top: 10px;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.close-btn:hover {
    text-shadow: 0 0 10px var(--neon-red);
}

#modal-title {
    color: var(--neon-purple);
    font-size: 2rem;
    margin-bottom: 15px;
    border-bottom: 1px dashed var(--neon-purple);
    padding-bottom: 5px;
    font-family: var(--font-body);
    flex-shrink: 0;
}

.modal-body {
    font-size: 1.4rem;
    line-height: 1.4;
    color: var(--text-primary);
    overflow-y: auto;
    padding-right: 10px;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.modal-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
}

.modal-body th,
.modal-body td {
    border: 1px solid var(--border-color);
    padding: 8px;
    text-align: left;
}

.modal-body th {
    background: #1c2128;
    color: var(--neon-blue);
    position: sticky;
    top: -1px;
    z-index: 10;
    box-shadow: 0 1px 0 var(--border-color);
}

.modal-body ul,
.modal-body ol {
    margin: 15px 0 15px 25px;
}

.modal-body a {
    color: var(--neon-blue);
    text-decoration: underline;
}

.modal-body a:hover {
    text-shadow: 0 0 5px var(--neon-blue);
}

@media (max-width: 768px) {

    .header-actions,
    .header-actions-left {
        position: static;
        flex-direction: row;
        justify-content: center;
        transform: none;
        margin-top: 10px;
    }

    .modal-content {
        width: 95%;
        margin: 5% auto;
        padding: 15px;
        max-height: 90vh;
    }
}