/*
    PROJECT:    Foundation360: Z-Bridges Property Management Business Architecture
    FILE:       foundation-theme.css
    PURPOSE:    Techno-Utopian Bioluminescence — a high-tech, futuristic aesthetic
                with zero absolute black. Glassmorphism cards, neon accents,
                and cosmic depth on a deep indigo-blue canvas.
    CATEGORY:   Global Theme (All Artifacts)
    AUTHOR:     Zaphyr Zur Pomicpic
    VERSION:    3.0.0 — The Bioluminescence Upgrade
    CREATED:    2026-05-01
*/

/* ============================================================
   CUSTOM PROPERTIES — The Bioluminescent Palette
   ============================================================ */
:root {
  /* --- Cosmic Canvas (Zero Absolute Black) --- */
  --cosmic-deep:      #060B1C;    /* deepest void – a fathomless indigo, not black */
  --cosmic-base:      #0B132B;    /* main backdrop – interstellar midnight blue */
  --nebula-surface:   #131F3A;    /* card & panel base */
  --nebula-elevated:  #192845;    /* hover/active elevation */

  /* --- Glassmorphism Surfaces --- */
  --glass-bg:         rgba(19, 31, 58, 0.62);
  --glass-bg-hover:   rgba(25, 40, 69, 0.78);
  --glass-border:     rgba(0, 229, 255, 0.18);
  --glass-blur:       18px;
  --glass-saturate:   180%;

  /* --- Neon Accents --- */
  --electric-cyan:     #00E5FF;    /* primary interactive glow */
  --electric-cyan-dim: rgba(0, 229, 255, 0.18);
  --electric-green:    #00FF99;    /* success / CTA highlight */
  --electric-green-dim:rgba(0, 255, 153, 0.18);
  --polished-gold:     #D4AF37;    /* prestige / emphasis */
  --polished-gold-dim: rgba(212, 175, 55, 0.2);
  --violet-external:   #8B5CF6;    /* external brand voice */
  --violet-external-dim: rgba(139, 92, 246, 0.18);

  /* --- Typography --- */
  --text-bright:       #F0F4FB;
  --text-body:         #B8C4DB;
  --text-muted:        #6E7D9E;

  /* --- Borders & Shadows --- */
  --border-subtle:     rgba(110, 125, 158, 0.2);
  --border-glow:       rgba(0, 229, 255, 0.35);
  --shadow-card:       0 8px 32px rgba(0, 0, 0, 0.45);
  --shadow-elevate:    0 20px 50px rgba(0, 0, 0, 0.55);
  --glow-cyan:         0 0 18px rgba(0, 229, 255, 0.25);
  --glow-green:        0 0 18px rgba(0, 255, 153, 0.25);

  /* --- Document Mode (Leases / Handbooks) --- */
  --doc-teal:          #0F766E;
  --doc-bg:            #F8FAFC;
  --doc-text:          #1E293B;

  /* --- Misc --- */
  --radius-sm:         8px;
  --radius-md:         12px;
  --radius-lg:         16px;
  --transition-speed:  0.28s;
}

/* ============================================================
   GLOBAL RESETS & BASE
   ============================================================ */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background-color: var(--cosmic-base);
  color: var(--text-body);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-weight: 400;
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background-color: var(--electric-cyan-dim);
  color: var(--electric-cyan);
}

a {
  color: var(--electric-cyan);
  text-decoration: none;
  transition: color var(--transition-speed) ease,
              text-shadow var(--transition-speed) ease;
}
a:hover {
  color: var(--electric-green);
  text-shadow: 0 0 10px var(--electric-green-dim);
}

img { max-width: 100%; height: auto; display: block; }

.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px;
}

h1, h2, h3, h4, h5, h6 { color: var(--text-bright); font-weight: 600; }

/* ============================================================
   NAVBAR — Glassmorphic Control Bar
   ============================================================ */
.navbar {
  background: rgba(6, 11, 28, 0.82);
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  border-bottom: 1px solid var(--glass-border);
  padding: 14px 0;
  position: sticky;
  top: 0;
  z-index: 1000;
}
.navbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.logo {
  display: flex;
  align-items: center;
  gap: 14px;
}
.logo img {
  height: 32px;
  width: auto;
  filter: drop-shadow(0 0 6px rgba(0, 229, 255, 0.4));
}
.logo-icon {
  font-size: 1.7rem;
  color: var(--electric-cyan);
  filter: drop-shadow(0 0 8px var(--electric-cyan-dim));
}
.logo-text {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-bright);
  letter-spacing: 0.4px;
}
.nav-links { display: flex; gap: 22px; align-items: center; }
.nav-links a {
  font-weight: 500;
  font-size: 0.95rem;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  transition: background var(--transition-speed),
              color var(--transition-speed);
}
.nav-links a:hover {
  background: var(--electric-cyan-dim);
  color: var(--electric-cyan);
}

