/**
 * Liquid Glass Design System
 * Inspired by Apple iOS 26 / macOS 26
 * Frosted glass, depth layers, chromatic refraction
 */

/* ============================================
   BASE LIQUID GLASS PRIMITIVES
   ============================================ */

/* Glass Surface Base */
.lg-surface {
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 
    0 1px 0 rgba(255, 255, 255, 0.05) inset,
    0 20px 40px rgba(0, 0, 0, 0.3),
    0 0 0 1px rgba(0, 0, 0, 0.2);
  position: relative;
  overflow: hidden;
}

/* Glass with inner glow */
.lg-surface-glow::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse at 50% 0%,
    rgba(255, 255, 255, 0.08) 0%,
    transparent 60%
  );
  pointer-events: none;
}

/* Glass with edge highlight */
.lg-surface::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.15) 0%,
    rgba(255, 255, 255, 0.02) 50%,
    rgba(255, 255, 255, 0.05) 100%
  );
  -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;
  pointer-events: none;
}

/* Thickness variations */
.lg-thin {
  backdrop-filter: blur(10px) saturate(150%);
  -webkit-backdrop-filter: blur(10px) saturate(150%);
}

.lg-thick {
  backdrop-filter: blur(40px) saturate(200%);
  -webkit-backdrop-filter: blur(40px) saturate(200%);
  background: rgba(255, 255, 255, 0.05);
}

.lg-ultra {
  backdrop-filter: blur(60px) saturate(250%);
  -webkit-backdrop-filter: blur(60px) saturate(250%);
  background: rgba(255, 255, 255, 0.06);
}

/* ============================================
   CHROMATIC ACCENT VARIANTS
   ============================================ */

/* Gold (Φ) Accent */
.lg-gold {
  border-color: rgba(255, 215, 0, 0.15);
  box-shadow: 
    0 1px 0 rgba(255, 215, 0, 0.1) inset,
    0 20px 40px rgba(0, 0, 0, 0.3),
    0 0 30px rgba(255, 215, 0, 0.05);
}

.lg-gold::after {
  background: linear-gradient(
    135deg,
    rgba(255, 215, 0, 0.2) 0%,
    rgba(255, 215, 0, 0.02) 50%,
    rgba(255, 215, 0, 0.08) 100%
  );
}

/* Purple (FRA-R) Accent */
.lg-purple {
  border-color: rgba(136, 68, 255, 0.15);
  box-shadow: 
    0 1px 0 rgba(136, 68, 255, 0.1) inset,
    0 20px 40px rgba(0, 0, 0, 0.3),
    0 0 30px rgba(136, 68, 255, 0.05);
}

/* Cyan (FRA-F) Accent */
.lg-cyan {
  border-color: rgba(0, 200, 255, 0.15);
  box-shadow: 
    0 1px 0 rgba(0, 200, 255, 0.1) inset,
    0 20px 40px rgba(0, 0, 0, 0.3),
    0 0 30px rgba(0, 200, 255, 0.05);
}

/* Green (Safety) Accent */
.lg-green {
  border-color: rgba(68, 255, 136, 0.15);
  box-shadow: 
    0 1px 0 rgba(68, 255, 136, 0.1) inset,
    0 20px 40px rgba(0, 0, 0, 0.3),
    0 0 30px rgba(68, 255, 136, 0.05);
}

/* ============================================
   LIQUID BUTTONS
   ============================================ */

.lg-btn {
  position: relative;
  padding: 0.875rem 1.75rem;
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 100px;
  color: rgba(255, 255, 255, 0.95);
  font-weight: 500;
  font-size: 0.9375rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.lg-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(
    80% 50% at 50% 0%,
    rgba(255, 255, 255, 0.15) 0%,
    transparent 60%
  );
  opacity: 0.5;
  transition: opacity 0.3s ease;
}

.lg-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.2) 0%,
    rgba(255, 255, 255, 0) 100%
  );
  -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;
  pointer-events: none;
}

.lg-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-1px);
  box-shadow: 
    0 10px 30px rgba(0, 0, 0, 0.3),
    0 0 0 1px rgba(255, 255, 255, 0.1);
}

.lg-btn:hover::before {
  opacity: 0.8;
}

.lg-btn:active {
  transform: translateY(0) scale(0.98);
}

/* Primary Liquid Button */
.lg-btn-primary {
  background: linear-gradient(
    135deg,
    rgba(255, 215, 0, 0.15) 0%,
    rgba(255, 68, 136, 0.1) 100%
  );
  border-color: rgba(255, 215, 0, 0.2);
  color: #fff;
}

.lg-btn-primary::before {
  background: radial-gradient(
    80% 50% at 50% 0%,
    rgba(255, 215, 0, 0.3) 0%,
    transparent 60%
  );
}

.lg-btn-primary:hover {
  background: linear-gradient(
    135deg,
    rgba(255, 215, 0, 0.2) 0%,
    rgba(255, 68, 136, 0.15) 100%
  );
  box-shadow: 
    0 10px 30px rgba(0, 0, 0, 0.3),
    0 0 20px rgba(255, 215, 0, 0.1);
}

