/* components.css — herbruikbare UI-onderdelen die eerder los in <style>-
   tags in losse PHP-bestanden stonden. Gedeeld geladen via php/header.php,
   zelfde opzet als ed/pl. */

/* Deelknoppen + terug-naar-picks op de bevestigingspagina na het opslaan
   (php/prediction_success.php) — zelfde patroon als bij de voetbal-modules
   (ed/pl e.d.): een .ps-share-card met WhatsApp/X/Facebook-knoppen, en een
   sobere .ps-back-link eronder. */
.ps-share-card {
  background: color-mix(in srgb, var(--primary) 8%, var(--white));
  border: 1px solid color-mix(in srgb, var(--primary) 20%, transparent);
  border-radius: 12px;
  padding: 1rem 1.2rem 1.2rem;
}
.ps-share-card .match-share-buttons {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 0.6rem;
  flex-wrap: wrap;
}
.ps-share-card .match-share-label {
  display: block;
  text-align: center;
  font-size: 1rem;
  font-weight: bold;
  color: var(--primary);
  margin: 0;
}
.ps-share-card .match-share-label::before {
  content: "📣 ";
}
.ps-share-card .btn-match-share {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  box-shadow: var(--shadow-soft);
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease;
  text-decoration: none;
}
.ps-share-card .btn-match-share:hover {
  transform: translateY(-3px) scale(1.06);
  box-shadow: var(--shadow-medium);
}
.ps-share-card .btn-whatsapp {
  background: #25d366 !important;
}
.ps-share-card .btn-share-x {
  background: #000 !important;
}
.ps-share-card .btn-share-facebook {
  background: #1877f2 !important;
}
.ps-share-card .btn-match-share i {
  color: var(--white) !important;
  font-size: 1.25rem;
  margin: 0;
}

.ps-back-link {
  text-align: center;
  margin-top: 0.5rem;
}
.ps-back-link a {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-color);
  opacity: 0.75;
  text-decoration: none;
}
.ps-back-link a:hover {
  opacity: 1;
  text-decoration: underline;
}

@media (max-width: 600px) {
  .ps-share-card .btn-match-share {
    width: 48px;
    height: 48px;
  }
}

.ps-processed-heading {
  margin-top: 20px;
}
.ps-team-right {
  text-align: right;
}
.ps-joker-label {
  display: flex;
  align-items: center;
  margin: 0;
  cursor: default;
}
.ps-joker-text {
  white-space: nowrap;
}
@media (max-width: 499px) {
  .ps-joker-text {
    display: none;
  }
}
.ps-box-color-heading {
  color: var(--text-color-light);
  font-size: clamp(1rem, 4.5vw, 1.4rem);
}

/* mijn_spellen.php: spellen-grid, prijzen/badges-grid, badge-modal, tabellen. */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr));
  gap: 0.75rem;
}
.game-card-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 0.75rem;
  border-radius: 12px;
  background: var(--info-box-gray, #f2f2f2);
  text-decoration: none;
  color: var(--text-color);
  text-align: center;
  font-weight: 600;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}
.game-card-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
}
.game-card-item img {
  width: 3rem;
  height: 3rem;
  object-fit: contain;
}

.badge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(6.5rem, 1fr));
  gap: 1rem;
}
.mijn-spellen-uitleg {
  margin-top: 1rem;
  font-size: 0.85rem;
}
.mijn-spellen-collapsible {
  margin: 0;
  padding: 0;
}
.mijn-spellen-collapsible > summary {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--primary);
  font-weight: bold;
  font-size: 1.17em;
  cursor: pointer;
  list-style: none;
}
.mijn-spellen-collapsible > summary::-webkit-details-marker {
  display: none;
}
.mijn-spellen-collapsible > summary::before {
  content: "▸";
  display: inline-block;
  font-size: 0.8em;
  transition: transform 0.15s ease;
}
.mijn-spellen-collapsible[open] > summary::before {
  transform: rotate(90deg);
}
.mijn-spellen-collapsible > summary:hover {
  opacity: 0.8;
}
.mijn-spellen-collapsible > *:not(summary) {
  margin-top: 1rem;
}
.badge-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  padding: 0.75rem 0.5rem;
  border-radius: 12px;
  background: var(--white);
  border: 1px solid #eee;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  text-align: center;
  transition: transform 0.2s ease;
}
.badge-card:hover {
  transform: translateY(-2px);
}
.badge-card img {
  width: 4rem;
  height: 4rem;
  object-fit: contain;
}
.badge-card .badge-caption {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-color);
  line-height: 1.25;
}
.badge-card .badge-year {
  font-size: 0.72rem;
  color: var(--primary);
  font-weight: 700;
}

