/* ==========================================================================
   PURE REAL LIQUID GLASS OPTICAL PHYSICS SYSTEM
   Light & Dark Adaptive Edition:
   - Snell's Law Refractive Bending via SVG Displacement Mapping
   - Razor Specular Chamfers & Diamond-Cut Highlights
   - Prismatic Chromatic Aberration Dispersion
   - Dynamic Ray-Traced Light Sheen (Follows Mouse Incident Vector)
   ========================================================================== */

:root {
  --glass-glare-x: 50%;
  --glass-glare-y: 50%;
  --glass-glare-opacity: 0.35;
  --glass-chroma-red: rgba(239, 68, 68, 0.35);
  --glass-chroma-blue: rgba(14, 165, 233, 0.35);
}

/* ==========================================================================
   LIQUID GLASS CAPSULE HEADER (Persistent at Top Center)
   ========================================================================== */

.liquid-glass-header-capsule {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 36px;
  padding: 12px 42px;
  border-radius: 9999px;
  z-index: 1000;

  /* Real Liquid Glass Material (Dark/Home Default) */
  background: 
    radial-gradient(
      circle 260px at var(--glass-glare-x) var(--glass-glare-y),
      rgba(255, 255, 255, var(--glass-glare-opacity)) 0%,
      rgba(255, 255, 255, 0.08) 40%,
      transparent 70%
    ),
    linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.16) 0%,
      rgba(255, 255, 255, 0.05) 50%,
      rgba(15, 25, 20, 0.28) 100%
    );

  backdrop-filter: url(#liquid-glass-filter) blur(18px) saturate(180%) contrast(108%);
  -webkit-backdrop-filter: blur(18px) saturate(180%) contrast(108%);

  box-shadow:
    inset 0 1.5px 0.5px rgba(255, 255, 255, 0.85),
    inset 1.5px 0 0 rgba(255, 255, 255, 0.35),
    inset -1.5px 0 0 rgba(255, 255, 255, 0.35),
    inset 0 -1.5px 1px rgba(255, 255, 255, 0.15),
    0 20px 40px -10px rgba(0, 0, 0, 0.5),
    0 4px 12px rgba(0, 0, 0, 0.3),
    0 0 0 1px rgba(255, 255, 255, 0.18);

  border: 1px solid transparent;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

/* Chromatic Aberration Edge Dispersion */
.liquid-glass-header-capsule::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 9999px;
  pointer-events: none;
  z-index: 1;
  background: linear-gradient(
    135deg,
    var(--glass-chroma-red) 0%,
    transparent 15%,
    transparent 85%,
    var(--glass-chroma-blue) 100%
  );
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  padding: 1.5px;
  opacity: 0.75;
}

.liquid-glass-header-capsule:hover {
  transform: translateY(-1px);
  box-shadow:
    inset 0 2px 0.5px rgba(255, 255, 255, 0.95),
    0 24px 50px -10px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(255, 255, 255, 0.3);
}

/* Header adaptation when on Light Theme Pages (Graphs, Models, Analyzer) */
body.light-theme-active .liquid-glass-header-capsule {
  background: 
    radial-gradient(
      circle 260px at var(--glass-glare-x) var(--glass-glare-y),
      rgba(255, 255, 255, 0.7) 0%,
      transparent 70%
    ),
    linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.88) 0%,
      rgba(255, 255, 255, 0.72) 60%,
      rgba(240, 253, 244, 0.65) 100%
    );
  box-shadow:
    inset 0 1.5px 0.5px #ffffff,
    inset 0 -1px 0 rgba(0, 0, 0, 0.06),
    0 16px 36px -12px rgba(15, 23, 42, 0.08),
    0 4px 12px -2px rgba(15, 23, 42, 0.04),
    0 0 0 1px rgba(0, 0, 0, 0.08);
}

/* Navigation items inside capsule */
.glass-nav-item {
  position: relative;
  z-index: 2;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 4px 6px;
}

.glass-nav-item:hover {
  color: #ffffff;
  text-shadow: 0 0 12px rgba(255, 255, 255, 0.8);
}

.glass-nav-item.active {
  color: #ffffff;
  text-shadow: 0 0 16px rgba(52, 211, 153, 0.9);
}

body.light-theme-active .glass-nav-item {
  color: #475569;
}

body.light-theme-active .glass-nav-item:hover,
body.light-theme-active .glass-nav-item.active {
  color: #0f172a;
  text-shadow: 0 0 14px rgba(16, 185, 129, 0.35);
}

/* ==========================================================================
   LIQUID GLASS "ANALYZE" PILL BUTTON (Home Page)
   ========================================================================== */

