:root {
    /* FEU Colors */
    --feu-green: #00843D;
    --feu-green-dark: #005c2a;
    --feu-gold: #FDB913;
    --feu-gold-hover: #ffc93d;
    
    /* Dark Theme Base */
    --bg-dark: #0a0f0d;
    --bg-card: rgba(20, 25, 22, 0.6);
    --bg-card-hover: rgba(30, 35, 32, 0.8);
    
    /* Text */
    --text-primary: #ffffff;
    --text-secondary: #a0aab2;
    --text-muted: #5e6870;
    
    /* Layout */
    --sidebar-width: 260px;
    --border-radius: 16px;
    --border-glass: 1px solid rgba(255, 255, 255, 0.08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Background Gradients */
.bg-shape {
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    z-index: -1;
    opacity: 0.4;
}

.shape-green {
    width: 600px;
    height: 600px;
    background: var(--feu-green);
    top: -200px;
    left: -200px;
}

.shape-gold {
    width: 500px;
    height: 500px;
    background: var(--feu-gold);
    bottom: -150px;
    right: -150px;
    opacity: 0.15;
}

/* Glassmorphism Classes */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: var(--border-glass);
    border-radius: var(--border-radius);
    padding: 24px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

/* Main Layout */
.app-container {
    display: flex;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: rgba(10, 15, 13, 0.8);
    backdrop-filter: blur(20px);
    border-right: var(--border-glass);
    display: flex;
    flex-direction: column;
    padding: 32px 0;
    z-index: 10;
}

.brand {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 32px;
    margin-bottom: 48px;
}

.brand .logo {
    background: linear-gradient(135deg, var(--feu-green), var(--feu-gold));
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
    box-shadow: 0 4px 15px rgba(0, 132, 61, 0.4);
}

.brand h2 {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.brand h2 span {
    color: var(--feu-gold);
}

.nav-links {
    list-style: none;
    flex: 1;
}

.nav-links li {
    margin-bottom: 8px;
    padding: 0 16px;
}

.nav-links a {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 24px;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 600;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.nav-links a i {
    font-size: 18px;
    width: 20px;
    text-align: center;
}

.nav-links a:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.nav-links a.active {
    color: white;
    background: var(--feu-green);
    box-shadow: 0 4px 15px rgba(0, 132, 61, 0.3);
}

.admin-toggle {
    padding: 0 32px;
}

/* Content Area */
.content-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding: 32px 48px;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

.top-bar h1 {
    font-size: 32px;
    font-weight: 800;
}

/* Form & Inputs */
.sport-selector select, input, select {
    background: var(--bg-card);
    border: var(--border-glass);
    color: white;
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    outline: none;
    cursor: pointer;
    transition: border 0.3s;
}

.sport-selector select:hover, input:focus, select:focus {
    border-color: var(--feu-gold);
}

/* Buttons */
.btn-primary {
    background: var(--feu-green);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 15px;
}

.btn-primary:hover {
    background: var(--feu-green-dark);
    box-shadow: 0 4px 15px rgba(0, 132, 61, 0.4);
}

.btn-gold {
    background: var(--feu-gold);
    color: var(--bg-dark);
    border: none;
    padding: 12px 24px;
    border-radius: 10px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-gold:hover {
    background: var(--feu-gold-hover);
    box-shadow: 0 4px 15px rgba(253, 185, 19, 0.4);
}

.btn-outline {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--text-muted);
    padding: 12px 24px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    width: 100%;
}

.btn-outline:hover {
    color: white;
    border-color: white;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 100;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

.modal.active {
    display: flex;
}

.modal-content {
    width: 400px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: relative;
}

.close-modal {
    position: absolute;
    top: 16px; right: 20px;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-secondary);
}

.close-modal:hover { color: white; }
.text-error { color: #ff4d4d; font-size: 14px; }

/* Grid Layouts for Views */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 20px;
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    background: rgba(0, 132, 61, 0.1);
    color: var(--feu-green);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.stat-info h3 { font-size: 32px; font-weight: 800; margin-bottom: 4px; }
.stat-info p { color: var(--text-secondary); font-weight: 600; }

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

th {
    text-align: left;
    padding: 16px;
    color: var(--text-secondary);
    font-weight: 600;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

td {
    padding: 16px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

/* Utilities */
.hidden { display: none !important; }
.admin-only { display: none; }
body.is-admin .admin-only { display: block; }
body.is-admin .admin-toggle button {
    background: var(--feu-gold);
    color: var(--bg-dark);
    border-color: var(--feu-gold);
}

/* Mobile Responsiveness - Premium App UI */
@media (max-width: 768px) {
    body {
        background-color: #050806; /* slightly darker to let cards pop more */
    }
    
    .app-container {
        flex-direction: column;
        padding-bottom: 80px; /* Space for the bottom navbar */
        height: auto;
        min-height: 100vh;
    }
    
    /* Scrollable Bottom Navigation Bar */
    .sidebar {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 70px;
        padding: 0;
        flex-direction: row;
        border-right: none;
        border-top: 1px solid rgba(255,255,255,0.1);
        background: rgba(10, 15, 13, 0.95);
        backdrop-filter: blur(25px);
        -webkit-backdrop-filter: blur(25px);
        z-index: 1000;
        justify-content: flex-start;
        overflow-x: auto;
        overflow-y: hidden;
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch; /* Smooth iOS scrolling */
        /* Hide scrollbar */
        -ms-overflow-style: none;
        scrollbar-width: none;
    }
    .sidebar::-webkit-scrollbar {
        display: none;
    }
    
    .brand {
        display: none; /* Hide logo on mobile bottom nav */
    }
    
    /* Perfect Flexbox for Scrollable Nav */
    .nav-links {
        display: flex;
        flex-direction: row;
        margin: 0;
        padding: 0;
        flex: 1 0 auto; /* Allow growth, prevent shrink */
        align-items: stretch;
    }
    
    .nav-links li {
        margin: 0;
        flex: 1 0 75px; /* Grow to fill space, but never shrink below 75px */
        display: flex;
        justify-content: center;
    }
    
    /* Crucial fix: Hide admin items on mobile by default, overriding the flex rule */
    .nav-links li.admin-only {
        display: none;
    }
    
    /* Crucial fix: Override the base 'display: block' for admin items so flexbox stays intact */
    body.is-admin .nav-links li.admin-only {
        display: flex !important;
    }
    
    .nav-links a {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 4px;
        padding: 8px 4px;
        font-size: 10px;
        font-weight: 600;
        text-align: center;
        background: transparent !important;
        box-shadow: none !important;
        color: var(--text-muted);
        width: 100%;
        line-height: 1.1;
        white-space: nowrap;
    }
    
    .nav-links a i {
        font-size: 20px;
        margin-bottom: 2px;
    }
    
    .nav-links a.active {
        color: var(--feu-gold);
    }
    
    .nav-links a.active i {
        transform: translateY(-2px);
        text-shadow: 0 0 10px rgba(253, 185, 19, 0.5);
    }
    
    /* Admin Login as Bottom Nav Item */
    .admin-toggle {
        display: flex;
        align-items: stretch;
        justify-content: center;
        flex: 0 0 75px; /* Fixed tap target size */
        margin: 0;
        padding: 0;
        border-left: 1px solid rgba(255,255,255,0.05); /* Clean separator line */
    }
    
    .admin-toggle button {
        background: transparent !important;
        border: none !important;
        color: var(--text-muted);
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 4px;
        padding: 8px 2px;
        font-size: 9px;
        font-weight: 600;
        text-align: center;
        box-shadow: none !important;
        width: 100%;
        line-height: 1.1;
        white-space: nowrap;
    }
    
    .admin-toggle button i {
        font-size: 20px;
        margin-bottom: 2px;
    }
    
    /* Content Adjustments */
    .content-area {
        padding: 16px 12px;
        overflow-y: visible;
    }
    
    .top-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        margin-top: 0; /* Removed top margin since admin button moved */
        margin-bottom: 24px;
    }
    
    .top-bar h1 {
        font-size: 28px;
    }
    
    .sport-selector {
        width: 100%;
    }
    
    .sport-selector select {
        width: 100%;
        font-size: 14px;
        padding: 10px 16px;
    }
    
    .glass-card {
        padding: 16px;
        border-radius: 12px;
    }
    
    /* Table scrolling */
    .standings-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
    
    /* Sleek Mobile Match Rows */
    .match-row {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
        background: rgba(0,0,0,0.3);
        padding: 16px;
        border-radius: 12px;
        border: 1px solid rgba(255,255,255,0.03);
    }
    
    .match-row > div {
        justify-content: space-between !important;
    }
    
    .match-team {
        font-size: 16px;
    }
    
    .match-team.right {
        text-align: right;
    }
    
    .match-score-display {
        font-size: 20px;
    }
    
    .match-row input {
        width: 60px;
        font-size: 16px;
        padding: 8px;
    }
    
    .match-row button {
        margin-left: 0 !important;
        margin-top: 4px;
        width: 100% !important;
        padding: 12px;
    }
}
