/* ==========================================================================
   508 Ministry Live Demos - Flagship Coastal Color Upgrade
   Self-Hosted Cormorant + Figtree (SIL OFL 1.1) | WCAG AA/AAA Coastal Theme
   Works cleanly across Church Operations, Food Bank, Youth, Harvest Hope, Helix
   ========================================================================== */

@import url("/fonts/cormorant-figtree.css");

:root {
  --fdu-navy-950: #071429;
  --fdu-navy-900: #0B1B3A;
  --fdu-navy-800: #112C50;
  --fdu-teal-700: #0F766E;
  --fdu-teal-500: #14B8A6;
  --fdu-teal-100: #E2F7F4;
  --fdu-gold-600: #9C731D;
  --fdu-gold-500: #D4A84B;
  --fdu-gold-300: #F0D28B;
  --fdu-gold-100: #FDF6E4;
  --fdu-ivory: #FCF8F0;
  --fdu-ink: #0F2238;
  --fdu-muted: #455B73;
  --fdu-border: #D6E3EE;
  --fdu-emerald: #0D7A5F;
  --fdu-emerald-bg: #E5F6EE;
  --fdu-sapphire: #1D4ED8;
  --fdu-sapphire-bg: #E9F0FF;
  --fdu-coral: #BE123C;
  --fdu-coral-bg: #FFE8EE;
  --fdu-side-w: 280px;
  --fdu-side-collapsed: 78px;
}

html, body {
  font-family: "Figtree", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
  color: var(--fdu-ink) !important;
  background:
    radial-gradient(circle at 10% 4%, rgba(20, 184, 166, 0.09) 0%, transparent 36%),
    radial-gradient(circle at 92% 8%, rgba(212, 168, 75, 0.12) 0%, transparent 40%),
    linear-gradient(180deg, #FCF8F0 0%, #F4F9FC 55%, #FCF8F0 100%) !important;
  overflow-x: clip !important;
}

h1, h2, h3, .fdu-serif {
  font-family: "Cormorant", Georgia, "Times New Roman", serif !important;
}

/* Flagship Coastal Demo Banner Harmonization */
.demo-banner {
  background: linear-gradient(96deg, #071429 0%, #0B1B3A 48%, #0E4D5A 100%) !important;
  color: #FFFDF7 !important;
  border-bottom: 1.5px solid rgba(212, 168, 75, 0.5) !important;
  box-shadow: 0 4px 18px rgba(7, 20, 41, 0.22) !important;
  font-family: "Figtree", sans-serif !important;
}

.demo-banner a {
  color: #F0D28B !important;
  font-weight: 700 !important;
}

/* Flagship Coastal Deep Ocean Sidebar (targets vanilla .sidebar AND Tailwind aside) */
.sidebar,
body > div > aside,
body aside.fixed {
  background:
    radial-gradient(circle at 18% 0%, rgba(20, 184, 166, 0.22) 0%, transparent 46%),
    radial-gradient(circle at 86% 96%, rgba(212, 168, 75, 0.16) 0%, transparent 42%),
    linear-gradient(180deg, #07152B 0%, #0B1B3A 46%, #0B2E48 100%) !important;
  color: #EAF3FA !important;
  border-right: 1px solid rgba(212, 168, 75, 0.34) !important;
  box-shadow: 4px 0 26px rgba(7, 20, 41, 0.18) !important;
  transition: width 0.26s cubic-bezier(0.22, 1, 0.36, 1), transform 0.26s ease !important;
  overflow-x: hidden !important;
}

.sidebar *,
body > div > aside *,
body aside.fixed * {
  border-color: rgba(212, 168, 75, 0.22);
}

.sidebar h1, .sidebar h2, .sidebar .logo-text, .sidebar .sidebar-title,
body > div > aside h1, body > div > aside span, body aside.fixed h1 {
  color: #FFFDF7 !important;
  -webkit-text-fill-color: #FFFDF7 !important;
}

.sidebar p, .sidebar small, .sidebar .sidebar-subtitle,
body > div > aside p {
  color: #B4CFE2 !important;
}

/* Collapse Button inside Sidebar Header */
.fdu-collapse-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(212, 168, 75, 0.22);
  background: rgba(7, 20, 41, 0.28);
}

.fdu-collapse-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #5EEAD4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fdu-collapse-btn {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: 1px solid rgba(212, 168, 75, 0.42);
  background: rgba(255, 255, 255, 0.08);
  color: #F0D28B;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.18s ease, color 0.18s ease;
}

.fdu-collapse-btn:hover {
  background: rgba(20, 184, 166, 0.25);
  color: #FFFFFF;
}

.fdu-collapse-btn svg {
  width: 16px;
  height: 16px;
  transition: transform 0.24s ease;
}

body.fdu-collapsed .fdu-collapse-btn svg {
  transform: rotate(180deg);
}

/* Collapsed Desktop Rail Mode */
body.fdu-collapsed .sidebar,
body.fdu-collapsed aside.fixed,
body.fdu-collapsed > div > aside {
  width: var(--fdu-side-collapsed) !important;
  min-width: var(--fdu-side-collapsed) !important;
}

body.fdu-collapsed .main-content,
body.fdu-collapsed .lg\:pl-64,
body.fdu-collapsed .lg\:pl-72 {
  margin-left: var(--fdu-side-collapsed) !important;
  padding-left: 0 !important;
}

body.fdu-collapsed .fdu-collapse-label,
body.fdu-collapsed .fdu-nav-text,
body.fdu-collapsed .fdu-nav-pill,
body.fdu-collapsed .fdu-suite-head,
body.fdu-collapsed .sidebar-header p,
body.fdu-collapsed .sidebar-header h1,
body.fdu-collapsed .sidebar-header h2,
body.fdu-collapsed .sidebar-logo-text,
body.fdu-collapsed .sidebar-footer {
  display: none !important;
}

body.fdu-collapsed .fdu-collapse-bar {
  justify-content: center;
  padding: 10px 6px;
}

/* Unified Nav Item Styling + Animated Glass Icon Tiles */
.fdu-suite-head {
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #7DD3FC !important;
  padding: 14px 14px 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.fdu-suite-head::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(212, 168, 75, 0.4), transparent);
}

