/* [split 3/9] servbg.com stylesheet: modal and utilities. Split from style.css on 2026-10-12 (lines 1585-1749 of the original); the nine css/*.css parts load in numbered order, then the terminal css/app.css. See style.css stub. */
/* === MODAL === */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  /* Raised above .cookie-banner's z-index:2000 (2026-08-29, mobile overhaul
     wave 1, fix 3) so an open modal always stacks above the cookie sheet. */
  z-index: 2100;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 520px;
  max-height: 90vh;
  overflow: hidden;
  transform: scale(0.95);
  transition: transform 0.2s;
}

/* Wider modal for profile page */
.modal.wide {
  max-width: 680px;
}

.modal.profile-modal {
  width: min(960px, 96vw);
  max-width: min(960px, 96vw);
  max-height: 90vh;
}

.modal.assess-modal {
  width: min(1100px, 96vw);
  max-width: min(1100px, 96vw);
  max-height: 92vh;
}

.modal-overlay.active .modal {
  transform: scale(1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
}

.modal-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-title svg {
  width: 16px;
  height: 16px;
  color: var(--accent);
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  font-size: 18px;
  line-height: 1;
}

.modal-close:hover {
  color: var(--text-primary);
}

.modal-body {
  padding: 16px;
  overflow-y: auto;
  max-height: calc(90vh - 50px);
}

/* Profile modal specific scrolling — landscape grid sizes itself; allow scroll
   only as a safety net on short viewports. */
.modal.profile-modal .modal-body {
  overflow-y: auto;
  padding: 0;
  max-height: calc(90vh - 50px);
}

/* Stats modal - no scroll */
.modal-body.stats-body {
  overflow: hidden;
  padding: 0;
}

.modal-body iframe {
  width: 100%;
  height: 500px;
  border: none;
  border-radius: 4px;
}

/* Full-screen modal for tools */
.modal-fullscreen {
  width: 98vw;
  max-width: 800px;
  height: 90vh;
  max-height: 90vh;
}

.modal-body-fullscreen {
  padding: 0;
  height: calc(90vh - 45px);
  overflow: hidden;
}

.modal-body-fullscreen iframe {
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 0;
}

/* === UTILITIES === */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-hover); }

/* Forced override, kept on purpose: .hidden is a global kill switch applied on
   top of component rules that set their own display; it must win wherever it
   lands, so no specificity fix replaces it. */
.hidden { display: none !important; }
.text-success { color: var(--accent); }
.text-error { color: var(--error); }
.text-muted { color: var(--text-muted); }

.spinner {
  width: 14px;
  height: 14px;
  border: 2px solid var(--border-color);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}

@keyframes spin { to { transform: rotate(360deg); } }

