* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ---------- GLOBAL ---------- */

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #0f172a; /* mørk baggrund, men mere rolig */
    color: #111827;
    min-height: 100vh;
}

/* ---------- NAVBAR ---------- */

.navbar {
    background: #020617 !important;
    padding: 0.9rem 0;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
}

.navbar-brand {
    font-size: 1.35rem;
    font-weight: 600;
    letter-spacing: 0.04em;
}

.navbar-text {
    font-size: 0.9rem;
}

#league-selector {
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.7);
    background: rgba(15, 23, 42, 0.7);
    color: #e5e7eb;
    padding: 6px 10px;
    font-size: 0.85rem;
}

#league-selector:focus {
    outline: none;
    border-color: #6366f1;
}

/* ---------- LAYOUT ---------- */

.main-container {
    max-width: 1320px;
    margin: 0 auto;
    padding: 2.25rem 1.25rem 4.5rem;
}

/* ---------- DATE SELECTOR ---------- */

.date-selector-container {
    background: #0b1220;
    border-radius: 18px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.75rem;
    box-shadow: 0 16px 45px rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.date-selector {
    display: flex;
    gap: 1rem;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

.date-selector input[type="date"] {
    max-width: 220px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.6);
    background: rgba(15, 23, 42, 0.85);
    color: #e5e7eb;
    padding: 0.5rem 0.9rem;
    font-size: 0.9rem;
}

.date-selector input[type="date"]:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.6);
}

.btn-outline-primary {
    border-radius: 999px;
    border-width: 1px;
    border-color: rgba(129, 140, 248, 0.9);
    color: #e5e7eb;
    background: transparent;
    padding: 0.45rem 1.2rem;
    font-size: 0.9rem;
}

.btn-outline-primary:hover {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    border-color: transparent;
}

/* ---------- MATCH GRID & CARDS ---------- */

.matches-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.match-card {
    background: #020617;
    border-radius: 16px;
    padding: 1.4rem 1.4rem 1.1rem;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.75);
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
    cursor: pointer;
    border: 1px solid rgba(148, 163, 184, 0.18);
}

.match-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 55px rgba(0, 0, 0, 0.9);
    border-color: rgba(129, 140, 248, 0.6);
}

.match-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.match-header .badge {
    border-radius: 999px;
    font-weight: 500;
    padding: 0.3rem 0.75rem;
    font-size: 0.8rem;
}

.match-status {
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.match-status.finished {
    background-color: rgba(16, 185, 129, 0.16);
    color: #6ee7b7;
    border: 1px solid rgba(16, 185, 129, 0.7);
}

.match-status.live {
    background-color: rgba(248, 113, 113, 0.16);
    color: #fecaca;
    border: 1px solid rgba(220, 38, 38, 0.85);
    animation: pulse 1.6s infinite;
}

.match-status.scheduled {
    background-color: rgba(148, 163, 184, 0.16);
    color: #e5e7eb;
    border: 1px solid rgba(148, 163, 184, 0.7);
}

@keyframes pulse {
    0%, 100% { transform: translateY(0); box-shadow: 0 0 0 0 rgba(248, 113, 113, 0.2); }
    50% { transform: translateY(-1px); box-shadow: 0 0 0 6px rgba(248, 113, 113, 0); }
}

.match-teams {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.2rem;
    margin: 1.3rem 0 1rem;
}

.team {
    flex: 1;
    text-align: center;
}

.team-logo {
    width: 54px;
    height: 54px;
    object-fit: contain;
    margin-bottom: 0.4rem;
    filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.7));
}

.team-logo-small {
    width: 46px;
    height: 46px;
    object-fit: contain;
}

.team-name {
    font-weight: 500;
    font-size: 0.95rem;
    color: #e5e7eb;
    margin-bottom: 0.25rem;
}

.team-score {
    font-size: 1.9rem;
    font-weight: 700;
    color: #a5b4fc;
}

.match-vs {
    font-weight: 600;
    color: #6b7280;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.match-footer {
    text-align: center;
    padding-top: 0.7rem;
    border-top: 1px solid rgba(31, 41, 55, 0.9);
    color: #9ca3af;
    font-size: 0.8rem;
}

/* ---------- EMPTY / ERROR STATES ---------- */

