/* ========== BASE LIQUID GLASS VARS ========== */
:root {
  --lg-bg-color: rgba(255, 255, 255, 0.08);
  --lg-highlight: rgba(255, 255, 255, 0.25);
  --lg-text: #ffffff;
  --lg-hover-glow: rgba(255, 255, 255, 0.4);
}

/* ========== GLASS CONTAINER ========== */
.glass-container {
  position: relative;
  display: flex;
  font-weight: 600;
  color: var(--lg-text);
  background: transparent;
  border-radius: 2rem;
  overflow: hidden;
  box-shadow: 0 6px 6px rgba(0, 0, 0, 0.2), 0 0 20px rgba(0, 0, 0, 0.1);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 2.2);
}

.glass-container--rounded {
  border-radius: 40px;
}

.glass-container--circle {
  border-radius: 50%;
}

/* ========== GLASS LAYERS ========== */
.glass-filter {
  position: absolute;
  inset: 0;
  z-index: 0;
  /* Fallback — JS engine overrides per browser */
  backdrop-filter: blur(30px) saturate(1.8) brightness(1.1);
  -webkit-backdrop-filter: blur(30px) saturate(1.8) brightness(1.1);
  isolation: isolate;
  border-radius: inherit;
}

.glass-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: var(--lg-bg-color);
  border-radius: inherit;
}

.glass-specular {
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: inherit;
  overflow: hidden;
  box-shadow: inset 1px 1px 0 var(--lg-highlight),
    inset 0 0 5px var(--lg-highlight);
  pointer-events: none;
}

.glass-content {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  width: 100%;
}

/* ========== SHORTHAND CLASSES ========== */
.liquid-glass-bar, .liquid-glass, .liquid-glass-circle {
  position: relative;
  background: var(--lg-bg-color);
  backdrop-filter: blur(30px) saturate(1.8) brightness(1.1);
  -webkit-backdrop-filter: blur(30px) saturate(1.8) brightness(1.1);
  box-shadow: inset 1px 1px 0 var(--lg-highlight), inset 0 0 5px var(--lg-highlight), 0 6px 6px rgba(0, 0, 0, 0.2);
  border: none;
}
.liquid-glass-bar { border-radius: 40px; }
.liquid-glass-circle { border-radius: 50%; }
.liquid-glass { border-radius: 12px; }

/* ═══════════════════════════════════════════════════
   SAFARI / WEBKIT — Apple Liquid Glass Refraction
   Simulates real glass edge distortion with layered
   pseudo-elements since Safari can't do SVG filters
   in backdrop-filter.
   ═══════════════════════════════════════════════════ */

/* Edge refraction glow — simulates light bending at glass edges */
[data-glass-engine="webkit"] .glass-container::before,
[data-glass-engine="webkit"] .lg-safari-glass.liquid-glass-bar::before,
[data-glass-engine="webkit"] .lg-safari-glass.liquid-glass::before,
[data-glass-engine="webkit"] .lg-safari-glass.liquid-glass-circle::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  z-index: 4;
  pointer-events: none;
  /* Authentic Apple TV Glass minimal inset */
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
/* Pure Apple TV gradient overlay — highly transparent for see-through distortion */
  background: rgba(0, 0, 0, 0.25); /* Simple dark transparent tint for contrast */
}

/* Override base elements for pure transparency */
[data-glass-engine="webkit"] .glass-overlay {
  background: transparent !important;
}

[data-glass-engine="webkit"] .glass-specular {
  display: none !important;
}

/* Remove extra specular overlay */
[data-glass-engine="webkit"] .glass-container::after {
  display: none !important;
}

/* Very faint minimal borders */
[data-glass-engine="webkit"] .glass-container,
[data-glass-engine="webkit"] .liquid-glass-bar,
[data-glass-engine="webkit"] .liquid-glass,
[data-glass-engine="webkit"] .liquid-glass-circle {
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* ─── Liquid Glass — Search Input Variant ─── */
.liquid-glass-input {
  position: relative;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(30px) saturate(1.8) brightness(1.08);
  -webkit-backdrop-filter: blur(30px) saturate(1.8) brightness(1.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-bottom-color: rgba(255, 255, 255, 0.06);
  box-shadow:
    0 4px 20px rgba(0, 0, 0, 0.25),
    inset 0 1px 1px rgba(255, 255, 255, 0.12),
    inset 0 -1px 2px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  isolation: isolate;
  color: #fff;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.liquid-glass-input::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.12) 0%,
    rgba(255, 255, 255, 0.03) 40%,
    transparent 100%
  );
  pointer-events: none;
  z-index: 1;
}

.liquid-glass-input:focus-within {
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow:
    0 4px 24px rgba(0, 0, 0, 0.3),
    0 0 0 1px rgba(255, 255, 255, 0.08),
    inset 0 1px 1px rgba(255, 255, 255, 0.15),
    inset 0 -1px 2px rgba(0, 0, 0, 0.1);
}
