/* ═══════════════════════════════════════════════════════════
   Liquid Glass — reusable glass-morphism component
   Inspired by Apple's Liquid Glass & polidario/liquid-glass-vue
   Uses SVG displacement filter for light refraction effect.
   ═══════════════════════════════════════════════════════════ */

/* Base liquid glass surface */
.lg-surface {
  position: relative;
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow:
    0 8px 32px rgba(17, 24, 39, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.6),
    inset 0 -1px 0 rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

/* Subtle refractive highlight */
.lg-surface::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.35) 0%,
    rgba(255, 255, 255, 0.1) 25%,
    transparent 50%,
    rgba(255, 255, 255, 0.05) 80%,
    rgba(255, 255, 255, 0.25) 100%
  );
  opacity: 0.8;
}

/* Dark theme — midnight lab glass */
.theme-dark .lg-surface {
  background: rgba(20, 27, 60, 0.55);
  border-color: rgba(96, 165, 250, 0.15);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(96, 165, 250, 0.15),
    inset 0 -1px 0 rgba(0, 0, 0, 0.3);
}
.theme-dark .lg-surface::before {
  background: linear-gradient(
    135deg,
    rgba(96, 165, 250, 0.18) 0%,
    rgba(96, 165, 250, 0.05) 25%,
    transparent 50%,
    rgba(147, 197, 253, 0.03) 80%,
    rgba(96, 165, 250, 0.12) 100%
  );
}

/* Intensity variants */
.lg-surface--subtle {
  background: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
}
.theme-dark .lg-surface--subtle {
  background: rgba(20, 27, 60, 0.4);
}

.lg-surface--strong {
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(28px) saturate(200%);
  -webkit-backdrop-filter: blur(28px) saturate(200%);
}
.theme-dark .lg-surface--strong {
  background: rgba(20, 27, 60, 0.7);
}

/* Tinted variants */
.lg-surface--indigo {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.12), rgba(255, 255, 255, 0.5));
}
.theme-dark .lg-surface--indigo {
  background: linear-gradient(135deg, rgba(96, 165, 250, 0.2), rgba(20, 27, 60, 0.6));
}

.lg-surface--violet {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.12), rgba(255, 255, 255, 0.5));
}
.theme-dark .lg-surface--violet {
  background: linear-gradient(135deg, rgba(147, 197, 253, 0.2), rgba(20, 27, 60, 0.6));
}

/* Liquid hover — morphing shimmer effect */
.lg-surface--hover {
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
              box-shadow 0.35s cubic-bezier(0.22, 1, 0.36, 1),
              border-color 0.35s;
}
.lg-surface--hover:hover {
  transform: translateY(-2px);
  box-shadow:
    0 16px 48px rgba(17, 24, 39, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
  border-color: rgba(255, 255, 255, 0.5);
}
.theme-dark .lg-surface--hover:hover {
  box-shadow:
    0 16px 48px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(96, 165, 250, 0.2);
  border-color: rgba(96, 165, 250, 0.25);
}

/* Shimmer sweep animation on hover */
.lg-surface--hover::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    120deg,
    transparent 30%,
    rgba(255, 255, 255, 0.18) 45%,
    rgba(255, 255, 255, 0.28) 50%,
    rgba(255, 255, 255, 0.18) 55%,
    transparent 70%
  );
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
}
.lg-surface--hover:hover::after {
  opacity: 1;
  animation: lgShimmer 1.2s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes lgShimmer {
  0% { left: -100%; }
  100% { left: 100%; }
}

/* Rim light — subtle glowing border */
.lg-surface--rim {
  position: relative;
}
.lg-surface--rim::before {
  background: linear-gradient(
    135deg,
    rgba(37, 99, 235, 0.1) 0%,
    transparent 30%,
    transparent 70%,
    rgba(59, 130, 246, 0.1) 100%
  );
}
.theme-dark .lg-surface--rim::before {
  background: linear-gradient(
    135deg,
    rgba(96, 165, 250, 0.18) 0%,
    transparent 30%,
    transparent 70%,
    rgba(147, 197, 253, 0.18) 100%
  );
}

/* Refractive caustic light points (subtle ambient) */
.lg-surface--caustic::before {
  background:
    radial-gradient(circle 120px at 20% 30%, rgba(37, 99, 235, 0.08), transparent),
    radial-gradient(circle 100px at 80% 70%, rgba(59, 130, 246, 0.06), transparent),
    linear-gradient(135deg, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.05));
}

/* Utility: apply to any element without wrapping */
.lg-apply {
  background: rgba(255, 255, 255, 0.55) !important;
  backdrop-filter: blur(20px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
  border: 1px solid rgba(255, 255, 255, 0.4) !important;
  box-shadow:
    0 8px 32px rgba(17, 24, 39, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.6) !important;
}
.theme-dark .lg-apply {
  background: rgba(20, 27, 60, 0.55) !important;
  border-color: rgba(96, 165, 250, 0.15) !important;
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(96, 165, 250, 0.15) !important;
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  .lg-surface--hover:hover::after { animation: none; opacity: 0; }
  .lg-surface--hover { transition: none; }
}