.fdu-nav-item,
.sidebar .nav-item,
body aside nav a {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  padding: 8px 12px !important;
  margin: 3px 8px !important;
  border-radius: 12px !important;
  border: 1px solid transparent !important;
  border-left: 1px solid transparent !important;
  background: rgba(255, 255, 255, 0.03) !important;
  color: #E6F0FA !important;
  font-size: 0.86rem !important;
  font-weight: 600 !important;
  text-decoration: none !important;
  cursor: pointer;
  width: calc(100% - 16px) !important;
  text-align: left;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.16s ease, box-shadow 0.18s ease !important;
}

.fdu-nav-item:hover,
.sidebar .nav-item:hover,
body aside nav a:hover {
  background: linear-gradient(135deg, rgba(20, 184, 166, 0.2), rgba(212, 168, 75, 0.14)) !important;
  border-color: rgba(94, 234, 212, 0.36) !important;
  color: #FFFFFF !important;
  transform: translateX(2px);
}

.fdu-nav-item.fdu-active,
.sidebar .nav-item.active,
body aside nav a.bg-primary-50,
body aside nav a.bg-blue-50 {
  background: linear-gradient(135deg, rgba(20, 184, 166, 0.28), rgba(212, 168, 75, 0.24)) !important;
  border-color: rgba(240, 210, 139, 0.72) !important;
  color: #FFFFFF !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 6px 16px rgba(7, 20, 41, 0.34) !important;
}

body.fdu-collapsed .fdu-nav-item,
body.fdu-collapsed .sidebar .nav-item,
body.fdu-collapsed aside nav a {
  justify-content: center !important;
  padding: 7px 4px !important;
  margin: 4px 8px !important;
  transform: none !important;
}

.fdu-nav-text {
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fdu-nav-pill {
  flex-shrink: 0;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(212, 168, 75, 0.22);
  color: #F6DF9F;
  border: 1px solid rgba(212, 168, 75, 0.4);
}

.fdu-nav-pill.teal {
  background: rgba(20, 184, 166, 0.24);
  color: #99F6E4;
  border-color: rgba(94, 234, 212, 0.44);
}

/* Frosted Glass Animated SVG Icon Tile */
.fdu-ico-tile {
  position: relative;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0.05) 55%, rgba(7, 20, 41, 0.35)), rgba(30, 74, 118, 0.56);
  box-shadow: inset 0 0 0 1px rgba(240, 210, 139, 0.4), 0 4px 10px rgba(4, 12, 26, 0.4);
  color: #F3D992;
}

.fdu-ico-tile[data-tone="teal"] {
  background: linear-gradient(160deg, rgba(94, 234, 212, 0.34), rgba(15, 118, 110, 0.5));
  color: #99F6E4;
}
.fdu-ico-tile[data-tone="gold"] {
  background: linear-gradient(160deg, rgba(240, 210, 139, 0.34), rgba(156, 115, 29, 0.52));
  color: #FEF0C7;
}
.fdu-ico-tile[data-tone="sapphire"] {
  background: linear-gradient(160deg, rgba(125, 211, 252, 0.32), rgba(29, 78, 216, 0.5));
  color: #BAE6FD;
}
.fdu-ico-tile[data-tone="emerald"] {
  background: linear-gradient(160deg, rgba(110, 231, 183, 0.32), rgba(13, 122, 95, 0.52));
  color: #A7F3D0;
}
.fdu-ico-tile[data-tone="coral"] {
  background: linear-gradient(160deg, rgba(253, 164, 175, 0.32), rgba(190, 18, 60, 0.48));
  color: #FECDD3;
}

