/* ==========================================================================
   South African Unit Trust Navigator - Unified Institutional Stylesheet
   Design Philosophy: Soft Structuralism + Doppelrand (Double-Bezel) Architecture
   Typography: Plus Jakarta Sans + JetBrains Mono (Zero Banned Fonts)
   Fluid Dynamics: Custom Cubic-Bezier Motion Choreography
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600&family=Plus+Jakarta+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400;1,600&display=swap');

:root {
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;
  
  /* Precision Agency Easing Curves */
  --ease-spring: cubic-bezier(0.32, 0.72, 0, 1);
  --ease-fluid: cubic-bezier(0.16, 1, 0.3, 1);
  
  /* Soft Ambient Light & Border Tokens */
  --ambient-bg: #f8fafc;
  --ambient-border: rgba(15, 23, 42, 0.05);
  --ambient-border-hover: rgba(15, 23, 42, 0.1);
  --ambient-shadow: 0 24px 48px -14px rgba(15, 23, 42, 0.04), 0 1px 2px rgba(15, 23, 42, 0.02);
  --ambient-shadow-hover: 0 32px 64px -16px rgba(15, 23, 42, 0.08), 0 2px 4px rgba(15, 23, 42, 0.03);
}

/* 1. Base Typography & Ambient Surface */
html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: var(--ambient-bg);
  color: #0f172a;
  min-height: 100dvh;
  position: relative;
  overflow-x: hidden;
}

/* Subtle Ambient Radial Glow (Hardware Lighting) */
.ambient-glow {
  position: absolute;
  top: -120px;
  left: 50%;
  transform: translateX(-50%);
  width: 900px;
  height: 500px;
  background: radial-gradient(50% 50% at 50% 50%, rgba(226, 232, 240, 0.6) 0%, rgba(248, 250, 252, 0) 100%);
  pointer-events: none;
  z-index: 0;
}

/* 2. Floating Island Header Navigation */
.island-nav {
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: 9999px;
  box-shadow: 0 12px 32px -8px rgba(15, 23, 42, 0.05), inset 0 1px 1px rgba(255, 255, 255, 0.9);
  transition: all 0.5s var(--ease-spring);
}

.island-nav:hover {
  border-color: rgba(15, 23, 42, 0.1);
  box-shadow: 0 16px 40px -8px rgba(15, 23, 42, 0.08), inset 0 1px 1px rgba(255, 255, 255, 0.9);
}

/* 3. The Double-Bezel (Doppelrand) Architecture */
.double-bezel {
  background: rgba(15, 23, 42, 0.02);
  border: 1px solid var(--ambient-border);
  padding: 8px;
  border-radius: 2rem;
  transition: transform 0.6s var(--ease-spring), box-shadow 0.6s var(--ease-spring), border-color 0.6s var(--ease-spring);
  position: relative;
}

@media (min-width: 768px) {
  .double-bezel {
    padding: 10px;
  }
}

.double-bezel:hover {
  transform: translateY(-3px);
  box-shadow: var(--ambient-shadow-hover);
  border-color: var(--ambient-border-hover);
}

.double-bezel-inner {
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.04);
  border-radius: calc(2rem - 8px);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 1), 0 10px 25px -10px rgba(15, 23, 42, 0.03);
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.75rem;
}

@media (min-width: 768px) {
  .double-bezel-inner {
    border-radius: calc(2rem - 10px);
    padding: 2rem;
  }
}

