/* liquid-glass.css — Apple-grade Liquid Glass enhancement layer */

/* ── Enhanced glass variables ── */
:root {
  --lg-blur: 40px;
  --lg-saturate: 1.8;
  --lg-bg: rgba(12, 22, 52, 0.35);
  --lg-bg-elevated: rgba(12, 22, 52, 0.52);
  --lg-border: rgba(255, 255, 255, 0.09);
  --lg-border-bright: rgba(255, 255, 255, 0.18);
  --lg-highlight-top: rgba(255, 255, 255, 0.12);
  --lg-highlight-bottom: rgba(255, 255, 255, 0.02);
  --lg-shadow: 0 8px 40px -8px rgba(0, 0, 0, 0.35), 0 2px 8px -2px rgba(0, 0, 0, 0.15);
  --lg-shadow-hover: 0 16px 56px -12px rgba(0, 0, 0, 0.4), 0 4px 12px -4px rgba(0, 0, 0, 0.2);
  --lg-radius: 22px;
  --lg-radius-pill: 999px;
  --lg-refract: linear-gradient(135deg,
    rgba(255,255,255,0.08) 0%,
    rgba(255,255,255,0.02) 30%,
    transparent 50%,
    rgba(255,255,255,0.01) 70%,
    rgba(255,255,255,0.06) 100%);
  --lg-spring: cubic-bezier(0.175, 0.885, 0.32, 1.275);
  --lg-spring-soft: cubic-bezier(0.34, 1.56, 0.64, 1);
  --lg-ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* Day mode overrides */
body[data-mode="day"] {
  --lg-bg: rgba(255, 247, 232, 0.45);
  --lg-bg-elevated: rgba(255, 247, 232, 0.65);
  --lg-border: rgba(16, 42, 107, 0.08);
  --lg-border-bright: rgba(16, 42, 107, 0.15);
  --lg-highlight-top: rgba(255, 255, 255, 0.5);
  --lg-shadow: 0 8px 40px -8px rgba(16, 42, 107, 0.12);
  --lg-refract: linear-gradient(135deg,
    rgba(255,255,255,0.35) 0%,
    rgba(255,255,255,0.1) 30%,
    transparent 50%,
    rgba(255,255,255,0.05) 70%,
    rgba(255,255,255,0.2) 100%);
}

/* Dream mode overrides */
body[data-mode="dream"] {
  --lg-bg: rgba(255, 255, 255, 0.25);
  --lg-bg-elevated: rgba(255, 255, 255, 0.4);
  --lg-border: rgba(180, 176, 184, 0.18);
  --lg-border-bright: rgba(180, 176, 184, 0.3);
  --lg-highlight-top: rgba(255, 255, 255, 0.6);
}

/* ══════════════════════════════════════════
   GLASS SURFACES
   ══════════════════════════════════════════ */

/* All cards become liquid glass */
.card, .glass-card, .glass-panel {
  background: var(--lg-bg) !important;
  backdrop-filter: blur(var(--lg-blur)) saturate(var(--lg-saturate)) !important;
  -webkit-backdrop-filter: blur(var(--lg-blur)) saturate(var(--lg-saturate)) !important;
  border: 0.5px solid var(--lg-border) !important;
  border-radius: var(--lg-radius) !important;
  box-shadow:
    inset 0 0.5px 0 var(--lg-highlight-top),
    inset 0 -0.5px 0 var(--lg-highlight-bottom),
    var(--lg-shadow) !important;
  position: relative;
  overflow: hidden;
  transition:
    transform 320ms var(--lg-spring),
    box-shadow 320ms var(--lg-ease),
    border-color 240ms ease !important;
}

/* Specular refraction layer */
.card::before, .glass-card::before, .glass-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--lg-refract);
  pointer-events: none;
  z-index: 1;
  opacity: 0.7;
  border-radius: inherit;
  transition: opacity 300ms ease;
}

.card:hover, .glass-card:hover, .card-hover:hover {
  transform: translateY(-2px) scale(1.005) !important;
  border-color: var(--lg-border-bright) !important;
  box-shadow:
    inset 0 0.5px 0 rgba(255,255,255,0.15),
    inset 0 -0.5px 0 var(--lg-highlight-bottom),
    var(--lg-shadow-hover) !important;
}