/* ============================================================
   NARRATIVE HEADER
   ============================================================ */
.arch-header {
  padding: 70px 0 40px;
  border-bottom: 1px solid var(--border-glow);
  background: radial-gradient(ellipse at 50% 0%, rgba(0, 229, 255, 0.06) 0%, transparent 65%);
}
.arch-header h1 {
  color: var(--text-bright);
  font-size: clamp(2rem, 5vw, 2.8rem);
  margin-bottom: 18px;
  font-weight: 700;
  letter-spacing: -0.3px;
}
.executive-summary {
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-left: 4px solid var(--electric-green);
  padding: 24px 28px;
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
  margin-bottom: 32px;
  box-shadow: var(--shadow-card);
}
.executive-summary p {
  margin-bottom: 10px;
  color: var(--text-body);
  font-size: 1.02rem;
  line-height: 1.7;
}
.executive-summary strong { color: var(--electric-green); font-weight: 600; }

/* ============================================================
   TAB CONTROLS — Bioluminescent Toggle Bar
   ============================================================ */
.controls-wrapper {
  display: flex;
  gap: 10px;
  margin: 30px 0 0;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--electric-cyan-dim) transparent;
}
.controls-wrapper::-webkit-scrollbar { height: 4px; }
.controls-wrapper::-webkit-scrollbar-thumb {
  background: var(--electric-cyan-dim);
  border-radius: 4px;
}

.tab-btn {
  background: rgba(11, 19, 43, 0.55);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
  padding: 11px 22px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 500;
  font-size: 0.92rem;
  font-family: 'Inter', sans-serif;
  white-space: nowrap;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}
.tab-btn::after {
  content: '';
  position: absolute;
  bottom: 0; left: 50%; transform: translateX(-50%);
  width: 0; height: 2px;
  background: var(--electric-cyan);
  transition: width 0.3s ease;
}
.tab-btn:hover {
  border-color: var(--electric-cyan);
  color: var(--text-bright);
  background: var(--electric-cyan-dim);
}
.tab-btn:hover::after { width: 60%; }
.tab-btn.active {
  background: var(--electric-cyan);
  color: var(--cosmic-deep);
  border-color: var(--electric-cyan);
  font-weight: 600;
  box-shadow: var(--glow-cyan);
}
.tab-btn.active::after { display: none; }

/* ============================================================
   EXPLORER CANVAS
   ============================================================ */
#explorer-canvas {
  padding: 40px 0 70px;
  min-height: 500px;
  transition: opacity 0.3s ease;
}

/* ============================================================
   GRID LAYOUT — Responsive Card Grid
   ============================================================ */
.grid-layout {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 22px;
}

/* ============================================================
   DATA CARD — Bioluminescent Glass Panel
   ============================================================ */
.data-card {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-lg);
  padding: 26px;
  transition: all 0.35s ease;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-card);
}
.data-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 2px;
  background: linear-gradient(90deg, transparent, var(--electric-cyan), transparent);
  opacity: 0;
  transition: opacity 0.4s ease;
}
.data-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(0,229,255,0.3), transparent 40%, transparent 60%, rgba(0,255,153,0.2));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.4s ease;
}
.data-card:hover {
  transform: translateY(-5px);
  border-color: var(--glass-border);
  box-shadow: var(--shadow-elevate), var(--glow-cyan);
  background: var(--glass-bg-hover);
}
.data-card:hover::before { opacity: 1; }
.data-card:hover::after { opacity: 1; }

.data-card h3 {
  color: var(--text-bright);
  margin-bottom: 10px;
  font-size: 1.18rem;
  font-weight: 600;
}
.data-card p {
  color: var(--text-body);
  font-size: 0.94rem;
  line-height: 1.6;
}

/* ============================================================
   BADGES — Telemetry-Style Pills
   ============================================================ */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 15px;
  font-size: 0.72rem;
  font-weight: 600;
  margin-bottom: 14px;
  margin-right: 7px;
  font-family: 'Inter', ui-monospace, SFMono-Regular, monospace;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}
.badge.policy {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-bright);
  border: 1px solid rgba(255, 255, 255, 0.18);
}
.badge.procedure {
  background: var(--electric-cyan-dim);
  color: var(--electric-cyan);
  border: 1px solid rgba(0, 229, 255, 0.3);
}
.badge.guide {
  background: var(--electric-green-dim);
  color: var(--electric-green);
  border: 1px solid rgba(0, 255, 153, 0.3);
}
.badge.process {
  background: var(--polished-gold-dim);
  color: var(--polished-gold);
  border: 1px solid rgba(212, 175, 55, 0.3);
}
.badge.internal {
  background: rgba(0, 229, 255, 0.1);
  color: var(--electric-cyan);
  border: 1px solid rgba(0, 229, 255, 0.28);
}
.badge.external {
  background: var(--violet-external-dim);
  color: var(--violet-external);
  border: 1px solid rgba(139, 92, 246, 0.28);
}