/* "Nog te halen": dezelfde kaart, dof/grijs met een hangslotje erover */
.badge-card.locked {
  background: #f3f3f3;
  opacity: 0.65;
  position: relative;
}
.badge-card.locked img {
  filter: grayscale(1);
}
.badge-card.locked .badge-caption {
  color: #555;
}
.badge-card.locked::after {
  content: "\1F512";
  position: absolute;
  top: 0.4rem;
  right: 0.5rem;
  font-size: 0.9rem;
}

/* Klikbaar: behaalde badges openen een popup met een grotere versie
   (openBadgeModal() in mijn_spellen.php) */
.badge-card.clickable {
  cursor: pointer;
}
.modal-box {
  background: var(--white);
  padding: 0 1.75rem 1.75rem;
  border-radius: 12px;
  overflow: hidden;
  max-width: 600px;
  width: 70%;
  text-align: center;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
  color: var(--text-color);
  font-family: var(--font-body);
}
.badge-modal-box {
  padding: 2rem;
}

/* Titel-balk voor .modal-box (bv. de bevestigingsmodal in subleague.php,
   showConfirmModal()): een volle-breedte gekleurde balk bovenaan i.p.v.
   platte tekst. class="is-danger" op .modal-box maakt de balk rood, voor
   een destructieve actie zoals een lid verwijderen. De badge-lightbox
   hierboven heeft geen titel-element, dus blijft ongemoeid. */
.modal-title,
#modal-title {
  margin: 0 -1.75rem 1.25rem;
  padding: 1.1rem 1.75rem;
  background: var(--primary);
  color: var(--white);
  font-size: 1.25rem;
  font-weight: 700;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.modal-box.is-danger .modal-title,
.modal-box.is-danger #modal-title {
  background: var(--accent-red);
}

/* Ronde icoon-badge vóór de titeltekst, gevuld met het eerste "woord" van
   de titel (een emoji) via setModalTitle() uit js/ui-helpers.js. */
.modal-icon {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.32),
    0 0 18px rgba(255, 255, 255, 0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  line-height: 1;
}

.modal-message,
#modal-message {
  font-size: 0.98rem;
  line-height: 1.5;
  text-align: left;
}

.modal-buttons,
#modal-buttons {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-top: 1.4rem;
}
.badge-modal-box img {
  display: block;
  width: 100%;
  max-width: 220px;
  height: auto;
  margin: 0 auto 1rem;
  object-fit: contain;
}
.badge-modal-box .badge-modal-caption {
  font-weight: 700;
  color: var(--text-color);
  margin-bottom: 0.25rem;
}
.badge-modal-box .badge-modal-year {
  color: var(--primary);
  font-weight: 700;
  margin-bottom: 1rem;
}

.spellen-historie-table th,
.spellen-historie-table td,
.spellen-prestaties-table th,
.spellen-prestaties-table td {
  text-align: left;
  padding-left: 0.5rem;
}
.spellen-historie-table td:first-child,
.spellen-prestaties-table td:first-child {
  font-weight: 500;
  color: var(--text-color);
}
.clickable-name {
  cursor: pointer;
  text-decoration: underline dotted;
  text-underline-offset: 3px;
}
.clickable-name:hover {
  color: rgba(0, 0, 0, 0.7);
}
@media (max-width: 499px) {
  .spellen-historie-table,
  .spellen-prestaties-table {
    font-size: 0.9rem;
  }
}