/* ============================================
   LIQUID CARDS
   ============================================ */

.lg-card {
  background: rgba(255, 255, 255, 0.02);
  backdrop-filter: blur(30px) saturate(150%);
  -webkit-backdrop-filter: blur(30px) saturate(150%);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 24px;
  padding: 2rem;
  position: relative;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.lg-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse at 50% 0%,
    rgba(255, 255, 255, 0.06) 0%,
    transparent 50%
  );
  pointer-events: none;
}

.lg-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(
    165deg,
    rgba(255, 255, 255, 0.12) 0%,
    rgba(255, 255, 255, 0.02) 40%,
    rgba(255, 255, 255, 0.05) 100%
  );
  -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;
  pointer-events: none;
}

.lg-card:hover {
  transform: translateY(-4px) scale(1.01);
  background: rgba(255, 255, 255, 0.04);
  box-shadow: 
    0 30px 60px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.08);
}

/* Card depth layers */
.lg-card-depth {
  position: relative;
}

.lg-card-depth::before {
  content: '';
  position: absolute;
  inset: -1px;
  background: linear-gradient(
    135deg,
    rgba(255, 215, 0, 0.1) 0%,
    transparent 30%,
    transparent 70%,
    rgba(136, 68, 255, 0.1) 100%
  );
  border-radius: 26px;
  z-index: -1;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.lg-card-depth:hover::before {
  opacity: 1;
}

/* ============================================
   LIQUID NAVIGATION
   ============================================ */

.lg-nav {
  background: rgba(10, 10, 18, 0.7);
  backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.lg-nav::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.03) 0%,
    transparent 100%
  );
  pointer-events: none;
}

/* Floating pill nav */
.lg-nav-pill {
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(40px) saturate(200%);
  -webkit-backdrop-filter: blur(40px) saturate(200%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 100px;
  padding: 0.5rem;
  display: inline-flex;
  gap: 0.25rem;
}

.lg-nav-pill .nav-item {
  padding: 0.625rem 1.25rem;
  border-radius: 100px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.3s ease;
  position: relative;
}

.lg-nav-pill .nav-item:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.lg-nav-pill .nav-item.active {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  box-shadow: 
    0 2px 8px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* ============================================
   LIQUID INPUTS
   ============================================ */

.lg-input {
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  color: #fff;
  font-size: 1rem;
  transition: all 0.3s ease;
  width: 100%;
}

.lg-input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.lg-input:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 215, 0, 0.3);
  box-shadow: 
    0 0 0 3px rgba(255, 215, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* ============================================
   LIQUID BADGES & TAGS
   ============================================ */

.lg-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.875rem;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 100px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
}

.lg-badge-gold {
  background: rgba(255, 215, 0, 0.08);
  border-color: rgba(255, 215, 0, 0.15);
  color: var(--color-phi);
}

/* ============================================
   LIQUID DIVIDERS
   ============================================ */

.lg-divider {
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.1) 20%,
    rgba(255, 255, 255, 0.2) 50%,
    rgba(255, 255, 255, 0.1) 80%,
    transparent 100%
  );
  margin: 2rem 0;
}

/* ============================================
   ANIMATION KEYFRAMES
   ============================================ */

@keyframes lg-shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

@keyframes lg-pulse-glow {
  0%, 100% {
    opacity: 0.5;
  }
  50% {
    opacity: 0.8;
  }
}

@keyframes lg-float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

.lg-shimmer {
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.1) 50%,
    transparent 100%
  );
  background-size: 200% 100%;
  animation: lg-shimmer 3s ease-in-out infinite;
}

.lg-pulse {
  animation: lg-pulse-glow 3s ease-in-out infinite;
}

.lg-float {
  animation: lg-float 6s ease-in-out infinite;
}

/* ============================================
   DEPTH LAYERS SYSTEM
   ============================================ */

.lg-layer-1 { transform: translateZ(0); }
.lg-layer-2 { transform: translateZ(20px); }
.lg-layer-3 { transform: translateZ(40px); }

.lg-perspective {
  perspective: 1000px;
  transform-style: preserve-3d;
}

/* ============================================
   MOBILE OPTIMIZATIONS
   ============================================ */

@media (max-width: 768px) {
  .lg-surface,
  .lg-card {
    backdrop-filter: blur(15px) saturate(150%);
    -webkit-backdrop-filter: blur(15px) saturate(150%);
  }
  
  .lg-nav {
    backdrop-filter: blur(20px) saturate(150%);
    -webkit-backdrop-filter: blur(20px) saturate(150%);
  }
  
  .lg-nav-pill {
    backdrop-filter: blur(30px) saturate(180%);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .lg-shimmer,
  .lg-pulse,
  .lg-float {
    animation: none;
  }
  
  .lg-card,
  .lg-btn {
    transition: none;
  }
}
