/* css/style.css */
:root {
    --bg-main: #0B0E14;
    --bg-card: #151A22;
    --text-main: #E2E8F0;
    --text-muted: #94A3B8;
    --accent-color: #00FF87; /* Neon green/gold hybrid vibe */
    --accent-glow: rgba(0, 255, 135, 0.3);
    --border-color: #1E293B;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: 'Outfit', sans-serif;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.football-loader {
    position: fixed;
    left: 1.25rem;
    bottom: 1.25rem;
    z-index: 2000;
}

.football-ball {
    appearance: none;
    border: 0;
    background: transparent;
    padding: 0;
    cursor: pointer;
    font-size: 5rem;
    line-height: 1;
    filter: drop-shadow(0 10px 14px rgba(0, 0, 0, 0.45));
    transform-origin: 50% 70%;
    transition: transform 160ms ease, filter 160ms ease;
}

.football-ball:hover,
.football-ball:focus-visible {
    filter: drop-shadow(0 14px 18px rgba(0, 0, 0, 0.55));
    transform: translateY(-4px) scale(1.04);
}

.football-ball:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 0.4rem;
    border-radius: 999px;
}

.football-ball.is-kicked {
    animation: football-kick 900ms cubic-bezier(0.15, 0.72, 0.28, 1) both;
}

@keyframes football-kick {
    0% { transform: translate(0, 0) rotate(0deg) scale(1); }
    22% { transform: translate(90px, -70px) rotate(160deg) scale(1.04); }
    48% { transform: translate(180px, -18px) rotate(330deg) scale(0.98); }
    72% { transform: translate(120px, -42px) rotate(500deg) scale(1.02); }
    100% { transform: translate(0, 0) rotate(720deg) scale(1); }
}

@media (max-width: 767.98px) {
    .football-loader {
        display: none;
    }
}

/* Ensure headings and general text default to light */
h1, h2, h3, h4, h5, h6, .text-muted {
    color: var(--text-main) !important;
}
.text-muted {
    color: var(--text-muted) !important;
}

/* Navbar */
.premium-nav {
    background-color: rgba(11, 14, 20, 0.8) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
}
.text-accent {
    color: var(--accent-color) !important;
}
.navbar .btn.nav-link {
    border: 0;
    text-decoration: none;
}

/* Hero */
.hero-section {
    padding: 6rem 0 3rem;
    background: radial-gradient(circle at top, #111A2C 0%, var(--bg-main) 100%);
    border-bottom: 1px solid var(--border-color);
}

/* Cards */
.premium-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.premium-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.4);
}
.bg-accent {
    background-color: var(--accent-color) !important;
}

/* Table */
.table {
    --bs-table-color: var(--text-main);
    --bs-table-bg: transparent;
    --bs-table-hover-color: var(--text-main);
    --bs-table-hover-bg: rgba(255, 255, 255, 0.03);
}
.custom-table {
    color: var(--text-main);
}
.custom-table thead {
    background-color: #1E293B !important;
    color: #cbd5e1 !important;
}
.custom-table th {
    border-bottom: 2px solid var(--border-color);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    padding-top: 1rem;
    padding-bottom: 1rem;
}
.custom-table td {
    border-bottom: 1px solid var(--border-color);
    padding-top: 1rem;
    padding-bottom: 1rem;
}
.custom-table tbody tr:hover {
    background-color: rgba(255,255,255,0.03);
}

/* Match Cards */
.match-card {
    background: #1E293B;
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
}
.match-time {
    font-size: 0.8rem;
    color: var(--accent-color);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}
.team-name {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-main);
}
.team-block {
    min-width: 0;
}
.team-flag {
    width: 30px;
    height: auto;
    object-fit: contain;
    margin: 0 10px;
}
.hero-match-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(204, 255, 0, 0.2);
    border-radius: var(--border-radius);
    padding: 2rem;
    max-width: 700px;
    margin: 0 auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}