/* ranking.php: standentabel (ranking-table), laatste-wedstrijd-rij, en de
   picks-popup (klik op een naam in de stand). Was voorheen een <style>-blok
   binnen renderTable() zelf — dat werd bij elke AJAX-subleague-wissel
   (?ajax_subleague_id=...) opnieuw in de tabel-HTML meegestuurd, wat
   lijnrecht inging tegen de eigen code-comment ("Geen style-tags... die de
   JS-DOM vervuilt"). Nu eenmalig geladen via components.css. */
.ranking-table tbody tr:nth-child(10n) {
  background-color: color-mix(in srgb, var(--primary) 20%, transparent) !important;
  border-bottom: 2px solid #ffc107 !important;
}

.last-match-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.score::before,
.score::after {
  content: "";
}

.ranking-table .clickable-name {
  cursor: pointer;
  text-decoration: underline dotted;
  text-underline-offset: 3px;
}

.ranking-table .clickable-name:hover {
  color: var(--primary);
}

@media (max-width: 600px) {
  .last-match-row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    row-gap: 6px;
  }

  .last-match-row img:first-child {
    grid-row: 1;
    grid-column: 1;
  }

  .last-match-row span:first-of-type {
    grid-row: 1;
    grid-column: 2;
  }

  .score {
    grid-row: 1;
    grid-column: 3;
  }

  .last-match-row img:last-child {
    grid-row: 2;
    grid-column: 1;
  }

  .last-match-row span:last-of-type {
    grid-row: 2;
    grid-column: 2;
  }

  .score {
    font-weight: bold;
    position: relative;
    color: transparent;
  }

  .score::before {
    content: attr(data-home);
    color: black;
    position: absolute;
    left: 0;
    top: 0;
  }

  .score::after {
    content: attr(data-away);
    color: black;
    position: absolute;
    left: 0;
    top: 22px;
  }
}

/* Picks-popup — los van de generieke alert-modal, want deze moet breed genoeg zijn voor een tabel */
.picks-modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  z-index: 9999;
  justify-content: center;
  align-items: center;
}

.picks-modal-content {
  background: var(--white);
  color: var(--text-color);
  padding: 20px;
  border-radius: 8px;
  width: 50%;
  max-width: 900px;
  min-width: 320px;
  max-height: 85vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  margin: auto;
}

.picks-modal-close {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 28px;
  cursor: pointer;
  color: var(--text-color);
  font-weight: bold;
}

/* Zelfde uitstraling als de site-brede h2 (grootte + kleur), maar zonder de
   hoofdletters/small-caps van h2 — dit is een h3-element. */
#picksModalTitle {
  color: var(--primary);
  text-transform: none;
  font-variant: normal;
  margin-top: 0;
  border-bottom: 3px solid var(--secondary);
  padding-bottom: 5px;
  font-size: 1.4rem;
}

@media (max-width: 768px) {
  .picks-modal-overlay {
    align-items: flex-start;
    padding: 0;
  }

  .picks-modal-content {
    width: 100%;
    max-width: 100%;
    border-radius: 0 0 12px 12px;
    margin-top: 0;
    max-height: 95vh;
  }
}

.btn-toggle {
  background: #f0f0f0;
  border: 1px solid var(--primary);
  padding: 4px 10px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: 0.2s;
}

.btn-toggle.active {
  background: white;
  border-color: var(--secondary);
  font-weight: bold;
  color: black;
}

.ranking-underlined-heading {
  border-bottom: 2px solid var(--primary);
  width: fit-content;
}

/* stats.php + my_picks.php: uitgeschakelde/ongebruikte spelers in de
   .stats-spelers-table. Beide pagina's hadden hier onafhankelijk een eigen
   losse <style>-regel voor met net iets andere waarden — samengevoegd tot
   1 definitie (de rijkere variant uit my_picks.php) i.p.v. 2 losse. */
.stats-spelers-table .team-inactive {
  opacity: 0.6;
  background-color: #f9f9f9;
  filter: grayscale(1);
}
.team-unused {
  opacity: 0.7;
  font-style: italic;
} /* Teams met 0 picks */