.fdu-ico-tile::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 25%, rgba(255, 246, 210, 0.52) 50%, transparent 75%);
  background-size: 240% 100%;
  background-position: 140% 0;
  opacity: 0;
  pointer-events: none;
}

.fdu-ico-tile svg {
  width: 17px;
  height: 17px;
  display: block;
}

.fdu-nav-item:hover > .fdu-ico-tile svg,
.fdu-nav-item.fdu-active > .fdu-ico-tile svg,
.sidebar .nav-item:hover > .fdu-ico-tile svg,
.sidebar .nav-item.active > .fdu-ico-tile svg,
aside nav a:hover > .fdu-ico-tile svg {
  animation: var(--fdu-anim, fduBob) 2s ease-in-out infinite;
}

.fdu-nav-item:hover > .fdu-ico-tile::after,
.fdu-nav-item.fdu-active > .fdu-ico-tile::after,
.sidebar .nav-item:hover > .fdu-ico-tile::after,
.sidebar .nav-item.active > .fdu-ico-tile::after {
  animation: fduGlint 3.2s ease-in-out 0.15s infinite;
}

@keyframes fduGlint {
  0% { background-position: 140% 0; opacity: 0; }
  14% { opacity: 0.9; }
  56% { background-position: -40% 0; opacity: 0.9; }
  66%, 100% { background-position: -40% 0; opacity: 0; }
}
@keyframes fduBob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-1.8px) scale(1.06); }
}
@keyframes fduTilt {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-7deg); }
  65% { transform: rotate(6deg); }
}
@keyframes fduPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

@media (prefers-reduced-motion: reduce) {
  .fdu-ico-tile::after, .fdu-ico-tile svg { animation: none !important; }
}

/* Harmonize Cards & Headers across Demo Dashboards */
.main-content, main {
  background: transparent !important;
}

.stat-card, .card, .metric-card, .dashboard-card {
  background: rgba(255, 255, 255, 0.96) !important;
  border: 1.5px solid #D7E5F0 !important;
  border-radius: 18px !important;
  box-shadow: 0 6px 20px rgba(11, 27, 58, 0.06) !important;
}

/* Floating Coastal Mobile Drawer Button */
.fdu-mobile-fab {
  display: none;
  position: fixed;
  bottom: 18px;
  left: 16px;
  z-index: 10002;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1.5px solid rgba(212, 168, 75, 0.65);
  background: linear-gradient(135deg, #0B1B3A, #0F766E);
  color: #FFFDF7;
  font-size: 0.84rem;
  font-weight: 700;
  box-shadow: 0 10px 26px rgba(7, 20, 41, 0.34);
  cursor: pointer;
}

.fdu-mobile-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(7, 20, 41, 0.56);
  backdrop-filter: blur(4px);
  z-index: 9998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

body.fdu-mobile-open .fdu-mobile-backdrop {
  opacity: 1;
  pointer-events: auto;
}

/* Flagship Injected Panel Host */
#fduPanelHost {
  padding: 24px;
  max-width: 1220px;
  margin: 0 auto;
}

.fdu-view {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.fdu-banner {
  border-radius: 22px;
  padding: 26px 28px;
  background:
    radial-gradient(circle at 90% 16%, rgba(20, 184, 166, 0.3) 0%, transparent 46%),
    radial-gradient(circle at 8% 92%, rgba(212, 168, 75, 0.22) 0%, transparent 48%),
    linear-gradient(132deg, #0B1B3A 0%, #10345B 54%, #0D5964 100%);
  border: 1.5px solid rgba(212, 168, 75, 0.48);
  color: #FFFFFF;
  box-shadow: 0 20px 44px rgba(7, 20, 41, 0.22);
}

.fdu-banner-kicker {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(20, 184, 166, 0.24);
  border: 1px solid rgba(94, 234, 212, 0.45);
  color: #99F6E4;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.fdu-banner h2 {
  color: #FFFFFF !important;
  font-size: clamp(1.75rem, 3vw, 2.4rem);
  font-weight: 600;
  margin: 0 0 8px;
}

.fdu-banner p {
  color: #DDEBF6;
  margin: 0;
  max-width: 780px;
  font-size: 0.96rem;
  line-height: 1.58;
}

.fdu-kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
}

.fdu-kpi {
  background: #FFFFFF;
  border-radius: 16px;
  padding: 18px 20px;
  border: 1.5px solid #D7E5F0;
  box-shadow: 0 4px 14px rgba(11, 27, 58, 0.06);
  position: relative;
  overflow: hidden;
}

.fdu-kpi::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, #14B8A6, #D4A84B);
}

