/* Custom styles for Mormon Metrics Survey Tracker */

:root {
  --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
  font-family: var(--font-sans);
  min-height: 100vh;
}

.preview-banner {
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.75rem;
  text-align: center !important;
}

.preview-banner p {
  margin: 0;
  font-size: 0.925rem;
  line-height: 1.55;
  color: var(--theme-foreground);
  text-align: center !important;
}

/* KPI Stat Cards Styling */

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.kpi-card {
  border-radius: 12px;
  padding: 1.35rem 1.5rem;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}


.kpi-card:hover {
  transform: translateY(-2px);
}

.kpi-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.kpi-icon {
  font-size: 1rem;
  opacity: 0.9;
}

.kpi-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.075em;
  color: #94a3b8;
}

.kpi-value-container {
  margin-bottom: 0.85rem;
  display: flex;
  align-items: baseline;
}

.kpi-value {
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.03em;
  background: linear-gradient(180deg, #ffffff 0%, #cbd5e1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.text-rose {
  background: linear-gradient(180deg, #fda4af 0%, #f43f5e 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.text-emerald {
  background: linear-gradient(180deg, #a7f3d0 0%, #10b981 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.kpi-unit {
  font-size: 1.25rem;
  font-weight: 600;
  margin-left: 0.2rem;
  color: #94a3b8;
}

.kpi-footer {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.825rem;
  flex-wrap: wrap;
}

.kpi-footer-sub {
  color: #64748b;
  font-size: 0.8rem;
}

.kpi-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  font-size: 0.775rem;
  font-weight: 500;
}

/* Center Dashboard Layout */
:root {
  --sidebar-width: 0px !important;
  --toc-width: 0px !important;
}

.observablehq-center, #observablehq-center, #observablehq-header, #observablehq-footer {
  margin-left: auto !important;
  margin-right: auto !important;
  max-width: 1152px !important;
  padding-left: 0px !important;
  padding-right: 0px !important;
}

#observablehq-main {
  padding-left: 0px !important;
  padding-right: 0px !important;
}

.preview-banner {
  text-align: center;
}

/* Consolidated Control Panel Styles */

.compact-controls .observablehq-input {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  font-family: var(--font-sans) !important;
}

.compact-controls .observablehq-input > span {
  font-size: 0.75rem !important;
  font-weight: 600 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.05em !important;
  color: #94a3b8 !important;
  margin-bottom: 0.5rem !important;
  border: none !important;
  width: auto !important;
}

.compact-controls .observablehq-input > div {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)) !important;
  gap: 0.4rem 1rem !important;
  padding-top: 0.15rem !important;
}

.compact-controls .observablehq-input label {
  margin: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.35rem !important;
  font-size: 0.85rem !important;
  cursor: pointer !important;
}

/* Right-aligned premium caption styling for plots */
figure {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
}

figure figcaption {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  margin-left: auto !important;
  margin-right: 0 !important;
  text-align: right !important;
  font-size: 0.725rem !important;
  color: #94a3b8 !important;
  opacity: 0.8 !important;
  margin-top: 0.5rem !important;
  font-style: italic !important;
}

/* Premium KPI Chip text colors (without altering the box design) */
.kpi-chip-rose {
  color: #fda4af !important;
}
.kpi-chip-emerald {
  color: #a7f3d0 !important;
}

/* Disable row selection and hide checkbox column in Inputs.table */
.no-select-table thead tr th:first-child,
.no-select-table tbody tr td:first-child {
  display: none !important;
}

.no-select-table tbody {
  pointer-events: none;
}

/* Prevent text highlighting/selection on the table and children */
.no-select-table,
.no-select-table * {
  -webkit-user-select: none !important;
  -moz-user-select: none !important;
  -ms-user-select: none !important;
  user-select: none !important;
  cursor: default !important;
}
/* Prevent printing/PDF exports of the page */
@media print {
  html, body {
    background: #0f172a !important;
    color: #ffffff !important;
  }
  body > * {
    display: none !important;
  }
  body::before {
    content: "Printing and PDF export is disabled on Mormon Metrics to protect data integrity.";
    display: block !important;
    text-align: center;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 1.5rem;
    font-weight: bold;
    color: #ef4444;
    padding: 4rem 2rem;
    margin: auto;
  }
}