/* php/footer.php: social-icons footer */
.footer-social-wrapper {
  width: 100%;
  max-width: 70%;
  margin: 0 auto 25px auto;
  text-align: center;
}

@media screen and (max-width: 768px) {
  .footer-social-wrapper {
    max-width: 100%;
  }
}

.footer-social {
  display: flex;
  justify-content: center;
  gap: 35px;
  margin: 0 2rem 2rem;
}

@media screen and (min-width: 769px) {
  .footer-social {
    gap: 70px;
  }
}

.footer-social a {
  color: #b6b6b6;
  font-size: 2rem;
  transition: color 0.3s ease;
  text-decoration: none;
}

.footer-social a:hover {
  color: #ffffff;
}

/* index.php: .standings-table (ATP top-100-tabel) op mobiel */
@media screen and (max-width: 600px) {
  .standings-table td,
  .standings-table th {
    font-size: 0.9rem;
    padding: 8px 4px;
  }

  .standings-table td:last-child {
    font-size: 0.7rem;
    font-weight: bold;
  }

  .standings-table td:nth-child(2) {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

/* picks.php: permanent verborgen elementen (geen JS-toggle op deze) */
.hidden-block {
  display: none;
}
.no-top-margin {
  margin-top: 0;
}
.svg-filter-defs {
  position: absolute;
  width: 0;
  height: 0;
}

.turbo-picks-heading {
  margin: 0 0 10px 0;
}

/* my_picks.php + stats.php: tabel-controls (kolomtoggles op mobiel voor
   joker/score/pts, die niet naast elkaar passen) en samenvattingsbalk.
   Zelfde opzet als ed/pl's .picks-table-controls: rechts uitgelijnd,
   pil-vormige knoppen. */
.my-picks-table-controls {
  display: none;
  gap: 6px;
  justify-content: flex-end;
  margin-bottom: 0.4rem;
}
@media (max-width: 768px) {
  .my-picks-table-controls.mobile-visible {
    display: flex;
    margin-top: 1rem;
  }
}

.summary-bar-table {
  cursor: pointer;
  width: 100%;
}
.summary-bar-table.open .triangle-cell {
  transform: rotate(90deg);
}

.my-picks-btn-toggle {
  width: 2.75rem;
  padding: 4px 0;
  border: 1px solid var(--primary);
  background: var(--white);
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.85rem;
  text-align: center;
  transition:
    background-color 0.2s ease,
    color 0.2s ease;
}
.my-picks-btn-toggle.active {
  background: var(--primary);
  color: var(--white);
  font-weight: 600;
}

.col-joker,
.col-score,
.col-pts {
  display: none;
}
.col-pts.active-col,
.col-joker.active-col,
.col-score.active-col {
  display: table-cell;
}

.summary-bar-label {
  text-align: left;
  padding-left: 5px;
}

.jokers-summary-row {
  border-top: 2px solid var(--primary);
}
.jokers-summary-row .col-team-name {
  text-align: left;
}

/* faq_us.php: uitklapbare FAQ-items. Zelfde opzet als ed/css/components.css
   (radius, hover-dim, +/− toggle, answer-styling), maar met wbd's (bron voor deze port) eigen
   primary-tint i.p.v. ed's --primary-light (die kleur hoort niet bij het origineel s
   groene palet). */
.faq-item {
  margin-bottom: 10px;
  border: 1px solid var(--table-border, #eee);
  border-radius: 8px;
  overflow: hidden;
}
.faq-question {
  padding: 12px 15px;
  background: color-mix(in srgb, var(--primary) 10%, var(--white));
  cursor: pointer;
  font-weight: 600;
  transition: background 0.2s ease;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}
.faq-question::after {
  content: "+";
  color: var(--primary);
  font-size: 1.2em;
  flex-shrink: 0;
}
.faq-item.faq-open .faq-question::after {
  content: "\2212"; /* − */
}
.faq-question:hover {
  filter: brightness(0.97);
}
.faq-answer {
  display: none;
  padding: 15px;
  background: var(--white);
  border-top: 1px solid var(--table-border, #eee);
  line-height: 1.5;
  font-size: 0.95em;
  color: var(--text-color);
}
.faq-answer a {
  color: var(--primary);
}
.faq-answer ul {
  margin: 0.5rem 0 0;
  padding-left: 1.2rem;
}
.faq-item.faq-open .faq-answer {
  display: block;
}

/* php/atp-top100.php: ATP-ranking fragment (lazy-loaded op index.php).
   Eigen class-naam i.p.v. het generieke .flag-icon — die naam wordt ook
   gebruikt door de taal-dropdown-vlaggen in header.css, en de border hier
   lekte daar per ongeluk in mee (border wordt niet overschreven door een
   specifiekere selector als die zelf geen border zet). */
.atp-flag-icon {
  width: 20px;
  height: auto;
  vertical-align: middle;
  margin-right: 8px;
  border: 1px solid #eee;
}
.extra-rows {
  display: none;
}

/* subleague.php: feedback-box na aanmaken/toetreden, ledenlijst-kop,
   in-form-knoppen. Dropdown-lijsten en de owner-only sectie herbruiken
   .hidden-block (zie hierboven) voor hun initiële display:none. */
.subleague-feedback {
  margin-top: 10px;
  margin-bottom: 15px;
}
.subleague-members-heading {
  margin-top: 20px;
}
.subleague-inline-form {
  display: inline;
}

/* stats.php: dropdown-lijsten (participant/club/vergelijk-selects), inline
   dropdown-item met logo, compare-charts */
.dropdown-item-with-logo {
  display: flex;
  align-items: center;
  gap: 6px;
}
.dropdown-item-crest {
  width: 20px;
  height: 20px;
  object-fit: contain;
}
.form-margin-bottom {
  margin-bottom: 15px;
}
.compare-dropdown-flex {
  flex: 1;
}
.compare-chart-wrap {
  height: 350px;
  margin-top: 20px;
}
.compare-chart-placeholder {
  text-align: center;
  padding: 40px;
  color: #ccc;
  border: 2px dashed #eee;
  border-radius: 10px;
}

.hidden-pick-note {
  text-align: center;
  background: #f9f9f9;
  color: #999;
  font-style: italic;
}

.joker-none {
  color: #bbb;
  font-weight: normal;
}

/* Push-melding bel bij "Programma" op picks.php — zelfde opzet als ed/pl. */
.schedule-header-row {
  position: relative;
}

.schedule-header-row h2 {
  display: flex;
  align-items: center;
}

.push-bell-inline {
  border: 2px solid red;
  background: #f2f3f7;
  color: var(--primary-hover, var(--primary));
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 0.9rem;
  line-height: 1;
  cursor: pointer;
  display: none;
  vertical-align: middle;
  margin-right: -5px;
  margin-left: auto;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  transition:
    transform 0.15s ease,
    background 0.15s ease;
}
.push-bell-inline:hover {
  transform: scale(1.08);
}
.push-bell-inline.is-subscribed {
  background: var(--white);
  border: 2px solid var(--primary);
  color: #fff;
}

.push-bell-tooltip {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  background: var(--white);
  border: 1px solid #e4e8f5;
  border-radius: 10px;
  box-shadow: var(--shadow-md, 0 4px 14px rgba(10, 30, 64, 0.2));
  padding: 12px 14px;
  width: 260px;
  max-width: 80vw;
  z-index: 500;
  font-size: 0.85rem;
  color: var(--text-color);
}
.push-bell-tooltip[hidden] {
  display: none;
}
.push-bell-tooltip p {
  margin: 0 0 10px 0;
  line-height: 1.4;
}
.push-bell-action {
  border: none;
  border-radius: var(--radius-pill, 999px);
  padding: 8px 14px;
  font-weight: 700;
  font-size: 0.8rem;
  cursor: pointer;
  color: #fff;
  font-family: var(--font-body);
  background: linear-gradient(
    120deg,
    var(--primary) 0%,
    var(--primary-hover, var(--primary)) 100%
  );
}
