@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@700;800&family=Inter:wght@400;500;600;700&display=swap');

:root {
    --theme-primary: #305d9e;
    --theme-secondary: #1792e1;
    --theme-bg: #f2f7fc;
    --theme-card: #ffffff;
    --theme-text: #000000;
    --theme-accent: #fd6721;
    --theme-danger: #e74c3c;
    --theme-success: #27ae60;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--theme-bg);
    color: var(--theme-text);
    margin: 0;
    font-size: 16px;
    padding-top: 80px;
    /* Increased space for fixed header to prevent overlap */
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    color: var(--theme-primary);
}

/* Navigation is now handled by menu_style.css */
.app-header {
    font-family: 'Montserrat', sans-serif;
}

/* --- LOGIN OVERLAY --- */
#login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #f4f7f6;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.login-box {
    width: 100%;
    max-width: 350px;
    text-align: center;
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.login-box input {
    width: 100%;
    padding: 12px;
    margin: 10px 0;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 16px;
}

.login-box button {
    width: 100%;
    padding: 12px;
    background: var(--theme-accent);
    color: white;
    border: none;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 10px;
}

/* --- APP LAYOUT --- */
.main-content {
    padding: 15px;
    max-width: 900px;
    margin: 0 auto;
}

#loading-msg {
    text-align: center;
    padding: 40px;
    font-weight: bold;
    color: var(--theme-primary);
}

select,
button.ui-btn {
    padding: 12px;
    border-radius: 6px;
    border: 1px solid #ccc;
    margin: 5px 0;
    width: 100%;
    font-size: 1rem;
}

.details-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
}

.score-box {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    font-size: 2.5rem;
    font-weight: 800;
    margin: 15px 0;
}

/* --- FORMATION SELECTOR (NIEUW) --- */
.formation-selector-container {
    width: 100%;
    display: flex;
    /* Activeert flexbox */
    justify-content: center;
    /* Centreert de knoppen horizontaal */
    overflow-x: auto;
    padding-bottom: 15px;
    margin-bottom: 15px;
    -webkit-overflow-scrolling: touch;
}

.formation-buttons {
    display: flex;
    gap: 10px;
    white-space: nowrap;
    padding: 2px;
}

.form-btn {
    padding: 10px 22px;
    border-radius: 50px;
    /* Maakt de knoppen volledig ovaal/pill-shaped */
    border: 1px solid #ddd;
    background: white;
    color: #7f8c8d;
    /* Grijze tekst voor niet-geselecteerd */
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.form-btn.active {
    background-color: var(--theme-success);
    /* Groen uit afbeelding */
    color: white;
    /* Witte tekst */
    border-color: var(--theme-success);
}

.form-btn:hover:not(.active) {
    background-color: #f1f3f4;
    border-color: #ccc;
}

/* --- VELD STYLING --- */
.pitch-wrapper {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
}

.pitch-container {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    grid-template-rows: repeat(12, 1fr);
    gap: 5px;
    background-color: #43a047;
    border: 4px solid white;
    border-radius: 8px;
    position: relative;
    width: 100%;
    aspect-ratio: 3/4;
    margin: 0 auto;
    padding: 10px;
}

.field-line {
    position: absolute;
    pointer-events: none;
    border: 2px solid white;
    z-index: 1;
}

.center-line {
    top: 50%;
    left: 0;
    width: 100%;
    height: 0;
    transform: translateY(-50%);
}

.center-circle {
    top: 50%;
    left: 50%;
    width: 25%;
    padding-top: 25%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
}

.center-spot {
    top: 50%;
    left: 50%;
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
    position: absolute;
    transform: translate(-50%, -50%);
    z-index: 2;
}

.penalty-area-top {
    top: 0;
    left: 15%;
    width: 70%;
    height: 18%;
    border-top: none;
}

.penalty-area-bottom {
    bottom: 0;
    left: 15%;
    width: 70%;
    height: 18%;
    border-bottom: none;
}

.goal-area-top {
    top: 0;
    left: 30%;
    width: 40%;
    height: 7%;
    border-top: none;
}

.goal-area-bottom {
    bottom: 0;
    left: 30%;
    width: 40%;
    height: 7%;
    border-bottom: none;
}

.player-slot {
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    border-radius: 6px;
    text-align: center;
    z-index: 10;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
}

.player-select {
    width: 100%;
    font-size: 11px;
    border: none;
    background: transparent;
    font-weight: 700;
    text-align-last: center;
    appearance: none;
    cursor: pointer;
}

/* --- WISSELSPELERS --- */
.bench-section #bench-list {
    list-style: none;
    padding: 0;
    margin: 10px 0 0 0;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.bench-section #bench-list li {
    background: var(--theme-bg);
    padding: 10px;
    border-radius: 8px;
    font-size: 0.9em;
    text-align: center;
    font-weight: 600;
    border: 1px solid #ddd;
    color: var(--theme-text);
}

