/* Eifeltours Plugin - Frontend Styling */

/* Keyframe animaties */
@keyframes fadeInSlideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* Thema-specifieke overrides */
.page-wrapper, .auth-form-wrapper { background: transparent; padding: 0; box-shadow: none; max-width: none; }

/* Hoofd-container */
.eifeltours-auth-wrapper { max-width: 80%; margin: 50px auto; padding: 40px; background-color: #ffffff; border-radius: 12px; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2); border: 1px solid #e0e0e0; color: #333333; animation: fadeInSlideUp 0.6s ease-out forwards; }

/* Titels */
.eifeltours-auth-wrapper h1, .eifeltours-auth-wrapper h3 { text-align: center; margin-top: 0; margin-bottom: 25px; color: #1a1a1a; }

/* Paragrafen en labels */
.eifeltours-auth-wrapper p { margin-bottom: 20px; }
.eifeltours-auth-wrapper label { display: block; margin-bottom: 8px; font-weight: 500; color: #555; }

/* Input velden */
.eifeltours-auth-wrapper input[type="text"], .eifeltours-auth-wrapper input[type="email"], .eifeltours-auth-wrapper input[type="password"], .eifeltours-auth-wrapper select { width: 100%; padding: 12px 15px; border-radius: 8px; border: 1px solid #ccc; background-color: #f7f7f7; color: #333; font-size: 16px; box-sizing: border-box; transition: border-color 0.3s ease, box-shadow 0.3s ease; }

/* Focus op input velden */
.eifeltours-auth-wrapper input:focus, .eifeltours-auth-wrapper select:focus { outline: none; border-color: #333; box-shadow: 0 0 0 3px rgba(50, 50, 50, 0.1); }

/* Knoppen */
.eifeltours-auth-wrapper button, .eifeltours-auth-wrapper input[type="submit"] { width: 100%; padding: 14px; border-radius: 8px; border: none; background-color: #1a1a1a; color: #ffffff; font-size: 16px; font-weight: bold; cursor: pointer; transition: transform 0.2s ease, background-color 0.2s ease; }
.eifeltours-auth-wrapper button:hover, .eifeltours-auth-wrapper input[type="submit"]:hover { transform: scale(1.02); background-color: #333; }

/* Links */
.eifeltours-auth-wrapper .form-link { display: block; text-align: center; margin-top: 20px; color: #777; text-decoration: none; transition: color 0.3s; }
.eifeltours-auth-wrapper .form-link:hover { color: #1a1a1a; }

/* Meldingen */
.eifeltours-messages { padding: 0; margin-bottom: 20px; border-left: 4px solid #ddd; animation: fadeInSlideUp 0.5s ease-out forwards; }
.eifeltours-messages .message { margin: 0; padding: 15px; }
.eifeltours-messages .message.error { background-color: #fff2f2; border-color: #e53e3e; color: #c53030; }
.eifeltours-messages .message.success { background-color: #f0fff4; border-color: #48bb78; color: #38a169; }

/* Horizontale lijn */
.eifeltours-auth-wrapper hr { border: none; border-top: 1px solid #e0e0e0; margin: 30px 0; }

/* Toernooilijst */
.tournament-list { list-style: none; padding: 0; margin: 0; }
.tournament-list li { margin-bottom: 10px; }
.tournament-list li a { display: flex; justify-content: space-between; align-items: center; padding: 15px 20px; border-radius: 8px; text-decoration: none; background-color: #f7f7f7; border: 1px solid #e0e0e0; color: #333; transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease; }
.tournament-list li a:hover { transform: translateY(-2px); box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08); border-color: #ccc; }
.tournament-list .tournament-title { font-weight: 500; }
.tournament-list .tournament-date { color: #777; font-size: 0.9em; }

/* Toernooi Detail Header */
.eifeltours-tournament-header { margin-bottom: 15px; text-align: center; position: relative; }
.eifeltours-tournament-header .back-link { position: absolute; top: 5px; left: 0; color: #777; text-decoration: none; font-size: 0.9em; }
.eifeltours-tournament-header .back-link:hover { color: #1a1a1a; }
.eifeltours-tournament-header h2 { margin: 0; font-size: 1.8em; }

/* Spelerlijst */
#player-list { list-style: none; padding: 0; margin-bottom: 20px; }
#player-list li { display: flex; justify-content: space-between; align-items: center; padding: 12px; background: #f7f7f7; border-radius: 6px; margin-bottom: 8px; border: 1px solid #e0e0e0; }
#player-list .no-players { background: transparent; border: 1px dashed #e0e0e0; color: #777; justify-content: center; }
#player-list .remove-player { background: #e53e3e; color: white; border: none; border-radius: 50%; width: 24px; height: 24px; cursor: pointer; font-weight: bold; font-size: 16px; transition: background-color 0.2s; display: flex; align-items: center; justify-content: center; }
#player-list .remove-player:hover { background: #c53030; }

/* Speler Toevoegen Formulier */
.add-player-form { display: flex; flex-direction: column; gap: 10px; }
.add-player-form .form-row { display: flex; gap: 10px; }
.add-player-form select, .add-player-form input[type="text"] { flex-grow: 1; margin-bottom: 0; width: 100%; }
.add-player-form button { width: 50px !important; padding: 10px; font-size: 20px; flex-shrink: 0; }
.add-player-form p { text-align: center; margin: 5px 0; color: #777; font-style: italic; }

/* Gevaar Knop */
.button-danger { background-color: #e53e3e !important; }
.button-danger:hover { background-color: #c53030 !important; }

/* --- AMIDAKUJI & SCOREKAARTEN STIJLEN --- */
#amidakuji-wrapper { margin-top: 20px; }
#amidakuji-wrapper h3 { text-align: center; margin-bottom: 20px; }
.amidakuji-layout {
    display: block; /* Geen flexbox meer nodig */
}
#amidakuji-container { flex: 3; min-width: 300px; max-width: 100%; overflow-x: auto; border: 1px solid #e0e0e0; border-radius: 8px; background-color: #fcfcfc; }
#amidakuji-canvas { display: block; }

/* --- NIEUWE STIJLEN VOOR TAFEL 'BAKJES' --- */
.final-arrangement-bins {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.table-bin {
    flex: 1;
    min-width: 120px;
    background-color: #f7f7f7;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
}

.table-bin h4 {
    margin: 0 0 10px 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #ddd;
    font-size: 1.1em;
}

.table-bin ul {
    list-style: none;
    padding: 0;
    margin: 0;
    min-height: 50px; /* Geeft de bakjes een minimale hoogte */
}

.table-bin li {
    background-color: #fff;
    padding: 8px;
    border-radius: 4px;
    margin-bottom: 5px;
    font-weight: 500;
    opacity: 0; /* Begin onzichtbaar voor animatie */
    transform: translateY(15px);
    animation: fadeInSlideUp 0.5s ease-out forwards;
}

.round-controls { margin-top: 30px; text-align: center; }

/* Grid voor scorekaarten */
.final-tables-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; }
/* Grid voor scorekaarten */
.final-tables-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; }
.table-score-card { background: #fdfdfd; padding: 20px; border-radius: 8px; border: 1px solid #e0e0e0; }
.table-score-card h4 { margin-top: 0; text-align: center; }
.table-score-card ul { list-style: none; padding: 0; margin-bottom: 15px; }
.table-score-card li { display: flex; justify-content: space-between; align-items: center; padding: 10px; border-radius: 4px; margin-bottom: 5px; border-left: 4px solid #ccc; transition: background-color 0.3s, border-color 0.3s; }
.table-score-card li .player-name { font-weight: 500; }

.player-score-controls { display: flex; align-items: center; gap: 10px; }
.adjust-score-btn {
    width: 28px !important;
    height: 28px;
    padding: 0;
    font-size: 20px;
    font-weight: bold;
    border-radius: 50%;
    background-color: #f0f0f0;
    color: #333;
    border: 1px solid #ccc;
    /* Gebruik flexbox voor perfect centreren */
    display: flex !important;
    align-items: center;
    justify-content: center;
}
.adjust-score-btn:hover {
    background-color: #e0e0e0;
    transform: scale(1.1);
}
.adjust-score-btn.add-point { background-color: #e8f5e9; border-color: #4CAF50; color: #4CAF50; }
.adjust-score-btn.subtract-point { background-color: #ffebee; border-color: #f44336; color: #f44336; }

.player-score { font-weight: bold; font-size: 1.2em; min-width: 25px; text-align: center; }
li.op_pelt { background-color: #ffebee; border-color: #c62828; font-weight: bold; }
li.op_pelt .player-score-controls { opacity: 0.6; } /* Maak knoppen wat lichter */

@keyframes fadeInSlideLeft { to { opacity: 1; transform: translateX(0); } }

/* --- NIEUWE STIJLEN VOOR SPELERSTATUS --- */

/* Keyframe animatie voor 'Op Pelt' */
/* Keyframe animatie voor 'Op Pelt' */
@keyframes light-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-1px); }
  75% { transform: translateX(1px); }
}

/* Stijl voor spelers die 'Op Pelt' zijn */
li.op_pelt {
    background-color: #fff3e0; /* Oranje-achtig */
    border-color: #ff9800;
    /* Constante, subtiele animatie */
    animation: light-shake 1s infinite;
}

.table-finished .adjust-score-btn {
    pointer-events: none;
    opacity: 0.5;
}

/* Stijl voor spelers die 'Af' zijn */
li.af {
    /* We halen de grijze achtergrond en doorhaling weg, 
       dit wordt nu overgenomen door is-advancing/is-eliminated */
    border-color: #9e9e9e;
}
li.af .player-score-controls {
    opacity: 0.5;
}

/* Stijl voor spelers die doorgaan */
li.is-advancing {
    background-color: #e8f5e9; /* Lichte groene achtergrond */
    border-left-color: #4CAF50; /* Groen */
}
li.is-advancing::before {
    content: '✓';
    color: #4CAF50;
    font-weight: bold;
    margin-right: 10px;
}

/* Stijl voor spelers die (voorlopig) afvallen */
li.is-eliminated {
    background-color: #ffebee; /* Lichte rode achtergrond */
    border-left-color: #f44336; /* Rood */
    color: #b71c1c;
    text-decoration: line-through;
    opacity: 0.8;
}
li.is-eliminated::before {
    content: '✗';
    color: #f44336;
    font-weight: bold;
    margin-right: 10px;
}

/* Algemene ronde info */
.round-info {
    text-align: center;
    font-style: italic;
    color: #777;
    margin-top: -15px;
}

/* Stijlen voor de 'Ronde Afronden' knop */
#finish-round[disabled] {
    background-color: #cccccc;
    cursor: not-allowed;
    transform: none;
}
#finish-round.enabled {
    background-color: #4CAF50 !important; /* Groen */
}
#finish-round.enabled:hover {
    background-color: #45a049 !important;
}

/* Info over aantal winnaars per tafel */
.table-advancement-info {
    font-size: 0.9em;
    text-align: center;
    color: #555;
    margin-top: -10px;
    margin-bottom: 15px;
    font-weight: bold;
}

/* Stop de 'Op Pelt' animatie als de tafel klaar is */
.table-finished li.op_pelt {
    animation: none;
}

/* Stijl voor de winnaar-weergave */
.tournament-finished-wrapper { text-align: center; }
.winner-name { font-size: 2em; font-weight: bold; color: #4CAF50; }

/* --- STIJLEN VOOR VOLTOOID TOERNOOI --- */
#tournament-finished-wrapper { position: relative; }
#confetti-canvas { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 10; }

/* Toon winnaar op overzichtspagina */
.tournament-winner { font-weight: bold; color: #b8860b; background-color: #fff8e1; padding: 3px 8px; border-radius: 4px; font-size: 0.9em; }

/* Podium styling */
.podium { display: flex; align-items: flex-end; justify-content: center; gap: 5px; height: 200px; margin-top: 30px; }
.podium-place { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; color: white; border-radius: 8px 8px 0 0; padding: 15px; text-align: center; }
.podium-place.first { background: #ffd700; /* Goud */ width: 38%; height: 100%; }
.podium-place.second { background: #c0c0c0; /* Zilver */ width: 31%; height: 80%; }
.podium-place.third { background: #cd7f32; /* Brons */ width: 31%; height: 60%; }
.podium-rank { font-size: 2.5em; font-weight: bold; line-height: 1; }
.podium-name { font-size: 1.2em; margin-top: 10px; }

/* Volledige ranking lijst */
.full-ranking-list { list-style: none; padding: 0; }
.full-ranking-list li { display: flex; padding: 10px; border-bottom: 1px solid #f0f0f0; }
.full-ranking-list .rank { font-weight: bold; color: #888; min-width: 40px; }

/* Ronde tabbladen */
/* Ronde tabbladen */
/* Ronde tabbladen */
.round-tabs { 
    display: flex; 
    gap: 5px; 
    border-bottom: 1px solid #e0e0e0; /* Grijze divider, zoals de <hr> */
    margin-bottom: 25px; /* Extra ruimte eronder */
    padding-bottom: 5px; /* Kleine extra ruimte tussen knoppen en lijn */
}
.round-tab-button {
    background: #f5f5f5; /* Lichter grijs voor inactief */
    color: #555;
    border: 1px solid #e0e0e0;
    border-bottom: none;
    padding: 10px 15px;
    border-radius: 6px 6px 0 0;
    cursor: pointer;
    font-size: 1em;
    margin-bottom: -1px; /* Zorgt dat de knop over de lijn valt */
    transform: scale(0.95); /* Maak inactieve knop iets kleiner */
    transform-origin: bottom;
    transition: transform 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}
.round-tab-button.active {
    background: #1a1a1a; /* Zwart/donkergrijs voor actief */
    color: #ffffff;
    font-weight: bold;
    border-color: #1a1a1a;
    transform: scale(1.0); /* Normale grootte voor actieve knop */
}
.round-content-panel { display: none; }
.round-content-panel.active { display: block; }

/* Styling voor ronde-geschiedenis in tabbladen */
.round-history-table {
    margin-bottom: 15px;
    background: #fdfdfd;
    padding: 15px;
    border: 1px solid #f0f0f0;
    border-radius: 6px;
}
.round-history-table h5 {
    margin-top: 0;
    text-align: center;
    font-size: 1em;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}
.round-history-table ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.round-history-table li {
    display: flex;
    justify-content: space-between;
    font-size: 0.9em;
    padding: 5px 0;
}
.round-history-table li span:last-child {
    font-weight: bold;
}

/* Styling voor "door/af" in ronde-geschiedenis */
.round-history-table li.advanced .history-icon {
    color: #4CAF50;
    font-weight: bold;
}
.round-history-table li.eliminated {
    color: #9e9e9e;
}
.round-history-table li.eliminated .history-icon {
    color: #f44336;
    font-weight: bold;
}
.history-icon {
    display: inline-block;
    width: 20px;
    text-align: center;
}