.card:active, .glass-card:active {
  transform: translateY(0) scale(0.98) !important;
  transition-duration: 80ms !important;
}

/* ══════════════════════════════════════════
   GLASS NAVIGATION
   ══════════════════════════════════════════ */
nav, nav.glass-nav {
  background: var(--lg-bg-elevated) !important;
  backdrop-filter: blur(48px) saturate(2.0) !important;
  -webkit-backdrop-filter: blur(48px) saturate(2.0) !important;
  border: 0.5px solid var(--lg-border) !important;
  border-radius: 28px !important;
  box-shadow:
    inset 0 0.5px 0 var(--lg-highlight-top),
    0 12px 44px -10px rgba(0,0,0,0.3) !important;
}

/* ══════════════════════════════════════════
   GLASS BUTTONS
   ══════════════════════════════════════════ */
.ghost-btn, button.glass-btn {
  position: relative;
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  transition:
    transform 200ms var(--lg-spring),
    background 200ms ease,
    box-shadow 200ms ease !important;
}

.ghost-btn:active, button.glass-btn:active {
  transform: scale(0.95);
  transition-duration: 80ms !important;
}

/* Pill-shaped glass toggles */
.pill, .tag {
  backdrop-filter: blur(12px) saturate(1.3);
  -webkit-backdrop-filter: blur(12px) saturate(1.3);
  border-radius: var(--lg-radius-pill) !important;
  transition: all 200ms var(--lg-spring) !important;
}

/* ══════════════════════════════════════════
   GLASS MODALS & OVERLAYS
   ══════════════════════════════════════════ */
/* Deeper backdrop blur for modals */
[style*="position: fixed"][style*="backdrop-filter"],
[style*="position:fixed"][style*="backdrop-filter"] {
  backdrop-filter: blur(24px) saturate(1.6) !important;
  -webkit-backdrop-filter: blur(24px) saturate(1.6) !important;
}

/* ══════════════════════════════════════════
   GLASS INPUTS
   ══════════════════════════════════════════ */
input, textarea, select {
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition:
    border-color 200ms ease,
    box-shadow 200ms ease,
    transform 200ms var(--lg-spring) !important;
}

input:focus, textarea:focus {
  box-shadow:
    0 0 0 2px rgba(204, 162, 115, 0.15),
    inset 0 0.5px 0 rgba(255,255,255,0.05) !important;
  border-color: rgba(204, 162, 115, 0.3) !important;
  transform: scale(1.005);
}

body[data-mode="day"] input:focus,
body[data-mode="day"] textarea:focus {
  box-shadow: 0 0 0 2px rgba(1, 81, 133, 0.12) !important;
  border-color: rgba(1, 81, 133, 0.25) !important;
}

/* ══════════════════════════════════════════
   SPRING ANIMATIONS
   ══════════════════════════════════════════ */
@keyframes lg-bounce-in {
  0%   { transform: scale(0.85); opacity: 0; }
  60%  { transform: scale(1.03); opacity: 1; }
  100% { transform: scale(1); }
}

@keyframes lg-slide-up {
  0%   { transform: translateY(24px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}

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

@keyframes lg-glow-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(204, 162, 115, 0); }
  50%      { box-shadow: 0 0 20px 4px rgba(204, 162, 115, 0.12); }
}

/* Apply spring animation to stagger-in */
@keyframes stagger-in {
  0%   { opacity: 0; transform: translateY(16px) scale(0.97); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* ══════════════════════════════════════════
   SCROLLBAR — glass style
   ══════════════════════════════════════════ */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(247, 233, 207, 0.12);
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(247, 233, 207, 0.2);
}

body[data-mode="day"] ::-webkit-scrollbar-thumb {
  background: rgba(16, 42, 107, 0.1);
}

/* ══════════════════════════════════════════
   TOUCH FEEDBACK
   ══════════════════════════════════════════ */
@media (hover: none) {
  .card:active, .glass-card:active, .card-hover:active {
    transform: scale(0.97) !important;
    transition-duration: 60ms !important;
  }

  button:active {
    transform: scale(0.93);
    transition: transform 60ms ease !important;
  }
}

/* Ripple-like touch highlight for iOS */
* {
  -webkit-tap-highlight-color: rgba(204, 162, 115, 0.08);
}