/* Hamburger Icoon Styling */
.hamburger-icon {
    width: 24px;
    height: 18px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    cursor: pointer;
    padding: 2px;
}

.hamburger-icon span {
    display: block;
    width: 100%;
    height: 2px;
    background-color: white;
    /* Kleur van de streepjes */
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* Optioneel: Hover effect */
#menu-trigger:hover .hamburger-icon span {
    background-color: #ecf0f1;
}

/* --- ACTIE KNOPPEN --- */
.save-btn {
    background: var(--theme-accent);
    color: white;
    border: none;
    padding: 18px;
    border-radius: 12px;
    font-weight: bold;
    width: 100%;
    margin-top: 10px;
    cursor: pointer;
    font-size: 1.1rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.btn-reset-lineup {
    background: transparent;
    color: var(--theme-danger);
    width: 100%;
    padding: 10px;
    border: 1px solid var(--theme-danger);
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
}

.btn-reset-lineup:hover {
    background: #fff5f5;
}

/* --- POSITIES (4-4-2 FLAT) --- */

#f-st-l {
    grid-row: 2;
    grid-column: 2;
}

#f-st-r {
    grid-row: 2;
    grid-column: 4;
}

#f-lm {
    grid-row: 5;
    grid-column: 1;
}

#f-rm {
    grid-row: 5;
    grid-column: 5;
}

#f-cm-l {
    grid-row: 7;
    grid-column: 2;
}

#f-cm-r {
    grid-row: 7;
    grid-column: 4;
}

#f-lb {
    grid-row: 9;
    grid-column: 1;
}

#f-rb {
    grid-row: 9;
    grid-column: 5;
}

#f-cb-l {
    grid-row: 10;
    grid-column: 2;
}

#f-cb-r {
    grid-row: 10;
    grid-column: 4;
}

#f-keeper-f {
    grid-row: 12;
    grid-column: 3;
}

/* --- POSITIES 4-3-3 --- */
#c3-st {
    grid-row: 2;
    grid-column: 3;
}

#c3-lw {
    grid-row: 3;
    grid-column: 1;
}

#c3-rw {
    grid-row: 3;
    grid-column: 5;
}

#c3-am-l {
    grid-row: 5;
    grid-column: 2;
}

#c3-am-r {
    grid-row: 5;
    grid-column: 4;
}

#c3-cm {
    grid-row: 7;
    grid-column: 3;
}

#c3-lb {
    grid-row: 9;
    grid-column: 1;
}

#c3-rb {
    grid-row: 9;
    grid-column: 5;
}

#c3-cb-l {
    grid-row: 10;
    grid-column: 2;
}

#c3-cb-r {
    grid-row: 10;
    grid-column: 4;
}

#c3-keeper {
    grid-row: 12;
    grid-column: 3;
}

/* --- POSITIES 4-4-2 RUIT --- */
#d-st-l {
    grid-row: 2;
    grid-column: 2;
}

#d-st-r {
    grid-row: 2;
    grid-column: 4;
}

#d-cam {
    grid-row: 4;
    grid-column: 3;
}

#d-cm-l {
    grid-row: 6;
    grid-column: 1;
}

#d-cm-r {
    grid-row: 6;
    grid-column: 5;
}

#d-cdm {
    grid-row: 8;
    grid-column: 3;
}

#d-lb {
    grid-row: 10;
    grid-column: 1;
}

#d-rb {
    grid-row: 10;
    grid-column: 5;
}

#d-cb-l {
    grid-row: 11;
    grid-column: 2;
}

#d-cb-r {
    grid-row: 11;
    grid-column: 4;
}

#d-keeper {
    grid-row: 12;
    grid-column: 3;
}

