/* =========================================================
   Kingdom Connects — overrides.css  (v3.2 clean)
   Scope: Page-content polish + layout only.
   DO NOT style .site-header or .site-footer visuals here.
   ========================================================= */

/* ---------------------------------------
   CONTENT (safe to main area only)
   --------------------------------------- */
.page-content {
  /* Optional roomier default padding:
  --content-gap: clamp(16px, 3vw, 28px);
  padding: var(--content-gap);
  */
}

/* Typographic scale */
.page-content h1 { font-size: clamp(26px, 3.2vw, 36px); line-height: 1.15; margin: 0 0 12px; }
.page-content h2 { font-size: clamp(20px, 2.6vw, 28px); line-height: 1.2;  margin: 18px 0 10px; }
.page-content p  { margin: 10px 0; }

/* Spacing helpers */
.page-content .section { padding-block: clamp(12px, 2.4vw, 24px); }
.page-content .stack  { display: flex; flex-direction: column; gap: var(--stack-gap, 14px); }
.page-content .stack-lg { --stack-gap: 22px; }
.page-content .stack-xl { --stack-gap: 28px; }

/* Content grids */
.page-content .grid-2,
.page-content .grid-3 { display: grid; gap: clamp(12px, 2.2vw, 20px); }
@media (min-width: 720px) {
  .page-content .grid-2 { grid-template-columns: 1fr 1fr; }
  .page-content .grid-3 { grid-template-columns: repeat(3, 1fr); }
}

/* Content cards (NOT header/footer cards) */
.page-content .card{
  border-radius: 14px;
  padding: clamp(12px, 2vw, 18px);
  background: color-mix(in srgb, var(--panel-bg) 92%, transparent);
  border: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 10px 22px rgba(0,0,0,.22);
}
html[data-theme="light"] .page-content .card{
  border-color: rgba(0,0,0,.06);
  box-shadow: 0 10px 22px rgba(0,0,0,.10);
}

/* Content buttons */
.page-content .btn,
.page-content a.btn{
  display: inline-block;
  padding: 10px 14px;
  border-radius: 10px;
  text-decoration: none;
  border: 1px solid rgba(255,255,255,.15);
}
.page-content .btn.primary,
.page-content a.btn.primary{
  background: #f4c24d; color: #0b0f19; border-color: transparent; font-weight: 700;
}

/* ---------------------------------------
   SPACING UTILITIES
   --------------------------------------- */
.badge{ margin-left: 0.5rem; }
.card h4 + p,
.card h3 + p{ margin-top: 0.5rem; }

