/* RESTORED "BLUE GLOW" THEME + ARCHITECTURE FIXED (v9) */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&display=swap');

:root {
    /* "Blue Glow" Palette */
    --bg-dark: #0f172a;
    /* Deep Slate Blue */
    --bg-glow: #1e3a8a;
    /* Bright Blue Glow */
    --bg-card: #1e293b;
    /* Slate 800 */
    --text-main: #f8fafc;
    /* White/Slate 50 */
    --text-muted: #94a3b8;
    /* Slate 400 */
    --border-color: #334155;
    /* Slate 700 */

    --primary-color: #2563eb;
    /* Royal Blue 600 (Bright) */
    --primary-hover: #1d4ed8;
    /* Royal Blue 700 */
    --secondary-color: #475569;
    /* Slate 600 */

    --success-color: #10b981;
    /* Emerald */
    --danger-color: #ef4444;
    /* Red */
}

/* SPA ROUTING - CRITICAL */
.panel {
    display: none;
}

.panel.active {
    display: block;
    animation: fadeIn 0.3s ease forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Roboto', sans-serif;
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    background: radial-gradient(circle at center, var(--bg-dark) 0%, #020617 100%);
    background-color: #020617;
    background-attachment: fixed;
    /* Fix scroll artifact */
}

body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    box-shadow: inset 0 0 150px rgba(37, 99, 235, 0.15);
    z-index: -1;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* CARDS */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.1);
}

.card-header {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
    margin-bottom: 20px;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
}

/* NAVBAR */
.navbar {
    background: rgba(15, 23, 42, 0.85);
    /* Semi-transparent dark */
    backdrop-filter: blur(12px);
    /* Glass effect */
    border: 1px solid rgba(255, 255, 255, 0.08);
    /* Subtle border */
    border-radius: 16px;
    /* Rounded corners */
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    /* Deeper shadow */
}

/* NAVBAR VISIBILITY ENFORCER (v8 Compat) */
.navbar.hidden {
    display: none !important;
}

body.login-view .navbar {
    display: none !important;
}

.navbar-brand {
    color: var(--primary-color) !important;
    font-weight: 700;
    font-size: 1.5rem;
}

/* FIX MENU LAYOUT */
.navbar-nav {
    display: flex;
    gap: 15px;
    list-style: none;
    margin: 0;
    padding: 0;
    align-items: center;
}

.nav-link {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: all 0.2s;
}

.nav-link:hover,
.nav-link.active {
    color: white;
    background: rgba(37, 99, 235, 0.1);
}

/* --- ARCHITECTURE & LAYOUT (RESTORED from v4/v7) --- */

/* Grid System for Team Selection */
.team-selection-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 20px;
}

@media (max-width: 768px) {
    .team-selection-grid {
        grid-template-columns: 1fr;
    }
}

/* Scroll Containers (Prevent Page Scroll) */
.scroll-container {
    max-height: 500px;
    overflow-y: auto;
    padding-right: 5px;
    /* Space for scrollbar */
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.1);
}

.column-header {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--primary-color);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 5px;
}

/* LIST ITEMS */
.list-item {
    background: #1e293b;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    transition: transform 0.2s, border-color 0.2s;
}

.list-item:hover {
    transform: translateY(-2px);
    border-color: var(--primary-color);
    background: #252e42;
}

.list-item-title {
    font-weight: 700;
    font-size: 1.1rem;
    color: white;
}

.list-item-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.list-item-value {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 1.25rem;
}

/* STATS GROUP */
.stats-group {
    display: flex;
    gap: 15px;
    margin-bottom: 1rem;
}

.stat-card {
    flex: 1;
    background: rgba(0, 0, 0, 0.2);
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid var(--border-color);
}

.stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

/* BUTTONS */
.btn {
    border-radius: 6px;
    padding: 0.6rem 1.2rem;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    color: white;
    background: var(--primary-color);
    transition: background 0.2s;
}

.btn:hover {
    background: var(--primary-hover);
}

.btn-secondary {
    background: var(--secondary-color);
}

.btn-danger {
    background: var(--danger-color);
}

.btn-success {
    background: var(--success-color);
}

/* FORMS */
.form-control,
.form-select,
.form-input,
input {
    background: #020617;
    border: 1px solid var(--border-color);
    color: white;
    padding: 10px;
    border-radius: 6px;
    width: 100%;
    margin-bottom: 5px;
}

.form-control:focus,
.form-input:focus {
    outline: 2px solid var(--primary-color);
    border-color: transparent;
}

/* LOGIN CARD */
#loginPanel .card,
#registerPanel .card {
    border: 1px solid #334155;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
    background: #1e293b;
}

/* UTILS */
.text-muted {
    color: var(--text-muted);
}

.text-center {
    text-align: center;
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.grid {
    display: grid;
    gap: 20px;
}

.grid-2 {
    grid-template-columns: 1fr 1fr;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mt-2 {
    margin-top: 0.5rem;
}

.mb-3 {
    margin-bottom: 1rem;
}

.hidden {
    display: none !important;
}

/* SCROLLBAR */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #0f172a;
}

::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #475569;
}