/* --- POSITIES 4-5-1 --- */
#c451-st {
    grid-row: 2;
    grid-column: 3;
}

#c451-lm {
    grid-row: 5;
    grid-column: 1;
}

#c451-cm-l {
    grid-row: 6;
    grid-column: 2;
}

#c451-cm {
    grid-row: 7;
    grid-column: 3;
}

#c451-cm-r {
    grid-row: 6;
    grid-column: 4;
}

#c451-rm {
    grid-row: 5;
    grid-column: 5;
}

#c451-lb {
    grid-row: 10;
    grid-column: 1;
}

#c451-rb {
    grid-row: 10;
    grid-column: 5;
}

#c451-cb-l {
    grid-row: 11;
    grid-column: 2;
}

#c451-cb-r {
    grid-row: 11;
    grid-column: 4;
}

#c451-keeper {
    grid-row: 12;
    grid-column: 3;
}

/* --- POSITIES 5-3-1-1 --- */
#c5311-st {
    grid-row: 2;
    grid-column: 3;
}

#c5311-cam {
    grid-row: 4;
    grid-column: 3;
}

#c5311-cm-l {
    grid-row: 6;
    grid-column: 2;
}

#c5311-cm {
    grid-row: 7;
    grid-column: 3;
}

#c5311-cm-r {
    grid-row: 6;
    grid-column: 4;
}

#c5311-lwb {
    grid-row: 8;
    grid-column: 1;
}

#c5311-rwb {
    grid-row: 8;
    grid-column: 5;
}

#c5311-cb-l {
    grid-row: 10;
    grid-column: 2;
}

#c5311-cb-m {
    grid-row: 11;
    grid-column: 3;
}

#c5311-cb-r {
    grid-row: 10;
    grid-column: 4;
}

#c5311-keeper {
    grid-row: 12;
    grid-column: 3;
}

/* --- POSITIES 5-3-2 --- */
#c532-st-l {
    grid-row: 2;
    grid-column: 2;
}

#c532-st-r {
    grid-row: 2;
    grid-column: 4;
}

#c532-cm-l {
    grid-row: 6;
    grid-column: 2;
}

#c532-cm {
    grid-row: 7;
    grid-column: 3;
}

#c532-cm-r {
    grid-row: 6;
    grid-column: 4;
}

#c532-lwb {
    grid-row: 8;
    grid-column: 1;
}

#c532-rwb {
    grid-row: 8;
    grid-column: 5;
}

#c532-cb-l {
    grid-row: 10;
    grid-column: 2;
}

#c532-cb-m {
    grid-row: 11;
    grid-column: 3;
}

#c532-cb-r {
    grid-row: 10;
    grid-column: 4;
}

#c532-keeper {
    grid-row: 12;
    grid-column: 3;
}

/* --- POSITIES 2-1-2 (6v6) --- */
#c212-st-l {
    grid-row: 2;
    grid-column: 2;
}

#c212-st-r {
    grid-row: 2;
    grid-column: 4;
}

#c212-cm {
    grid-row: 6;
    grid-column: 3;
}

#c212-cb-l {
    grid-row: 10;
    grid-column: 2;
}

#c212-cb-r {
    grid-row: 10;
    grid-column: 4;
}

#c212-keeper {
    grid-row: 12;
    grid-column: 3;
}

/* --- POSITIES 2-2-1 (6v6) --- */
#c221-st {
    grid-row: 2;
    grid-column: 3;
}

#c221-cm-l {
    grid-row: 6;
    grid-column: 2;
}

#c221-cm-r {
    grid-row: 6;
    grid-column: 4;
}

#c221-cb-l {
    grid-row: 10;
    grid-column: 2;
}

#c221-cb-r {
    grid-row: 10;
    grid-column: 4;
}

#c221-keeper {
    grid-row: 12;
    grid-column: 3;
}

/* --- POSITIES 3-3-1 (8v8) --- */
#c331-st {
    grid-row: 2;
    grid-column: 3;
}

#c331-lm {
    grid-row: 6;
    grid-column: 1;
}

#c331-cm {
    grid-row: 6;
    grid-column: 3;
}

#c331-rm {
    grid-row: 6;
    grid-column: 5;
}

#c331-lb {
    grid-row: 10;
    grid-column: 1;
}

