/* modal.css — modal dialog styling ("bold header" variant). Can render
   standalone before header.php loads (e.g. the "not logged in" modal in
   stats_logic.php/my_picks_logic.php); var() fallbacks below keep it
   looking correct even if base.css hasn't loaded. */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;600;700;800&display=swap');

body {
  font-family: 'Montserrat', sans-serif;
}

.modal-overlay {
  background: rgba(10, 30, 64, 0.85);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: 5rem;
  z-index: 9999;
}

/* No top padding: the title becomes a full-width color band via a
   negative margin that exactly cancels the side padding here — keep both
   "1.75rem" values in sync. overflow:hidden rounds the band off at the top. */
.modal-box {
  background: #fff;
  padding: 0 1.75rem 1.75rem;
  border-radius: var(--radius-md, 12px);
  overflow: hidden;
  max-width: 600px;
  width: 70%;
  text-align: center;
  box-shadow: var(--shadow-lg, 0 12px 32px rgba(10, 30, 64, 0.20));
  color: var(--text-color);
  animation: modalPop 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  font-family: 'Montserrat', sans-serif;
}

/* Badge lightbox (mijn_spellen.php) reuses .modal-box but has no title
   band, so it keeps its own plain padding instead. */
.badge-modal-box {
  padding: 2rem;
}

/* Title band: matches every title-variant markup used across the site
   (.modal-title, .modalTitle, #modal-title, #modalTitle, #confirmModalTitle)
   so all modals share the same header without changing the PHP. */
.modal-title,
.modalTitle,
#modal-title,
#modalTitle,
#confirmModalTitle {
  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-transform: none;
  text-align: left;
  font-family: 'Montserrat', sans-serif;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Round icon badge with glow, shown before the title text. Filled with the
   first "word" of the title (an emoji); see php/modal.php and the
   show*Modal() JS functions. */
.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;
}

/* Club crest inline in the "confirm pick" message (picks.php's showConfirmModal()) */
.confirm-crest {
  height: 20px;
  width: auto;
  vertical-align: middle;
  margin: 0 0.2rem 0 0.2rem;
  object-fit: contain;
}

/* Optional color variants of the title band: add class="is-warning" or
   class="is-danger" on .modal-box for a warning/destructive action.
   Without either class the band stays green (--primary). */
.modal-box.is-warning .modal-title,
.modal-box.is-warning .modalTitle,
.modal-box.is-warning #modal-title,
.modal-box.is-warning #modalTitle,
.modal-box.is-warning #confirmModalTitle {
  background: var(--accent-orange, #fc6401);
}
.modal-box.is-danger .modal-title,
.modal-box.is-danger .modalTitle,
.modal-box.is-danger #modal-title,
.modal-box.is-danger #modalTitle,
.modal-box.is-danger #confirmModalTitle {
  background: var(--accent-red, #D50000);
}

/* Message: covers both modal-message and modalMessage naming */
#modal-message,
.modal-message,
#modalMessage,
#confirmModalMessage {
  font-size: 0.98rem;
  line-height: 1.5;
  text-align: left;
  font-family: 'Montserrat', sans-serif;
}

/* Button row: right-aligned. Covers both .modal-buttons and #modal-buttons */
.modal-buttons,
#modal-buttons {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-top: 1.4rem;
}

#modalCloseBtn,
#modal-close-btn {
  background-color: var(--primary);
  color: var(--white);
  border: none;
  padding: 0.7rem 1.4rem;
  font-size: 1rem;
  font-weight: bold;
  border-radius: var(--radius-pill, 999px);
  margin-top: 1.4rem;
  cursor: pointer;
  transition: background-color var(--transition-base, 0.2s ease), box-shadow var(--transition-base, 0.2s ease), transform var(--transition-base, 0.2s ease);
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(10, 30, 64, 0.08));
  font-family: var(--font-body);
}

/* Inside a .modal-buttons/#modal-buttons row the row itself provides the
   spacing above, so no extra margin-top here (e.g. team_limit.php). */
.modal-buttons #modalCloseBtn,
.modal-buttons #modal-close-btn,
#modal-buttons #modalCloseBtn,
#modal-buttons #modal-close-btn {
  margin-top: 0;
}

#modalCloseBtn:hover,
#modal-close-btn:hover {
  background-color: var(--primary-hover, #007300);
  box-shadow: var(--shadow-md, 0 4px 14px rgba(10, 30, 64, 0.12));
  transform: translateY(-1px);
}

#modalCloseBtn:focus-visible,
#modal-close-btn:focus-visible {
  outline: 2px solid var(--primary-hover, #007300);
  outline-offset: 2px;
}

#modal-cancel_2teams {
  width: auto;
  padding: 10px 20px;
  border-radius: var(--radius-pill, 999px);
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  transition: background-color var(--transition-base, 0.2s ease), box-shadow var(--transition-base, 0.2s ease), transform var(--transition-base, 0.2s ease);
  box-sizing: border-box;
  text-decoration: none;
  margin-top: 0;
}

#modal-cancel_2teams:hover {
  box-shadow: var(--shadow-md, 0 4px 14px rgba(10, 30, 64, 0.12));
  transform: translateY(-1px);
}

@keyframes modalPop {
  from { opacity: 0; transform: scale(0.94) translateY(4px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