/* ============================================================
   DOMAIN ACCORDION — Expandable Hierarchy
   ============================================================ */
.domain-section { margin-bottom: 40px; }
.domain-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  cursor: pointer;
  transition: all 0.3s ease;
  user-select: none;
  box-shadow: var(--shadow-card);
}
.domain-header:hover {
  border-color: var(--electric-cyan);
  box-shadow: var(--glow-cyan);
}
.domain-header h2 {
  color: var(--electric-cyan);
  font-size: 1.35rem;
  font-weight: 600;
  margin: 0;
}
.domain-header .domain-icon {
  font-size: 1.6rem;
  color: var(--electric-cyan);
  margin-right: 14px;
}
.domain-header .expand-icon {
  font-size: 1.4rem;
  color: var(--electric-cyan);
  transition: transform 0.35s ease;
  min-width: 28px;
  text-align: center;
}
.domain-header.open .expand-icon { transform: rotate(45deg); }
.domain-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.domain-body.open { max-height: 3000px; }
.domain-body-inner {
  padding: 18px 0 0;
}
.domain-body-inner .domain-desc {
  color: var(--text-body);
  margin-bottom: 20px;
  font-size: 1rem;
  padding: 0 6px;
}

/* ============================================================
   HANDOFF FLOW — Process Relay Visualization
   ============================================================ */
.handoff-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 18px;
}
.handoff-card {
  border-left: 3px solid var(--electric-cyan);
}
.handoff-flow {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.handoff-node {
  background: var(--electric-cyan-dim);
  color: var(--electric-cyan);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 600;
  border: 1px solid rgba(0, 229, 255, 0.25);
}
.handoff-arrow {
  color: var(--electric-green);
  font-size: 1.1rem;
  font-weight: 700;
}
.handoff-trigger {
  font-size: 0.85rem;
  color: var(--polished-gold);
  font-weight: 500;
  margin-bottom: 8px;
}

/* ============================================================
   TIMELINE — Horizontal Scroll Roadmap
   ============================================================ */
.timeline-track {
  display: flex;
  gap: 0;
  overflow-x: auto;
  padding: 20px 0 40px;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
  scrollbar-color: var(--electric-cyan-dim) transparent;
}
.timeline-track::-webkit-scrollbar { height: 5px; }
.timeline-track::-webkit-scrollbar-thumb {
  background: var(--electric-cyan-dim);
  border-radius: 5px;
}
.timeline-phase {
  flex: 0 0 340px;
  scroll-snap-align: start;
  position: relative;
  padding: 28px 24px 24px;
  margin-right: 2px;
}
.timeline-phase::before {
  content: '';
  position: absolute;
  top: 28px; left: 0;
  width: 100%; height: 2px;
  background: var(--border-subtle);
  z-index: 0;
}
.timeline-marker {
  position: relative;
  z-index: 1;
  width: 18px; height: 18px;
  background: var(--nebula-surface);
  border: 2px solid var(--electric-cyan);
  border-radius: 50%;
  margin-bottom: 18px;
  box-shadow: 0 0 12px var(--electric-cyan-dim);
}
.timeline-phase:nth-child(1) .timeline-marker { border-color: var(--electric-cyan); box-shadow: 0 0 18px var(--electric-cyan-dim); }
.timeline-phase:nth-child(2) .timeline-marker { border-color: var(--electric-green); box-shadow: 0 0 14px var(--electric-green-dim); }
.timeline-phase:nth-child(3) .timeline-marker { border-color: var(--polished-gold); box-shadow: 0 0 14px var(--polished-gold-dim); }
.timeline-phase-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-bright);
  margin-bottom: 6px;
}
.timeline-phase-time {
  font-size: 0.85rem;
  color: var(--electric-cyan);
  font-weight: 600;
  margin-bottom: 8px;
}
.timeline-phase-focus {
  font-size: 0.95rem;
  color: var(--text-body);
  margin-bottom: 14px;
  font-weight: 500;
}
.timeline-targets {
  list-style: none;
  padding: 0;
}
.timeline-targets li {
  padding: 6px 0 6px 20px;
  position: relative;
  color: var(--text-body);
  font-size: 0.9rem;
}
.timeline-targets li::before {
  content: '';
  position: absolute;
  left: 0; top: 14px;
  width: 7px; height: 7px;
  background: var(--electric-green);
  border-radius: 50%;
  opacity: 0.7;
}

/* ============================================================
   4-P FRAMEWORK — Hierarchical Stack
   ============================================================ */