/* Margin utilities */
.m-0 { margin: 0; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.m-block { margin: 1rem 0; }
.m-block-sm { margin: 0.5rem 0; }
.m-block-lg { margin: 1.5rem 0; }
.m-block-xl { margin: 2rem 0; }
.mt-sm { margin-top: 0.25rem; }
.mt-md { margin-top: 0.5rem; }
.mr-sm { margin-right: 0.5rem; }
.mr-md { margin-right: 1rem; }

/* Padding utilities */
.p-0 { padding: 0; }
.p-sm { padding: 0.5rem; }
.p-md { padding: 1rem; }
.p-block-sm { padding: 0.5rem 0; }
.p-block-md { padding: 0.75rem 0; }
.p-block { padding: 1rem 0; }

/* Layout utilities */
.text-center { text-align: center; }
.flex-between { display: flex; justify-content: space-between; align-items: start; }
.grid-auto { display: grid; gap: 1rem; }
.grid-responsive { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; }
.hidden { display: none; }
.block { display: block; }
.inline-block { display: inline-block; }

/* Typography utilities */
.font-bold { font-weight: bold; }
.font-semibold { font-weight: 600; }
.text-sm { font-size: 0.85rem; }
.text-md { font-size: 0.9rem; }
.text-base { font-size: 1rem; }
.text-lg { font-size: 1.1rem; }
.text-xl { font-size: 1.2rem; }
.text-2xl { font-size: 1.3rem; }
.text-3xl { font-size: 1.5rem; }
.text-4xl { font-size: 1.8rem; }
.text-5xl { font-size: 2rem; }
.text-huge { font-size: 4rem; }
.opacity-50 { opacity: 0.5; }
.opacity-60 { opacity: 0.6; }
.opacity-70 { opacity: 0.7; }
.opacity-80 { opacity: 0.8; }
.opacity-90 { opacity: 0.9; }
.line-height-relaxed { line-height: 1.7; }

/* Component shells */
.card-highlight {
  padding: 1rem;
  background: rgba(255,215,0,0.1);
  border-left: 4px solid gold;
  border-radius: 0;
}
.card-highlight-rounded {
  padding: 1rem;
  background: rgba(255,215,0,0.05);
  border-radius: 8px;
}
.card-gradient {
  background: linear-gradient(135deg, rgba(255,215,0,0.15), rgba(184,134,11,0.15));
  border: 2px solid gold;
  text-align: center;
}
.card-gradient-strong {
  background: linear-gradient(135deg, rgba(255,215,0,0.1), rgba(184,134,11,0.1));
  border: 2px solid gold;
}
.status-message {
  padding: 1rem;
  text-align: center;
}
.status-message.empty {
  opacity: 0.5;
  padding: 2rem;
}
.pricing-headline {
  text-align: center;
  font-size: 1.8rem;
  margin: 1rem 0;
  color: gold;
  font-weight: bold;
}
.section-divider {
  padding: 0.75rem 0;
  border-bottom: 1px solid #333;
}
.section-divider-sm {
  padding: 0.5rem 0;
  border-bottom: 1px solid #333;
}

/* Button groups */
.button-row { display: flex; gap: 1rem; flex-wrap: wrap; }
.button-row > * { margin: 0; }

/* Color utilities */
.gold { color: #FFD700; }
.error-text { color: #f44336; }
.color-red { color: red; }
.color-ccc { color: #ccc; }
.gold-underline { color: gold; text-decoration: underline; }
.bg-error {
  background: #ff4444;
  border-color: #ff4444;
}
.border-orange { border: 2px solid #FFA500; }

/* Additional layout utilities */
.gap-sm { gap: 0.5rem; }
.gap-md { gap: 1rem; }
.flex-gap { display: flex; gap: 1rem; flex-wrap: wrap; }
.flex-gap-center { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.flex-gap-sm { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-align-center { display: flex; align-items: center; gap: 0.5rem; }
.flex-1 { flex: 1; }
.flex-1-min { flex: 1; min-width: 150px; }
.grid-3-cols { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0.5rem; }
.grid-auto-250 { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1rem; }

/* Text utilities */
.line-height-normal { line-height: 1.6; }
.italic { font-style: italic; }
.text-3xl-faded { font-size: 3rem; opacity: 0.6; }

/* Additional margin utilities */
.ml-md { margin-left: 1rem; }
.mx-auto { margin-left: auto; margin-right: auto; }
.m-block-hidden { margin: 1.5rem 0; display: none; }

/* Additional component shells */
.card-highlight-margin {
  background: rgba(255,215,0,0.1);
  border-radius: 8px;
  margin: 2rem 0;
  border-left: 4px solid gold;
}
.card-highlight-margin-md {
  background: rgba(255,215,0,0.1);
  border-radius: 8px;
  margin: 1.5rem 0;
  border-left: 4px solid gold;
}
.card-dark-margin {
  background: rgba(0,0,0,0.3);
  border-radius: 8px;
  margin: 2rem 0;
}

/* Link/button variants */
.link-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  background: rgba(255,255,255,0.1);
  text-decoration: none;
  font-size: 0.9rem;
  transition: background 0.2s;
}
.badge-inline {
  display: inline-block;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
}
.btn-lg { font-size: 1.1rem; padding: 1rem 2rem; }
.btn-xl { font-size: 1.2rem; padding: 1rem 3rem; }

/* List utilities */
.list-centered {
  list-style: none;
  padding: 0;
  text-align: left;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

/* Cursor utilities */
.cursor-pointer { cursor: pointer; }

/* Additional color utilities */
.gold-lg { color: #FFD700; font-size: 1.1rem; }
.success-green { color: #6f6; }
.error-red { color: #f66; }

/* Compact inline alerts for admin panels */
.alert-compact {
  display: block;
  margin-top: 4px;
  padding: 4px 8px;
  font-size: 0.75rem;
  border-radius: 4px;
  border-left: 3px solid;
}
.alert-compact-error {
  background: var(--status-error-bg);
  border-color: var(--status-error-border);
  color: var(--status-error-text);
}
.alert-compact-warning {
  background: var(--warning-card-bg);
  border-color: var(--warning-card-border);
  color: #cc8800;
}

/* Icon sizing (20px for small SVG icons) */
.icon-sm {
  width: 20px;
  height: 20px;
}

/* Content width utilities */
.max-w-500 { max-width: 500px; }
.max-w-700 { max-width: 700px; }
.max-w-800 { max-width: 800px; }
.mx-auto-content { max-width: 700px; margin: 0 auto; }
.mx-auto-content-lg { max-width: 800px; margin: 0 auto 1.5rem; }

/* Special component shells */
.card-auth {
  background: rgba(0,0,0,0.3);
  padding: 1.5rem;
  border-radius: 8px;
  margin: 2rem auto;
  max-width: 500px;
}
.card-gradient-alt {
  background: linear-gradient(135deg, rgba(255,215,0,0.1), rgba(255,215,0,0.05));
  border: 2px solid var(--gold);
}
.pro-badge-gradient {
  display: inline-block;
  background: linear-gradient(135deg, #FFD700, #FFA500);
  color: #000;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
}
.text-content-center {
  font-size: 1.1rem;
  line-height: 1.7;
  max-width: 700px;
  margin: 0 auto;
}
.text-content-italic {
  font-size: 1.1rem;
  line-height: 1.7;
  font-style: italic;
  max-width: 700px;
  margin: 0 auto;
}
.text-content-large {
  font-size: 1.15rem;
  line-height: 1.7;
  margin: 1rem 0 2rem;
}
.text-preformatted {
  white-space: pre-wrap;
  line-height: 1.7;
}

/* Complex component styles */
.section-title-gold {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 0.75rem;
}

.card-highlight {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1rem;
}

.icon-circle-gold {
  width: 60px;
  height: 60px;
  background: var(--gold);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--dark-blue);
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.8);
  z-index: 1000;
  overflow-y: auto;
  padding: 2rem 1rem;
}

.modal-overlay.hidden {
  display: none;
}

.modal-close-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: #f44336;
  color: white;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  cursor: pointer;
  font-size: 1.5rem;
  font-weight: bold;
}

.progress-bar-container {
  background: rgba(255,255,255,0.1);
  height: 20px;
  border-radius: 10px;
  overflow: hidden;
}

.w-20 { width: 20%; }
.w-40 { width: 40%; }
.w-60 { width: 60%; }

/* Flex utilities */
.flex-between-center { display: flex; align-items: center; justify-content: space-between; }
.inline-flex-sm { display: inline-flex; align-items: center; gap: 0.25rem; opacity: 0.7; font-size: 0.85rem; }

/* ---------------------------------------
   LAYOUT ONLY: sticky footer (robust)
   --------------------------------------- */
html, body { height: 100%; }
.page-wrap{
  display: flex; flex-direction: column;
  min-height: 100vh; min-height: 100dvh;
}
#header{ flex: 0 0 auto; }
main.main-content{ flex: 1 0 auto; min-height: 0; }
#footer{ flex: 0 0 auto; margin-top: auto; }

/* Fallback if a page ever lacks .page-wrap */
body:has(#header, #footer):not(:has(.page-wrap)){
  display: flex; flex-direction: column;
  min-height: 100vh; min-height: 100dvh;
}
body:has(#header, #footer):not(:has(.page-wrap)) main.main-content{ flex: 1 0 auto; }
body:has(#header, #footer):not(:has(.page-wrap)) #footer{ flex: 0 0 auto; margin-top: auto; }

/* Row alignment for settings (label | control) */
#settingsMenu .setting-row{
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin: 10px 0;
}
#settingsMenu .setting-row > span{ flex: 1; }
/* === Category Tiles === */
.category-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px 12px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  text-decoration: none;
  color: var(--text);
  transition: all 0.2s ease;
  min-height: 120px;
}
.category-tile:hover {
  background: rgba(255,215,0,0.08);
  border-color: var(--gold);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(255,215,0,0.15);
}
.category-icon {
  font-size: 2.5rem;
  margin-bottom: 8px;
}
.category-name {
  font-weight: 600;
  font-size: 0.9rem;
  text-align: center;
}

/* === Sticky Header === */
.site-header.sticky {
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

/* === Floating Back to Top Button === */
.back-to-top-float {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  background: var(--gold);
  color: var(--dark-blue);
  border-radius: 50%;
  display: grid;
  place-items: center;
  text-decoration: none;
  font-size: 1.5rem;
  font-weight: 800;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 50;
}
.back-to-top-float.visible {
  opacity: 1;
  pointer-events: auto;
}
.back-to-top-float:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 20px rgba(255,215,0,0.4);
}

/* === Social Share Buttons === */
.share-buttons {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}
.share-btn {
  padding: 10px 16px;
  border-radius: 8px;
  text-decoration: none;
  color: white;
  font-weight: 600;
  font-size: 0.875rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.share-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.share-btn.facebook { background: #1877F2; }
.share-btn.twitter { background: #1DA1F2; }
.share-btn.email { background: #EA4335; }
.share-btn.copy { background: var(--gold); color: var(--dark-blue); }

/* === Toggle Switches === */
.toggle-wrapper {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  margin: 12px 0;
  border-radius: 8px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  transition: background 0.2s ease;
}
.toggle-wrapper:hover {
  background: rgba(255,255,255,0.06);
}
html[data-theme="light"] .toggle-wrapper {
  background: rgba(0,0,0,0.02);
  border-color: rgba(0,0,0,0.08);
}
html[data-theme="light"] .toggle-wrapper:hover {
  background: rgba(0,0,0,0.04);
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 32px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #555;
  transition: .3s;
  border-radius: 32px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 24px;
  width: 24px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
  background-color: var(--gold);
}

.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(28px);
}

.toggle-label {
  flex: 1;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.toggle-description {
  display: block;
  font-size: 0.875rem;
  opacity: 0.7;
  font-weight: 400;
  margin-top: 4px;
}

/* === Edit Listing Form Spacing === */
#businessForm .card {
  margin-bottom: 24px;
}

#businessForm .card > div:not(.toggle-wrapper):not(.grid-col-2):not(.grid-col-3) {
  margin-bottom: 18px;
}

#businessForm .card h3 {
  margin-bottom: 20px;
}
