/* ================================================
   eFootball League - Global Styles
   Dark Theme with Blue Accent
   ================================================ */

/* ===== CSS Variables ===== */
:root {
    --bg-primary: #0a0a14;
    --bg-secondary: #0f0f1e;
    --bg-card: rgba(20, 20, 40, 0.85);
    --bg-card-hover: rgba(30, 30, 55, 0.9);
    --border-color: rgba(255, 255, 255, 0.08);
    --accent-blue: #0d47a1;
    --accent-blue-light: #1976d2;
    --accent-cyan: #00b4ff;
    --accent-gold: #ffc832;
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.55);
    --text-muted: rgba(255, 255, 255, 0.3);
    --success: #4caf50;
    --danger: #ef5350;
    --warning: #ffc107;
}

/* ===== Base ===== */
body {
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    min-height: 100vh;
}

/* ===== Glass Card ===== */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    transition: all 0.3s ease;
}
.glass-card:hover {
    border-color: rgba(255, 255, 255, 0.12);
}

/* ===== Stat Cards ===== */
.stat-card {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}
.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: 16px 16px 0 0;
}
.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
}
.stat-blue::before { background: linear-gradient(90deg, var(--accent-blue), var(--accent-cyan)); }
.stat-green::before { background: linear-gradient(90deg, #2e7d32, #66bb6a); }
.stat-orange::before { background: linear-gradient(90deg, #e65100, #ffa726); }
.stat-purple::before { background: linear-gradient(90deg, #6a1b9a, #ab47bc); }

.stat-icon {
    font-size: 1.8rem;
    margin-bottom: 8px;
    opacity: 0.8;
}
.stat-blue .stat-icon { color: var(--accent-cyan); }
.stat-green .stat-icon { color: #66bb6a; }
.stat-orange .stat-icon { color: #ffa726; }
.stat-purple .stat-icon { color: #ab47bc; }

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -1px;
}
.stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 4px;
}

/* ===== Match Card ===== */
.match-card {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
    transition: all 0.3s ease;
    height: 100%;
}
.match-card:hover {
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}
.match-played {
    border-left: 3px solid var(--success);
}
.match-partial {
    border-left: 3px solid var(--warning);
}
.match-scheduled {
    border-left: 3px solid var(--accent-cyan);
}

.match-team-name {
    font-size: 0.85rem;
    transition: color 0.2s;
}
.match-winner {
    color: var(--accent-gold) !important;
}
.match-loser {
    color: var(--text-secondary) !important;
}

.score-input {
    width: 60px !important;
    text-align: center;
    font-size: 1.3rem;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.05) !important;
    border: 2px solid rgba(255, 255, 255, 0.1) !important;
    color: #fff !important;
    border-radius: 10px !important;
    padding: 6px !important;
    transition: all 0.3s;
}
.score-input:focus {
    border-color: var(--accent-blue) !important;
    box-shadow: 0 0 0 3px rgba(13, 71, 161, 0.3) !important;
}
/* Hide number input arrows */
.score-input::-webkit-outer-spin-button,
.score-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.score-input[type=number] {
    -moz-appearance: textfield;
}

/* ===== Admin Layout ===== */
.admin-body {
    overflow-x: hidden;
}

.admin-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 250px;
    height: 100vh;
    background: linear-gradient(180deg, #0c0c20 0%, #0a0a18 100%);
    border-right: 1px solid var(--border-color);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
}

.sidebar-brand {
    padding: 25px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border-color);
}
.sidebar-brand span {
    font-weight: 800;
    font-size: 1rem;
    line-height: 1.3;
}

.sidebar-nav .nav-link {
    color: var(--text-secondary);
    padding: 12px 20px;
    border-radius: 0;
    transition: all 0.2s;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 10px;
    border-left: 3px solid transparent;
}
.sidebar-nav .nav-link:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.03);
}
.sidebar-nav .nav-link.active {
    color: var(--accent-cyan);
    background: rgba(0, 180, 255, 0.08);
    border-left-color: var(--accent-cyan);
}
.sidebar-nav .nav-link i {
    font-size: 1.1rem;
    width: 22px;
    text-align: center;
}

.sidebar-footer {
    margin-top: auto;
    padding: 15px 20px;
    border-top: 1px solid var(--border-color);
}

.admin-main {
    margin-left: 250px;
    min-height: 100vh;
    transition: margin-left 0.3s ease;
}

.admin-topbar {
    background: rgba(10, 10, 20, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    padding: 15px 24px;
    position: sticky;
    top: 0;
    z-index: 500;
}

.admin-content {
    padding-top: 10px;
}

/* ===== Standings Table ===== */
.standings-table {
    font-size: 0.9rem;
}
.standings-table thead {
    background: rgba(13, 71, 161, 0.2);
}
.standings-table thead th {
    border-bottom: 2px solid var(--accent-blue);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    padding: 12px 8px;
}
.standings-table tbody td {
    padding: 14px 8px;
    vertical-align: middle;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.standings-row {
    transition: all 0.2s;
}
.standings-row:hover {
    background: rgba(255, 255, 255, 0.03) !important;
}
.standings-row.top-three {
    background: rgba(255, 200, 50, 0.03);
}
.standings-row.top-three td:first-child {
    border-left: 3px solid var(--accent-gold);
}

/* ===== Form Styles ===== */
.form-control, .form-select {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    border-radius: 10px;
    padding: 10px 14px;
    transition: all 0.3s;
}
.form-control:focus, .form-select:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(13, 71, 161, 0.15);
    color: #fff;
}
.form-control::placeholder {
    color: var(--text-muted);
}
textarea.form-control {
    resize: vertical;
}

/* ===== Buttons ===== */
.btn-primary {
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-blue-light));
    border: none;
    border-radius: 10px;
    padding: 10px 20px;
    font-weight: 600;
    transition: all 0.3s;
}
.btn-primary:hover {
    background: linear-gradient(135deg, var(--accent-blue-light), #1e88e5);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(13, 71, 161, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, #2e7d32, #43a047);
    border: none;
    border-radius: 10px;
    font-weight: 600;
}
.btn-success:hover {
    background: linear-gradient(135deg, #43a047, #66bb6a);
    transform: translateY(-1px);
}

.btn-warning {
    background: linear-gradient(135deg, #e65100, #ff8f00);
    border: none;
    border-radius: 10px;
    font-weight: 600;
}
.btn-warning:hover {
    background: linear-gradient(135deg, #ff8f00, #ffa726);
    transform: translateY(-1px);
}

.btn-outline-light, .btn-outline-secondary, .btn-outline-danger, .btn-outline-info {
    border-radius: 10px;
    border-width: 1.5px;
}

/* ===== Alert Override ===== */
.alert {
    border-radius: 10px;
    border: none;
    font-size: 0.9rem;
}

/* ===== Badge ===== */
.badge-home {
    background: rgba(13, 71, 161, 0.4) !important;
    border: 1px solid rgba(13, 71, 161, 0.6);
}
.badge-away {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ===== Responsive ===== */
@media (max-width: 767.98px) {
    .admin-sidebar {
        transform: translateX(-100%);
        width: 280px;
    }
    .admin-sidebar.show {
        transform: translateX(0);
    }
    .admin-main {
        margin-left: 0;
    }
    .stat-value {
        font-size: 1.5rem;
    }
    .score-input {
        width: 48px !important;
        font-size: 1.1rem;
        padding: 4px !important;
    }
    .match-team-name {
        font-size: 0.75rem;
    }
    .sidebar-footer {
        padding-bottom: 30px;
    }
}

/* ===== Animations ===== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.glass-card, .stat-card, .match-card {
    animation: fadeIn 0.3s ease-out;
}

/* ===== Frontend Specific ===== */
.front-bg {
    min-height: 100vh;
    background: var(--bg-primary);
    position: relative;
    overflow-x: hidden;
}
.front-bg::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background:
        radial-gradient(ellipse at 15% 30%, rgba(13, 71, 161, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 85% 70%, rgba(0, 180, 255, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(255, 200, 50, 0.03) 0%, transparent 60%);
    animation: bgDrift 25s ease-in-out infinite alternate;
    z-index: 0;
}
@keyframes bgDrift {
    0% { transform: translate(0, 0) rotate(0deg); }
    100% { transform: translate(-3%, -2%) rotate(2deg); }
}

.front-content {
    position: relative;
    z-index: 1;
}

.front-hero {
    padding: 60px 0 40px;
    text-align: center;
}

.front-title {
    font-size: 3rem;
    font-weight: 900;
    letter-spacing: -1px;
    line-height: 1;
    margin-bottom: 10px;
}
.front-title .efootball {
    background: linear-gradient(135deg, var(--accent-cyan), #4fc3f7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.front-title .league {
    background: linear-gradient(135deg, var(--accent-gold), #ffeb3b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.front-subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
    letter-spacing: 3px;
    text-transform: uppercase;
}

.front-card {
    background: var(--bg-card);
    backdrop-filter: blur(15px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

/* ===== Scrollable Standings Container ===== */
.standings-scroll {
    max-height: 600px;
    overflow-y: auto;
    overflow-x: auto;
}

.front-table {
    font-size: 0.85rem;
    margin: 0;
}
.front-table thead {
    background: rgba(13, 71, 161, 0.3);
    position: sticky;
    top: 0;
    z-index: 10;
}
.front-table thead th {
    padding: 14px 10px;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: rgba(255, 255, 255, 0.7);
    border-bottom: 2px solid var(--accent-blue);
    white-space: nowrap;
}
.front-table tbody td {
    padding: 12px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    vertical-align: middle;
    color: rgba(255, 255, 255, 0.8);
}
.front-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}
.front-table .team-name {
    font-weight: 700;
    font-size: 0.88rem;
    color: #fff;
}
.front-table .pts {
    font-weight: 800;
    font-size: 1rem;
    color: var(--accent-gold);
}

/* Position badges */
.pos-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.8rem;
}
.pos-1 { background: rgba(255, 200, 50, 0.2); color: #ffc832; }
.pos-2 { background: rgba(192, 192, 192, 0.15); color: #c0c0c0; }
.pos-3 { background: rgba(205, 127, 50, 0.15); color: #cd7f32; }
.pos-default { background: rgba(255, 255, 255, 0.05); color: rgba(255, 255, 255, 0.5); }

/* Footer */
.front-footer {
    text-align: center;
    padding: 30px 0;
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* ===== Matchday results on frontend ===== */
.matchday-results {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 16px;
}
.matchday-title {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent-cyan);
    font-weight: 600;
    margin-bottom: 15px;
}

/* Grouped result pair (2 legs) */
.result-pair {
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.result-pair:last-child {
    border-bottom: none;
}

.result-leg {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 4px 0;
    gap: 12px;
}
.result-team {
    font-weight: 600;
    font-size: 0.82rem;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
}
.result-team.text-end {
    text-align: right;
}
.result-score {
    font-weight: 800;
    font-size: 0.9rem;
    color: var(--accent-gold);
    min-width: 55px;
    text-align: center;
    flex-shrink: 0;
}
.result-winner {
    color: #fff !important;
}
.result-loser {
    color: rgba(255, 255, 255, 0.45) !important;
}

/* Tab navigation */
.nav-tabs {
    border-bottom: 1px solid var(--border-color);
}
.nav-tabs .nav-link {
    color: var(--text-secondary);
    border: none;
    padding: 10px 20px;
    border-radius: 10px 10px 0 0;
    transition: all 0.2s;
}
.nav-tabs .nav-link:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.03);
}
.nav-tabs .nav-link.active {
    color: var(--accent-cyan);
    background: rgba(0, 180, 255, 0.08);
    border-bottom: 2px solid var(--accent-cyan);
}

/* ===== Responsive Frontend ===== */
@media (max-width: 575.98px) {
    .front-title {
        font-size: 2.2rem;
    }
    .front-hero {
        padding: 40px 0 30px;
    }
    .result-team {
        font-size: 0.72rem;
    }
    .result-score {
        font-size: 0.82rem;
        min-width: 45px;
    }
    .standings-scroll {
        max-height: 450px;
    }
    .front-table thead th {
        padding: 10px 6px;
        font-size: 0.68rem;
    }
    .front-table tbody td {
        padding: 10px 6px;
        font-size: 0.78rem;
    }
    .front-table .team-name {
        font-size: 0.78rem;
    }
    .pos-badge {
        width: 24px;
        height: 24px;
        font-size: 0.7rem;
    }
}