#c331-cb {
    grid-row: 10;
    grid-column: 3;
}

#c331-rb {
    grid-row: 10;
    grid-column: 5;
}

#c331-keeper {
    grid-row: 12;
    grid-column: 3;
}

/* --- POSITIES 3-2-2 (8v8) --- */
#c322-st-l {
    grid-row: 2;
    grid-column: 2;
}

#c322-st-r {
    grid-row: 2;
    grid-column: 4;
}

#c322-cm-l {
    grid-row: 6;
    grid-column: 2;
}

#c322-cm-r {
    grid-row: 6;
    grid-column: 4;
}

#c322-lb {
    grid-row: 10;
    grid-column: 1;
}

#c322-cb {
    grid-row: 10;
    grid-column: 3;
}

#c322-rb {
    grid-row: 10;
    grid-column: 5;
}

#c322-keeper {
    grid-row: 12;
    grid-column: 3;
}

/* Mobiele weergave voor scorebord: tekst kleiner en logo's niet te groot */
@media screen and (max-width: 768px) {

    #name-home,
    #name-away {
        font-size: 0.48em !important;
    }

    #logo-home,
    #logo-away {
        width: 48px !important;
        height: 48px !important;
    }
}

/* --- WEDSTRIJD SELECTOR VOLLE BREEDTE & GECENTREERD --- */
#match-select {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    /* Dwingt af dat hij niet smaller wordt gemaakt */
    margin: 0 auto;
    text-align: center !important;
    text-align-last: center !important;
    -moz-text-align-last: center !important;
    font-weight: bold;
}

#match-select option {
    text-align: center !important;
}

/* --- LOGO ANIMATIE --- */
.logo-animatie {
    width: 200px;
    height: auto;
    margin-bottom: 0px;
    /* <--- Dit was 10px, nu 0px */

    animation-name: draaiEnGroot;
    animation-duration: 2s;
    animation-iteration-count: 1;
    animation-timing-function: ease-in-out;
}

/* Mobiele weergave: maak het logo kleiner zodat het inlogscherm past */
@media screen and (max-width: 768px) {
    .logo-animatie {
        width: 120px;
        /* Een stuk kleiner op mobiele telefoons */
    }
}

@keyframes draaiEnGroot {
    0% {
        transform: scale(0.5) rotate(0deg);
        /* Klein en niet gedraaid */
    }

    100% {
        transform: scale(1) rotate(360deg);
        /* Groeit naar normale grootte en draait precies 1x (360 graden) */
    }
}

/* --- MATCH ACTION BUTTONS (2x2 GRID) --- */
.match-action-grid {
    display: grid;
    grid-template-columns: repeat(2, 55px);
    /* Twee identieke kolommen */
    grid-template-rows: repeat(2, 35px);
    /* Identieke hoogte */
    justify-content: center;
    /* Horizontaal gecentreerd in het vlak */
    gap: 12px;
    /* Iets verder uit elkaar */
    margin-top: 15px;
    width: 100%;
}

.action-btn {
    width: 100%;
    height: 100%;
    padding: 0;
    /* Centering gefixt via flexbox */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    /* Veel kleinere tekst */
    font-weight: bold;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.1s;
}

.action-btn:active {
    transform: scale(0.95);
}

.btn-goal {
    background-color: var(--theme-success);
}

.btn-sub {
    background-color: #95a5a6;
    color: #fff;
}

.btn-yellow {
    background-color: #f1c40f;
    color: #333;
}

.btn-red {
    background-color: var(--theme-danger);
}

/* --- MODAL STYLING --- */
.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(3px);
}

.modal-content {
    background-color: var(--theme-card);
    padding: 30px;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    position: relative;
    animation: modalScaleIn 0.3s ease-out;
}

@keyframes modalScaleIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.input-field {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s;
}

.input-field:focus {
    outline: none;
    border-color: var(--theme-primary);
    box-shadow: 0 0 0 2px rgba(0, 68, 148, 0.1);
}

.btn {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
    cursor: pointer;
    font-size: 1rem;
    transition: transform 0.1s, opacity 0.2s;
    background-color: var(--theme-primary);
    color: white;
}

.btn:active {
    transform: scale(0.98);
}

.btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn-secondary {
    background-color: #95a5a6;
}