.hero-match-card .team-name {
    font-size: 1.8rem;
    font-weight: 800;
}
.hero-match-card .hero-team {
    flex: 1 1 0;
    min-width: 0;
    flex-direction: column;
    gap: 0.5rem;
}
.hero-match-card .match-score {
    font-size: 3rem;
    color: var(--accent-color);
    flex: 0 0 auto;
}
.hero-match-card .team-flag {
    width: 72px;
    max-height: 72px;
    margin: 0;
}
.match-team-block {
    display: grid;
    justify-items: center;
    gap: 0.35rem;
    min-width: 0;
    text-align: center;
    flex: 1 1 0;
}
.match-team-block .team-flag {
    width: 42px;
    max-height: 42px;
    margin: 0;
}
.match-team-block .team-name {
    line-height: 1.15;
    overflow-wrap: anywhere;
}
.match-score {
    font-size: 1.5rem;
    font-weight: 800;
    background: -webkit-linear-gradient(#fff, #cbd5e1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Badges */
.badge-active {
    background: rgba(0, 255, 135, 0.1);
    color: var(--accent-color);
    border: 1px solid var(--accent-color);
}

.modal-content.premium-card {
    color: var(--text-main);
}

.scoring-rules-list .badge {
    min-width: 64px;
}

.allocation-group {
    border-top: 1px solid var(--border-color);
    padding: 1rem 0;
}

.allocation-group:last-child {
    border-bottom: 1px solid var(--border-color);
}

.allocation-team-list {
    display: grid;
    gap: 0.75rem;
}

.allocation-team-row {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) auto;
    gap: 0.75rem;
    align-items: center;
}

.assigned-match-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1rem;
    padding: 1rem;
}

.assigned-match-row {
    display: grid;
    gap: 1rem;
    padding: 1rem;
    background: #1E293B;
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.assigned-match-row:last-child {
    border-bottom: 1px solid var(--border-color);
}

.assigned-match-meta {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
}

.assigned-match-date {
    color: var(--text-main);
}

.assigned-match-teams {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 0.75rem;
}

.assigned-team {
    display: grid;
    gap: 0.25rem;
    justify-items: center;
    min-width: 0;
}

.assigned-team-home {
    text-align: center;
}

.assigned-team-away {
    text-align: center;
}

.assigned-team-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.assigned-team-home .assigned-team-main {
    justify-content: center;
}

.assigned-team-away .assigned-team-main {
    justify-content: center;
}

.assigned-team-main .team-flag {
    width: 54px;
    max-height: 54px;
    margin: 0;
}

.assigned-team-main .team-name {
    font-size: 1rem;
    line-height: 1.15;
    text-align: center;
    overflow-wrap: anywhere;
}

.assigned-owner {
    color: var(--accent-color);
    font-weight: 600;
    display: block;
}

.assigned-score {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-main);
    white-space: nowrap;
}

.participant-versus {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 0.75rem;
    padding-top: 0.85rem;
    border-top: 1px solid var(--border-color);
    color: var(--accent-color);
    font-weight: 700;
    text-align: center;
}

.participant-versus span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.participant-versus strong {
    color: var(--text-main);
    font-size: 0.75rem;
    letter-spacing: 0.08em;
}

.hero-versus {
    max-width: 520px;
    margin: 0 auto 1rem;
}

.match-versus {
    margin-top: 0.85rem;
    padding-top: 0.75rem;
    font-size: 0.9rem;
}

@media (max-width: 576px) {
    .allocation-team-row {
        grid-template-columns: 1fr;
    }

    .allocation-actions {
        justify-content: flex-end;
    }

    .assigned-match-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .assigned-match-meta {
        display: grid;
        justify-content: stretch;
        text-align: center;
    }

    .assigned-match-teams {
        grid-template-columns: 1fr;
        justify-items: center;
        gap: 0.75rem;
    }

    .assigned-team,
    .assigned-team-home,
    .assigned-team-away {
        text-align: center;
    }

    .assigned-team-home .assigned-team-main,
    .assigned-team-away .assigned-team-main {
        justify-content: center;
    }
}

/* Animation */
@keyframes flash {
    0% { background-color: rgba(0, 255, 135, 0.3); }
    100% { background-color: transparent; }
}
.row-updated {
    animation: flash 1.5s ease-out;
}

@media (max-width: 576px) {
    .hero-section {
        padding: 3rem 0 2rem;
    }

    .hero-match-card {
        padding: 1.25rem;
    }

    .hero-match-teams {
        flex-direction: column;
        gap: 0.75rem;
    }

    .hero-match-card .hero-team {
        width: 100%;
        justify-content: center !important;
    }

    .hero-match-card .team-name {
        max-width: 100%;
        font-size: 1.35rem;
        text-align: center !important;
    }

    .hero-match-card .team-block {
        text-align: center !important;
    }

    .hero-match-card .team-flag {
        width: 56px;
    }

    .hero-match-card .match-score {
        font-size: 2.6rem;
        line-height: 1;
        padding: 0 !important;
    }
}
