/* --- Base Styles --- */
* {
    box-sizing: border-box;
}
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f4f9;
    color: #333;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* --- Header & Navigation --- */
header {
    background-color: #004d99;
    color: white;
    padding: 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.logo {
    font-size: 1.8em;
    font-weight: bold;
    text-decoration: none;
    color: white;
    letter-spacing: 1px;
}

/* Navigation Menu */
nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
}

nav ul li {
    margin-left: 20px;
}

nav ul li a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    font-size: 1em;
    transition: color 0.3s;
}

nav ul li a:hover {
    color: #ffd700; /* Gold accent on hover */
}

/* Hamburger Menu (Hidden on Desktop) */
.menu-toggle {
    display: none;
    font-size: 1.5em;
    cursor: pointer;
}

/* --- Main Layout --- */
.container {
    display: flex;
    flex-wrap: wrap;
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 20px;
    flex: 1; /* Pushes footer down */
    gap: 20px;
}

.main-content {
    flex: 3; /* Takes up 75% width on desktop */
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.sidebar {
    flex: 1; /* Takes up 25% width on desktop */
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* --- Ad Placeholders --- */
.ad-unit {
    background-color: #e0e0e0;
    border: 1px dashed #999;
    height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-weight: bold;
    border-radius: 5px;
}

/* --- Footer --- */
footer {
    background-color: #333;
    color: #bbb;
    text-align: center;
    padding: 15px;
    margin-top: auto;
    font-size: 0.9em;
}

/* --- Mobile Responsiveness --- */
@media (max-width: 768px) {
    .header-container { flex-direction: column; align-items: flex-start; }
    
    .menu-toggle { display: block; position: absolute; top: 20px; right: 20px; }
    
    nav ul {
        display: none; /* Hide menu by default on mobile */
        flex-direction: column;
        width: 100%;
        margin-top: 15px;
    }
    
    nav ul.show { display: flex; } /* JavaScript toggles this */
    
    nav ul li { margin: 10px 0; }
    
    .container { flex-direction: column; } /* Stack content and sidebar */
    
    .sidebar { order: 2; } /* Move sidebar below content on mobile */
    .main-content { order: 1; }

    /* NEW: Handle the top banner on mobile so it doesn't break the layout */
    .ad-banner-top div {
        width: 100% !important;   /* Override the 728px inline style */
        height: 50px !important;  /* Standard mobile ad height */
        line-height: 50px !important;
        font-size: 0.8em;
    }
}

/* --- New Additions from Header (Cleaned up inline styles) --- */

/* 1. The ALPHA tag in the logo */
.alpha-tag {
    font-size: 0.5em; 
    vertical-align: top; 
    color: #ffd700;
}

/* 2. The logged-in user menu item separator */
.user-nav-item {
    border-left: 1px solid #555; 
    padding-left: 15px; 
    margin-left: 10px;
}

/* 3. The Top Ad Banner Container */
.ad-banner-top {
    text-align: center;
    padding-top: 10px;
}

/* 4. The Top Ad Banner Box */
.ad-banner-box {
    display: inline-block; 
    width: 728px; 
    height: 90px; 
    background-color: white; 
    line-height: 90px; 
    color: #333; 
    border-radius: 2px; 
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}
/* --- Refactoring: Global Utilities --- */
.text-muted { color: #888; }
.list-spaced { line-height: 1.6; }

/* --- Refactoring: Footer --- */
.footer-link { color: #bbb; }
.social-link { 
    color: #ccc; 
    font-size: 1.5em; 
    margin: 0 10px; 
    transition: color 0.3s;
}
.social-link:hover { color: #fff; }

/* --- Refactoring: Sidebar --- */
.sidebar-header { border-bottom: 1px solid #ccc; padding-bottom: 5px; }
.sidebar-meta { font-size: 0.85em; color: #666; margin-bottom: 5px; }
.sidebar-list { list-style: none; padding-left: 0; margin-top: 5px; }
.sidebar-link { text-decoration: none; color: #333; font-size: 0.9em; }
.sidebar-link:hover { text-decoration: underline; }

/* --- Refactoring: Sidebar (Part 2) --- */
.sidebar-section { margin-bottom: 20px; }
.sidebar-content { font-size: 0.9em; line-height: 1.3; }
.sidebar-more-link-container { margin-top: 8px; }
.sidebar-more-link { font-size: 0.8em; text-decoration: underline; }
.sidebar-item { margin-bottom: 5px; }

/* --- Refactoring: Sidebar (Part 3) --- */
.game-status-box { background: #eef; padding: 10px 15px; border: 1px solid #ccd; border-radius: 5px; margin-bottom: 20px; }
.game-status-header { margin-top: 0; color: #004d99; border-bottom: 2px solid #fff; padding-bottom: 5px; margin-bottom: 5px; font-size: 1.1em; }
.flex-between { display: flex; justify-content: space-between; }
.divider-light { border: 0; border-top: 1px solid #dceeff; margin: 5px 0; }
.margin-bottom-30 { margin-bottom: 30px; }
.news-link-title { text-decoration: none; color: #004d99; font-size: 1.1em; }

/* --- New Components (Refactored from Inline Styles) --- */

/* Alert Boxes */
.alert-box {
    padding: 15px;
    border-left: 5px solid;
    border-radius: 4px;
    margin-bottom: 25px;
    background-color: #fff3cd; /* Default/Warning */
    color: #856404;
    border-color: #ffeeba;
}

/* Dashboard Cards */
.dashboard-card {
    background-color: #eef7ff;
    padding: 20px;
    border-left: 5px solid #004d99;
    margin: 30px 0;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}
.card-header {
    margin-top: 0;
    color: #004d99;
    margin-bottom: 5px;
    font-size: 1.1em;
}
.card-subtitle {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 0.85em;
    color: #666;
}

/* Leaderboard Table */
.table-responsive {
    overflow-x: auto;
    width: 100%;
    margin-bottom: 15px;
    border-radius: 4px; /* Ensure rounded corners clip */
}
.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    font-size: 0.95em;
    border: 1px solid #ddd;
}
.leaderboard-table th {
    background: #003366;
    color: white;
    padding: 6px;
    text-align: left;
}
.leaderboard-table td {
    padding: 6px;
    border-bottom: 1px solid #eee;
}
.leaderboard-table .rank-col {
    text-align: center; 
    width: 50px; 
    color: #555;
}
.leaderboard-table .mae-col {
    text-align: center; 
    font-weight: bold; 
    color: #004d99;
}
.leaderboard-table a {
    color: #004d99;
    text-decoration: none;
    border-bottom: 1px dotted #004d99;
}

/* Benchmark Grid */
.benchmark-grid {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 15px;
    margin-bottom: 30px;
}
.benchmark-card {
    flex: 1;
    min-width: 250px;
    background: #f4f4f9;
    padding: 15px;
    border-radius: 5px;
    border-left: 4px solid #ccc; /* Default */
}
.benchmark-card h3 { margin-top: 0; }
.benchmark-card p { font-size: 0.9em; }

.border-nbm { border-color: #004d99; }
.border-nws { border-color: #28a745; }
.border-normals { border-color: #6c757d; }

/* Status List */
.status-active { color: green; font-weight: bold; }
.status-closed { color: #d9534f; font-weight: bold; }

/* Utilities */
.btn {
    display: inline-block;
    padding: 8px 15px;
    text-decoration: none;
    border-radius: 4px;
    font-weight: bold;
    font-size: 0.9em;
}
.btn-primary {
    background-color: #004d99;
    color: white;
}
.text-italic { font-style: italic; }
.text-small { font-size: 0.85em; }
.text-muted { color: #666; }
.divider { border: 0; height: 1px; background: #ddd; margin: 20px 0; }

/* --- Game Entry Controls & Alerts --- */
.controls-container {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap; /* Fixes mobile overflow */
}

.control-group {
    text-align: left;
}

.alpha-alert {
    background-color: #fff3cd;
    color: #856404;
    padding: 15px;
    border: 1px solid #ffeeba;
    border-radius: 5px;
    margin-bottom: 20px;
    text-align: center;
}

.legend-container {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    font-size: 0.8em;
    background: #fff;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    flex-wrap: wrap;
}

.legend-badge {
    padding: 3px 8px;
    border-radius: 3px;
    border: 1px solid #ccc;
}