.double-bezel-active {
  background: rgba(15, 23, 42, 0.035);
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.double-bezel-active:hover {
  border-color: rgba(15, 23, 42, 0.14);
}

.double-bezel-muted .double-bezel-inner {
  background: rgba(255, 255, 255, 0.92);
}

/* 4. Island & Button Architecture */
.island-btn-primary {
  background: #090d16;
  color: #ffffff;
  border-radius: 9999px;
  padding: 12px 14px 12px 22px;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: -0.01em;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 10px 24px -6px rgba(15, 23, 42, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transition: transform 0.4s var(--ease-spring), box-shadow 0.4s var(--ease-spring), background-color 0.3s ease;
  user-select: none;
}

.island-btn-primary:hover {
  background: #020617;
  box-shadow: 0 14px 30px -6px rgba(15, 23, 42, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.island-btn-primary:active {
  transform: scale(0.98);
}

.nested-icon-circle {
  width: 32px;
  height: 32px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.12);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.4s var(--ease-spring), background-color 0.3s ease;
  flex-shrink: 0;
}

.island-btn-primary:hover .nested-icon-circle {
  transform: translate(2px, -2px) scale(1.05);
  background: rgba(255, 255, 255, 0.22);
}

.island-btn-secondary {
  background: #ffffff;
  color: #1e293b;
  border-radius: 9999px;
  padding: 10px 20px;
  font-weight: 600;
  font-size: 12.5px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 2px 8px -2px rgba(15, 23, 42, 0.04), inset 0 1px 1px rgba(255, 255, 255, 0.9);
  transition: transform 0.4s var(--ease-spring), box-shadow 0.4s var(--ease-spring), background-color 0.2s ease, border-color 0.2s ease;
  user-select: none;
}

.island-btn-secondary:hover {
  background: #f8fafc;
  border-color: rgba(15, 23, 42, 0.14);
  box-shadow: 0 6px 16px -4px rgba(15, 23, 42, 0.06);
}

.island-btn-secondary:active {
  transform: scale(0.98);
}

/* Soft Red Island Button (Legal Disclaimers) */
.island-btn-danger {
  background: #fff1f2;
  color: #9f1239;
  border-radius: 9999px;
  padding: 10px 20px;
  font-weight: 600;
  font-size: 12.5px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(244, 63, 94, 0.25);
  box-shadow: 0 2px 8px -2px rgba(244, 63, 94, 0.08), inset 0 1px 1px rgba(255, 255, 255, 0.9);
  transition: transform 0.4s var(--ease-spring), box-shadow 0.4s var(--ease-spring), background-color 0.2s ease, border-color 0.2s ease;
  user-select: none;
}

.island-btn-danger:hover {
  background: #ffe4e6;
  border-color: rgba(244, 63, 94, 0.4);
  box-shadow: 0 6px 16px -4px rgba(244, 63, 94, 0.15);
}

.island-btn-danger:active {
  transform: scale(0.98);
}

.island-btn-ghost {
  background: rgba(15, 23, 42, 0.04);
  color: #475569;
  border-radius: 9999px;
  padding: 10px 18px 10px 20px;
  font-weight: 600;
  font-size: 12.5px;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid rgba(15, 23, 42, 0.05);
  transition: transform 0.4s var(--ease-spring), background-color 0.2s ease, color 0.2s ease;
  user-select: none;
}

.island-btn-ghost:hover {
  background: rgba(15, 23, 42, 0.07);
  color: #0f172a;
}

.island-btn-ghost:active {
  transform: scale(0.98);
}

.nested-icon-ghost {
  width: 28px;
  height: 28px;
  border-radius: 9999px;
  background: rgba(15, 23, 42, 0.05);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.4s var(--ease-spring);
  flex-shrink: 0;
}

.island-btn-ghost:hover .nested-icon-ghost {
  transform: translate(2px, -2px);
  background: rgba(15, 23, 42, 0.1);
}

.sort-btn {
  cursor: pointer;
  user-select: none;
  transition: all 0.3s var(--ease-spring);
}

/* 5. Micro Badges & Eyebrows */
.eyebrow-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 9999px;
  padding: 4px 12px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  background: rgba(15, 23, 42, 0.035);
  border: 1px solid rgba(15, 23, 42, 0.06);
  color: #475569;
}

.status-pill-active {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 9999px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 600;
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.status-dot-pulse {
  width: 6px;
  height: 6px;
  border-radius: 9999px;
  background-color: #16a34a;
  position: relative;
}

.status-dot-pulse::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 9999px;
  background-color: rgba(22, 163, 74, 0.4);
  animation: pulse-ring 2.4s var(--ease-spring) infinite;
}

@keyframes pulse-ring {
  0% { transform: scale(0.9); opacity: 0.8; }
  50% { transform: scale(1.6); opacity: 0; }
  100% { transform: scale(0.9); opacity: 0; }
}

.status-pill-muted {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 9999px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 500;
  background: #fffbeb;
  color: #92400e;
  border: 1px solid #fef3c7;
}

/* 6. Precision Metric Matrix Table */
.spec-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid rgba(15, 23, 42, 0.04);
  font-size: 12.5px;
  font-family: var(--font-mono);
}

.spec-row:last-child {
  border-bottom: none;
}

/* 7. Institutional Data Tables & Tabular Matrix Grids */
table {
  border-collapse: collapse;
  width: 100%;
}

th, td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  font-size: 13px;
}

th {
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #475569;
  background: #f8fafc;
}

tr:hover {
  background: rgba(248, 250, 252, 0.7);
}

/* 8. Categorical & Risk Profile Badge System */
.badge {
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 500;
  display: inline-block;
}

.badge-conservative {
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #cbd5e1;
}

.badge-cautious {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.badge-moderate {
  background: #fefce8;
  color: #854d0e;
  border: 1px solid #fef08a;
}

.badge-mod-agg {
  background: #fff7ed;
  color: #9a3412;
  border: 1px solid #fed7aa;
}

.badge-aggressive {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.badge-neutral {
  background: #e2e8f0;
  color: #334155;
  border: 1px solid #cbd5e1;
}

/* 9. Institutional Informational Callouts */
.callout {
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-left: 3px solid;
  padding: 14px 18px;
  border-radius: 16px;
  margin: 14px 0;
  font-size: 13px;
  line-height: 1.55;
  box-shadow: 0 2px 8px -2px rgba(15, 23, 42, 0.03);
}

.callout-info {
  border-color: #3b82f6;
  background: #eff6ff;
}

.callout-warn {
  border-color: #f59e0b;
  background: #fffbeb;
}

.callout-neutral {
  border-color: #64748b;
  background: #f8fafc;
}

/* 10. Tax Stream Breakdown Progress Indicators */
.bar-interest {
  background: #dc2626;
  height: 8px;
  display: inline-block;
  border-radius: 2px;
}

.bar-dividend {
  background: #16a34a;
  height: 8px;
  display: inline-block;
  border-radius: 2px;
}

.bar-reit {
  background: #d97706;
  height: 8px;
  display: inline-block;
  border-radius: 2px;
}

.bar-capgains {
  background: #2563eb;
  height: 8px;
  display: inline-block;
  border-radius: 2px;
}

/* 11. Mobile Collapse Overrides */
@media (max-width: 767px) {
  .double-bezel {
    border-radius: 1.5rem;
    padding: 6px;
  }
  .double-bezel-inner {
    border-radius: calc(1.5rem - 6px);
    padding: 1.25rem;
  }
}
