/* Shared brand tokens, sidebar nav/collapse styles, and focus/reduced-motion
   base rules now live in theme.css (synced from campushub-theme/) — this
   file only carries FacultyHub-specific styling on top of it. */

/* Watermark on the main content area only (excludes the sidebar) */
#page-wrapper {
  position: relative;
}
#page-wrapper::before {
  content: '';
  /* Anchored to #page-wrapper itself (which is position:relative), not the
     viewport. The wrapper already sits to the right of the sidebar via
     flexbox, so filling it edge-to-edge centres the crest on the actual
     content column automatically — no hardcoded `left: 16rem` to re-derive
     the sidebar width (which broke when the sidebar collapsed on mobile and
     left the crest off-centre against content). `inset` also excludes the
     sticky header's height, so the crest centres on the visible body, not
     the full viewport. */
  position: absolute;
  inset: 0;
  /* Relative to this file's own location (static/css/app.css), not absolute
     — CSS can't read FORCE_SCRIPT_NAME/STATIC_URL, so a relative path is the
     only way this survives the app being mounted at different prefixes
     (nginx gateway vs. bare local dev) without hardcoding one of them. */
  background-image: url('../img/campushub-crest.png');
  background-repeat: no-repeat;
  background-position: center center;
  background-size: 60% auto;
  opacity: 0.036;
  pointer-events: none;
  z-index: 0;
}

/* ─── HTMX loading indicator ──────────────────────────────────────────── */
#htmx-indicator {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, #1a3a6b 0%, #c9a227 50%, #1a3a6b 100%);
  background-size: 200% 100%;
  animation: progress-bar 1.4s ease-in-out infinite;
  z-index: 9999;
}
#htmx-indicator.htmx-request { display: block; }

@keyframes progress-bar {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ─── Button loading state ────────────────────────────────────────────── */
button[data-loading]:disabled,
button.htmx-request {
  opacity: 0.7;
  cursor: not-allowed;
}

/* ─── Page transitions ────────────────────────────────────────────────── */
main { animation: fade-in 0.15s ease-out; }
@keyframes fade-in {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── HTMX swap transition ────────────────────────────────────────────── */
.htmx-swapping { opacity: 0; transition: opacity 0.1s ease-out; }
.htmx-settling  { transition: opacity 0.15s ease-in; }

/* ─── FullCalendar tooltip ────────────────────────────────────────────── */
.fc-event-tooltip {
  position: absolute;
  background: #1a3a6b;
  color: #f9fafb;
  font-size: 0.75rem;
  padding: 6px 10px;
  border-radius: 6px;
  pointer-events: none;
  z-index: 1000;
  max-width: 220px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  white-space: pre-line;
}

/* ─── Compliance table sticky header ──────────────────────────────────── */
.sticky-header th {
  position: sticky;
  top: 0;
  background: #f5f3ee;
  z-index: 10;
}

/* ─── Status badge pill ───────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

/* ─── Card hover lift ─────────────────────────────────────────────────── */
.card-link {
  transition: box-shadow 0.18s ease, transform 0.18s ease;
}
.card-link:hover {
  box-shadow: 0 6px 20px rgba(26, 58, 107, 0.10);
  transform: translateY(-2px);
}

/* ─── Inline HTMX spinner ─────────────────────────────────────────────── */
.htmx-indicator { display: none; }
.htmx-request .htmx-indicator,
.htmx-indicator.htmx-request { display: inline-flex; }

/* ─── Form field focus ring ────────────────────────────────────────────── */
input[type="text"]:focus,
input[type="email"]:focus,
input[type="date"]:focus,
input[type="datetime-local"]:focus,
input[type="number"]:focus,
input[type="url"]:focus,
input[type="search"]:focus,
input[type="password"]:focus,
input[type="tel"]:focus,
select:focus,
textarea:focus {
  outline: none;
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px #1a3a6b;
}

/* ─── High contrast mode — FacultyHub-specific selectors only; sidebar-link
   high-contrast rules already live in theme.css ──────────────────────── */
@media (forced-colors: active) {
  .badge { border: 1px solid ButtonText; }
  .card-link:hover { outline: 2px solid Highlight; }
}

/* ─── Approval queue row hover ─────────────────────────────────────────── */
.hover\:bg-stone-50:hover { background-color: #fafaf9; }

/* ─── Dashboard hero banner ────────────────────────────────────────────── */
.dashboard-hero {
  position: relative;
}

/* ─── Campus Map form/card/pill helpers ───────────────────────────────── */
/* Opt-in form styling via .form-input only. Bare element selectors
   (input[type="text"], select, …) used to live here too, but a plain
   element selector outranks a Tailwind utility class, so this rule's
   `padding` silently clobbered per-input utilities like `pl-9` — that's
   what pushed the search-bar placeholder text under the magnifying-glass
   icon. Every input/select/textarea in the app already carries its own
   Tailwind classes, so nothing relies on the old blanket styling. */
.form-input {
  display: block;
  width: 100%;
  border: 1px solid #d6d3d1;
  border-radius: 0.5rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  background-color: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-input:focus {
  outline: none;
  border-color: #2d5a9e;
  box-shadow: 0 0 0 3px rgba(45, 90, 158, 0.18);
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  background-color: #2d5a9e;
  color: #fff;
  font-weight: 600;
  border-radius: 0.5rem;
  padding: 0.5rem 1.25rem;
  font-size: 0.875rem;
  box-shadow: 0 1px 2px 0 rgba(15, 23, 42, 0.06);
  transition: background-color 0.15s ease, transform 0.15s ease;
}

.btn-primary:hover {
  background-color: #1e4687;
  transform: translateY(-1px);
}

/* Cards */
.card {
  background-color: #fff;
  border-radius: 0.75rem;
  border: 1px solid #e7e5e4;
  box-shadow: 0 1px 3px 0 rgba(15, 23, 42, 0.06), 0 1px 2px -1px rgba(15, 23, 42, 0.06);
}

/* Severity / status pills */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.125rem 0.625rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
}

/* ─── Dashboard lab switcher — navy/gold, matching the splash page's lab
   cards, scoped to this component only (rest of the app keeps the blue
   brand palette above). ──────────────────────────────────────────────── */
.lab-switcher {
  background: radial-gradient(125% 140% at 50% -20%, #18395a 0%, #102f4d 50%, #0a2138 100%);
  border: 1px solid rgba(176, 203, 232, 0.14);
}
.lab-switcher-label {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #9fb2c6;
  margin: 0 0 0.875rem;
}
.lab-switcher-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.875rem;
  border-radius: 0.875rem;
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.008));
  border: 1px solid rgba(176, 203, 232, 0.14);
  text-decoration: none;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.lab-switcher-card:hover {
  border-color: rgba(199, 154, 47, 0.5);
  transform: translateY(-2px);
}
.lab-switcher-icon {
  width: 2rem;
  height: 2rem;
  border-radius: 0.625rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(199, 154, 47, 0.12);
  border: 1px solid rgba(199, 154, 47, 0.28);
  color: #e3b73d;
}
.lab-switcher-name {
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 0.875rem;
  font-weight: 600;
  color: #f3eee1;
  line-height: 1.2;
}