.liquid-glass-btn-analyze {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 56px;
  border-radius: 9999px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #ffffff;
  text-decoration: none;
  cursor: pointer;

  background: 
    radial-gradient(
      circle 220px at var(--btn-glare-x, 50%) var(--btn-glare-y, 30%),
      rgba(255, 255, 255, 0.35) 0%,
      rgba(255, 255, 255, 0.08) 50%,
      transparent 80%
    ),
    linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.22) 0%,
      rgba(255, 255, 255, 0.06) 50%,
      rgba(15, 25, 20, 0.3) 100%
    );

  backdrop-filter: url(#liquid-glass-filter) blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);

  box-shadow:
    inset 0 1.5px 0.5px rgba(255, 255, 255, 0.85),
    inset 1px 0 0 rgba(255, 255, 255, 0.35),
    inset -1px 0 0 rgba(255, 255, 255, 0.35),
    inset 0 -1.5px 1px rgba(255, 255, 255, 0.15),
    0 16px 36px -8px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.22);

  border: 1px solid transparent;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
  user-select: none;
}

.liquid-glass-btn-analyze::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 9999px;
  pointer-events: none;
  background: linear-gradient(
    135deg,
    var(--glass-chroma-red) 0%,
    transparent 20%,
    transparent 80%,
    var(--glass-chroma-blue) 100%
  );
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  padding: 1.5px;
  opacity: 0.75;
}

.liquid-glass-btn-analyze:hover {
  transform: translateY(-2px) scale(1.02);
  color: #ffffff;
  text-shadow: 0 0 20px rgba(255, 255, 255, 0.9);
  box-shadow:
    inset 0 2px 0.5px rgba(255, 255, 255, 0.98),
    0 24px 48px -10px rgba(0, 0, 0, 0.65),
    0 0 0 1px rgba(255, 255, 255, 0.38);
}

/* ==========================================================================
   CLASSIC LIGHT-THEME REAL LIQUID GLASS CARDS
   Displaying Graphs, Models & Analyzer
   ========================================================================== */

.liquid-glass-card {
  position: relative;
  background: 
    radial-gradient(
      circle 280px at var(--card-glare-x, 50%) var(--card-glare-y, 30%),
      rgba(255, 255, 255, 0.85) 0%,
      transparent 70%
    ),
    linear-gradient(
      145deg,
      rgba(255, 255, 255, 0.88) 0%,
      rgba(255, 255, 255, 0.72) 60%,
      rgba(240, 253, 244, 0.65) 100%
    );

  backdrop-filter: url(#liquid-glass-filter) blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);

  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow:
    inset 0 1.5px 0.5px #ffffff,
    inset 0 -1px 0 rgba(0, 0, 0, 0.04),
    0 20px 45px -12px rgba(15, 23, 42, 0.08),
    0 4px 12px -2px rgba(15, 23, 42, 0.03),
    0 0 0 1px rgba(0, 0, 0, 0.06);

  overflow: hidden;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease;
}

.liquid-glass-card::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 24px;
  pointer-events: none;
  background: linear-gradient(
    135deg,
    rgba(239, 68, 68, 0.2) 0%,
    transparent 15%,
    transparent 85%,
    rgba(14, 165, 233, 0.2) 100%
  );
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  padding: 1px;
  opacity: 0.6;
}

.liquid-glass-card:hover {
  transform: translateY(-2px);
  box-shadow:
    inset 0 2px 0.5px #ffffff,
    0 28px 56px -14px rgba(15, 23, 42, 0.12),
    0 0 0 1px rgba(16, 185, 129, 0.3);
}

/* Glass Pill Button */
.liquid-glass-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: 9999px;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #1e293b;
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: inset 0 1px 0.5px #ffffff, 0 2px 8px rgba(15, 23, 42, 0.04);
  cursor: pointer;
  transition: all 0.2s ease;
}

.liquid-glass-pill-btn:hover {
  color: #0f172a;
  border-color: rgba(16, 185, 129, 0.4);
  box-shadow: inset 0 1px 0.5px #ffffff, 0 6px 18px rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
}

.liquid-glass-pill-btn.primary {
  background: linear-gradient(135deg, #059669 0%, #10b981 100%);
  color: #ffffff;
  border-color: #059669;
  box-shadow: inset 0 1px 0.5px rgba(255, 255, 255, 0.4), 0 6px 18px rgba(16, 185, 129, 0.35);
}

.liquid-glass-pill-btn.primary:hover {
  background: linear-gradient(135deg, #047857 0%, #059669 100%);
  box-shadow: inset 0 1.5px 0.5px rgba(255, 255, 255, 0.5), 0 10px 24px rgba(16, 185, 129, 0.45);
}