.p4-stack {
  display: flex;
  flex-direction: column;
  gap: 0;
  max-width: 750px;
  margin: 0 auto;
}
.p4-item {
  display: flex;
  gap: 20px;
  padding: 24px 0;
  position: relative;
}
.p4-item:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 17px; top: 60px; bottom: -20px;
  width: 2px;
  background: linear-gradient(to bottom, var(--electric-cyan), transparent);
}
.p4-marker {
  flex-shrink: 0;
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  border: 2px solid var(--electric-cyan);
  color: var(--electric-cyan);
  background: var(--nebula-surface);
  box-shadow: 0 0 10px var(--electric-cyan-dim);
  position: relative;
  z-index: 1;
}
.p4-content { flex: 1; }
.p4-content h3 {
  color: var(--electric-cyan);
  font-size: 1.15rem;
  margin-bottom: 4px;
  font-weight: 600;
}
.p4-content .p4-intent {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.p4-content p { font-size: 0.94rem; color: var(--text-body); margin-bottom: 6px; }
.p4-content .p4-example {
  font-size: 0.85rem;
  color: var(--polished-gold);
  font-weight: 500;
}

/* ============================================================
   TIMELINE NODE (Legacy Vertical — kept for backward compat)
   ============================================================ */
.timeline-node {
  border-left: 2px solid var(--border-glow);
  padding-left: 30px;
  margin-bottom: 44px;
  position: relative;
}
.timeline-node::before {
  content: '';
  position: absolute;
  left: -8px; top: 6px;
  width: 14px; height: 14px;
  background: var(--cosmic-deep);
  border: 2px solid var(--electric-cyan);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--electric-cyan-dim);
}
.timeline-title {
  color: var(--text-bright);
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 6px;
}
.timeline-targets {
  margin-top: 14px;
  padding-left: 22px;
  list-style-type: square;
  color: var(--electric-cyan);
}
.timeline-targets li { margin-bottom: 8px; color: var(--text-body); font-size: 1rem; }

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  background: var(--cosmic-deep);
  border-top: 1px solid var(--border-glow);
  padding: 36px 0;
  text-align: center;
}
.footer p { color: var(--text-muted); font-size: 0.88rem; }
.footer-links {
  display: flex;
  justify-content: center;
  gap: 22px;
  margin: 18px 0;
  flex-wrap: wrap;
}
.footer-links a { font-weight: 500; font-size: 0.92rem; }

/* ============================================================
   DOCUMENT MODE OVERRIDES (For Lease / Handbook Templates)
   ============================================================ */
body.doc-mode {
  background-color: var(--doc-bg);
  color: var(--doc-text);
}
body.doc-mode .container { max-width: 900px; }
body.doc-mode h1, body.doc-mode h2, body.doc-mode h3 { color: var(--doc-teal); }

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes pulse-ring {
  0%   { box-shadow: 0 0 0 0 rgba(0, 229, 255, 0.5); }
  70%  { box-shadow: 0 0 0 14px rgba(0, 229, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 229, 255, 0); }
}
@keyframes glow-pulse {
  0%, 100% { filter: drop-shadow(0 0 6px rgba(0, 229, 255, 0.3)); }
  50%      { filter: drop-shadow(0 0 16px rgba(0, 229, 255, 0.7)); }
}
@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-20px); }
  to   { opacity: 1; transform: translateX(0); }
}

.animate-in {
  animation: fadeSlideUp 0.45s ease both;
}
.animate-in:nth-child(1) { animation-delay: 0.05s; }
.animate-in:nth-child(2) { animation-delay: 0.10s; }
.animate-in:nth-child(3) { animation-delay: 0.15s; }
.animate-in:nth-child(4) { animation-delay: 0.20s; }
.animate-in:nth-child(5) { animation-delay: 0.25s; }
.animate-in:nth-child(6) { animation-delay: 0.30s; }
.animate-in:nth-child(7) { animation-delay: 0.35s; }
.animate-in:nth-child(8) { animation-delay: 0.40s; }
.animate-in:nth-child(9) { animation-delay: 0.45s; }
.animate-in:nth-child(10) { animation-delay: 0.50s; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  .container { padding: 0 16px; }
  .arch-header { padding: 40px 0 28px; }
  .arch-header h1 { font-size: 1.7rem; }
  .grid-layout { grid-template-columns: 1fr; }
  .data-card { padding: 20px; }
  .controls-wrapper { gap: 6px; }
  .tab-btn { padding: 9px 16px; font-size: 0.82rem; }
  .domain-header h2 { font-size: 1.1rem; }
  .timeline-phase { flex: 0 0 280px; }
  .navbar .container { flex-direction: column; gap: 8px; }
  .p4-stack { gap: 0; }
  .p4-item { gap: 12px; }
}

/* ============================================================
   ACCESSIBILITY — Reduced Motion
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}