.no-matches,
.error-message {
    text-align: center;
    padding: 2.5rem 1rem;
    background: #020617;
    border-radius: 16px;
    grid-column: 1 / -1;
    border: 1px solid rgba(148, 163, 184, 0.2);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.8);
}

.no-matches i,
.error-message i {
    font-size: 3.5rem;
    color: #4b5563;
    margin-bottom: 1rem;
}

.no-matches h3,
.error-message h3 {
    color: #e5e7eb;
    margin-bottom: 0.35rem;
    font-size: 1.1rem;
}

.no-matches p,
.error-message p {
    color: #9ca3af;
    font-size: 0.9rem;
}

/* ---------- MODAL / MATCH DETAILS ---------- */

.modal-content {
    border-radius: 18px;
    border: none;
    background: #020617;
    color: #e5e7eb;
    box-shadow: 0 26px 80px rgba(0, 0, 0, 0.9);
}

.modal-header {
    border-bottom: 1px solid rgba(31, 41, 55, 0.9);
}

.modal-body {
    background: radial-gradient(circle at top left, #111827 0, #020617 50%, #020617 100%);
    border-radius: 0 0 18px 18px;
}

/* Match header */

.match-details-header {
    text-align: center;
    padding: 1.75rem 0 1.5rem;
    border-bottom: 1px solid rgba(31, 41, 55, 0.9);
    margin-bottom: 1.8rem;
}

.match-details-header h2 {
    font-size: 1.7rem;
    font-weight: 650;
    color: #e5e7eb;
}

/* AI summary */

.ai-summary {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: white;
    padding: 1.25rem 1.4rem;
    border-radius: 14px;
    margin-bottom: 1.8rem;
    font-size: 0.95rem;
    box-shadow: 0 16px 45px rgba(55, 48, 163, 0.8);
}

.ai-summary h5 {
    margin-bottom: 0.75rem;
    font-weight: 600;
}

/* ---------- STATISTICS ---------- */

.statistics-grid {
    display: grid;
    gap: 1.1rem;
}

.stat-item {
    background: rgba(15, 23, 42, 0.9);
    padding: 1.2rem 1.3rem;
    border-radius: 14px;
    border: 1px solid rgba(31, 41, 55, 0.9);
}

.stat-item-percent {
    background: rgba(15, 23, 42, 0.9);
    border-radius: 14px;
    border: 1px solid rgba(31, 41, 55, 0.9);
    padding: 1.1rem 1.3rem 1.3rem;
}

.stat-header {
    text-align: center;
    font-weight: 600;
    color: #9ca3af;
    margin-bottom: 0.85rem;
    font-size: 0.95rem;
}

.stat-values {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 1rem;
}

.stat-percentages {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.35rem;
    font-weight: 600;
    width: 100%;
}

.home-stat,
.away-stat {
    font-size: 1.2rem;
    font-weight: 650;
    color: #a5b4fc;
}

.home-stat {
    text-align: left;
}

.away-stat {
    text-align: right;
}

.stat-label {
    text-align: center;
    color: #6b7280;
    font-size: 0.8rem;
}

.stat-bar {
    display: flex;
    height: 22px;
    background: #111827;
    border-radius: 999px;
    overflow: hidden;
    grid-column: 1 / -1;
    margin-top: 0.35rem;
}

.stat-bar-fill {
    height: 100%;
    transition: width 0.4s ease;
}

.stat-bar-fill.home {
    background: linear-gradient(90deg, #6366f1 0%, #818cf8 100%);
}

.stat-bar-fill.away {
    background: linear-gradient(90deg, #f97373 0%, #fb7185 100%);
}

/* Stat groups */

.stat-group-wrapper.attacking-group,
.stat-group-wrapper.defensive-group,
.stat-group-wrapper.discipline-group {
    margin-top: 0.8rem;
    padding: 0.85rem 0.8rem 0.4rem;
    border-radius: 16px;
    border: 1px solid rgba(31, 41, 55, 0.9);
    background: radial-gradient(circle at top left, rgba(30, 64, 175, 0.18), rgba(15, 23, 42, 0.96));
}

.stat-group-title {
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    margin-bottom: 0.6rem;
    color: #9ca3af;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}


.stat-percentages {
    display: flex;
    justify-content: space-around;
    margin-bottom: 5px; /* giver lidt luft mellem procenter og bar */
    font-weight: bold;
    box-sizing: border-box;
    width: 1030px;
}



/* ---------- PLAYER PERFORMANCE ---------- */

.player-performance-header {
    text-align: center;
    padding: 1.25rem 0 1rem;
    border-bottom: 1px solid rgba(31, 41, 55, 0.9);
    margin-bottom: 1.2rem;
}

.player-performance-header h4 {
    font-size: 1.2rem;
    font-weight: 600;
}

.player-performance-header p {
    margin-top: 0.4rem;
    font-size: 0.78rem;
    color: #9ca3af;
}

.players-list {
    display: grid;
    gap: 0.9rem;
}

.player-card {
    display: flex;
    gap: 1rem;
    background: rgba(15, 23, 42, 0.95);
    padding: 1.05rem 1.1rem;
    border-radius: 14px;
    border: 1px solid rgba(31, 41, 55, 0.9);
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.player-card:hover {
    background: rgba(15, 23, 42, 1);
    transform: translateX(4px);
    border-color: rgba(129, 140, 248, 0.7);
}

.player-rank {
    font-size: 1.45rem;
    font-weight: 700;
    color: #a5b4fc;
    min-width: 44px;
}

.player-info {
    flex: 1;
}

.player-name {
    font-size: 1rem;
    font-weight: 600;
    color: #e5e7eb;
    margin-bottom: 0.4rem;
}

.player-details {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    margin-bottom: 0.25rem;
}

.player-details .badge {
    font-size: 0.75rem;
    border-radius: 999px;
    padding: 0.3rem 0.6rem;
}

.player-analysis {
    color: #9ca3af;
    font-style: italic;
    margin-top: 0.3rem;
    line-height: 1.4;
    font-size: 0.9rem;
}

/* ---------- PREVIEW / UPCOMING MATCH ---------- */

.match-preview-section {
    padding: 0.75rem 0 0.25rem;
}

.preview-card {
    background: rgba(15, 23, 42, 0.95);
    padding: 1.2rem 1.25rem;
    border-radius: 14px;
    margin-bottom: 0.9rem;
    text-align: center;
    border: 1px solid rgba(31, 41, 55, 0.9);
}

.preview-card h5 {
    font-weight: 600;
    color: #e5e7eb;
    margin-bottom: 0.7rem;
    font-size: 0.95rem;
}

.preview-card p {
    margin: 0;
    color: #9ca3af;
    font-size: 0.9rem;
}

.preview-card .badge {
    font-size: 0.78rem;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
}

.form-badges .badge {
    font-size: 0.75rem;
    padding: 0.3rem 0.55rem;
}

.preview-card .row .col-md-6 {
    padding: 0.8rem;
}

.preview-card .border-start {
    border-left: 1px solid rgba(31, 41, 55, 0.9) !important;
}

.preview-card h6 {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.preview-card .text-primary {
    color: #a5b4fc !important;
}

.preview-card .text-danger {
    color: #fb7185 !important;
}

/* ---------- LOADING ---------- */

#loading-spinner p {
    color: #9ca3af;
}

/* ---------- FOOTER ---------- */

.footer {
    width: 100%;
    left: 0;
    bottom: 0;
    background: #020617 !important;
    color: #9ca3af;
    margin-top: 4rem;
    height: 55px;
    border-top: 1px solid rgba(31, 41, 55, 0.9);
    position: fixed;
}

/* ---------- RESPONSIVE ---------- */

@media (max-width: 768px) {
    .matches-grid {
        grid-template-columns: 1fr;
    }

    .date-selector {
        flex-direction: column;
    }

    .date-selector input[type="date"] {
        max-width: 100%;
    }

    .team-logo {
        width: 46px;
        height: 46px;
    }

    .team-score {
        font-size: 1.5rem;
    }

    .match-card {
        padding: 1.2rem 1.1rem 1rem;
    }

    .statistics-grid {
        gap: 0.8rem;
    }

    .stat-item,
    .stat-item-percent {
        padding: 0.9rem 0.8rem;
    }

    .player-card {
        flex-direction: row;
    }

    .match-details-header h2 {
        font-size: 1.3rem;
    }

    .modal-dialog {
        margin: 0.7rem;
    }

    .league_selector{
        padding: 5px;
    }
}