.fdu-kpi-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--fdu-muted);
}

.fdu-kpi-val {
  font-family: "Cormorant", Georgia, serif;
  font-size: 2.05rem;
  font-weight: 600;
  color: var(--fdu-navy-900);
  margin: 4px 0;
  line-height: 1.1;
}

.fdu-kpi-sub {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--fdu-teal-700);
}

.fdu-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.fdu-panel {
  background: #FFFFFF;
  border: 1.5px solid #D7E5F0;
  border-radius: 20px;
  padding: 22px 24px;
  box-shadow: 0 4px 16px rgba(11, 27, 58, 0.06);
}

.fdu-panel h3 {
  font-size: 1.48rem;
  font-weight: 600;
  color: var(--fdu-navy-900);
  margin: 0 0 12px;
}

.fdu-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
}

.fdu-btn.gold {
  background: linear-gradient(135deg, #E4BE63, #C99832);
  color: #0B1B3A;
}

.fdu-btn.navy {
  background: linear-gradient(135deg, #0B1B3A, #0F6770);
  color: #FFFFFF;
}

.fdu-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.fdu-chip {
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid #BFD9EA;
  background: #F2F9FC;
  color: var(--fdu-navy-900);
  font-size: 0.81rem;
  font-weight: 600;
  cursor: pointer;
}

.fdu-chip.active, .fdu-chip:hover {
  background: #0B1B3A;
  border-color: #0B1B3A;
  color: #FFFFFF;
}

.fdu-answer {
  background: linear-gradient(160deg, #F7FBFD, #FCF8EE);
  border: 1.5px solid #CBE0EE;
  border-radius: 14px;
  padding: 15px 17px;
  font-size: 0.91rem;
  line-height: 1.6;
  color: var(--fdu-ink);
}

.fdu-app-showcase {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.fdu-phone-frame {
  background: linear-gradient(160deg, #0B1B3A, #123B54);
  padding: 11px;
  border-radius: 26px;
  border: 2px solid rgba(212, 168, 75, 0.55);
  box-shadow: 0 18px 40px rgba(7, 20, 41, 0.25);
}

.fdu-phone-frame img {
  width: 100%;
  border-radius: 16px;
  display: block;
  aspect-ratio: 9 / 16;
  object-fit: cover;
}

.fdu-thumbs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.fdu-thumb {
  padding: 7px;
  border-radius: 12px;
  border: 1.5px solid #D3E2EE;
  background: #F8FBFD;
  text-align: left;
  cursor: pointer;
}

.fdu-thumb.active, .fdu-thumb:hover {
  border-color: #14B8A6;
  background: #E7F8F5;
}

.fdu-thumb img {
  width: 100%;
  height: 74px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 5px;
}

.fdu-thumb span {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--fdu-navy-900);
}

.fdu-partner-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(265px, 1fr));
  gap: 15px;
  margin-top: 16px;
}

.fdu-partner-card {
  background: #FFFFFF;
  border: 1.5px solid #D7E5F0;
  border-radius: 16px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.fdu-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
}

.fdu-badge.teal { background: #E2F7F4; color: #0F766E; }
.fdu-badge.gold { background: #FDF6E4; color: #9C731D; }
.fdu-badge.emerald { background: #E5F6EE; color: #0D7A5F; }

@media (max-width: 960px) {
  .fdu-mobile-fab {
    display: inline-flex;
  }

  .fdu-collapse-bar {
    display: none !important;
  }

  .sidebar,
  body aside.fixed,
  body > div > aside {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    bottom: 0 !important;
    width: min(296px, 85vw) !important;
    height: 100vh !important;
    transform: translateX(-105%) !important;
    z-index: 10000 !important;
    display: flex !important;
    flex-direction: column !important;
  }

  body.fdu-mobile-open .sidebar,
  body.fdu-mobile-open aside.fixed,
  body.fdu-mobile-open > div > aside {
    transform: translateX(0) !important;
  }

  .main-content,
  .lg\:pl-64,
  .lg\:pl-72 {
    margin-left: 0 !important;
    padding-left: 0 !important;
    width: 100% !important;
  }

  .fdu-grid-2,
  .fdu-app-showcase {
    grid-template-columns: 1fr !important;
  }

  .fdu-phone-frame {
    max-width: 260px;
    margin: 0 auto;
  }

  .fdu-thumbs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #fduPanelHost {
    padding: 14px;
  }
}
