/* ============================================
   DateFlo — Liquid Glass Design System
   Inspired by Apple's Liquid Glass (WWDC 2025)
   ============================================ */

/* --- Ambient Background Orbs ---
   Glass needs colorful backgrounds to look alive */
body::before,
body::after {
  content: '';
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  filter: blur(80px);
  opacity: .5;
  animation: orbFloat 20s ease-in-out infinite;
}
body::before {
  width: 500px; height: 500px;
  top: -10%; right: -8%;
  background: radial-gradient(circle, rgba(224,87,128,.2) 0%, transparent 70%);
}
body::after {
  width: 400px; height: 400px;
  bottom: -5%; left: -5%;
  background: radial-gradient(circle, rgba(116,185,255,.12) 0%, transparent 70%);
  animation-delay: -10s;
  animation-duration: 25s;
}
@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -20px) scale(1.05); }
  66% { transform: translate(-20px, 15px) scale(.95); }
}

/* Ensure main content sits above orbs */
.sidebar, .main-content, .login-page, .mobile-tabs,
.plan-topbar, .modal-overlay { position: relative; z-index: 1; }

/* --- Glass Card Enhancement --- */
.glass-card {
  background: var(--lg-bg);
  border: 1px solid var(--lg-border);
  backdrop-filter: blur(var(--lg-blur));
  -webkit-backdrop-filter: blur(var(--lg-blur));
  box-shadow: var(--lg-shadow), var(--lg-inset);
  position: relative;
  overflow: hidden;
}
.glass-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 50%;
  background: var(--lg-specular);
  pointer-events: none;
  border-radius: inherit;
  z-index: 0;
}
.glass-card:hover {
  border-color: var(--lg-border-hover);
  background: var(--lg-bg-hover);
  box-shadow: var(--lg-shadow-elevated), var(--lg-inset);
}

/* --- Plan Cards — Liquid Glass --- */
.plan-card {
  background: var(--lg-bg);
  border: 1px solid var(--lg-border);
  backdrop-filter: blur(var(--lg-blur));
  -webkit-backdrop-filter: blur(var(--lg-blur));
  box-shadow: var(--lg-shadow), var(--lg-inset);
  position: relative;
  overflow: hidden;
}
.plan-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 60%;
  background: var(--lg-specular);
  pointer-events: none;
  z-index: 1;
}
.plan-card:hover {
  border-color: rgba(224,87,128,.25);
  background: var(--lg-bg-hover);
  box-shadow: var(--lg-shadow-elevated), var(--lg-inset);
  transform: translateY(-6px);
}
.plan-card-thumb {
  position: relative;
}
/* Refraction tint on thumbnail */
.plan-card-thumb::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--lg-refraction);
  pointer-events: none;
}

/* New plan CTA card */
.plan-card-new {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 2px dashed var(--lg-border);
  transition: all .4s cubic-bezier(.4,0,.2,1);
}
.plan-card-new:hover {
  border-color: var(--rose);
  background: rgba(224,87,128,.06);
  box-shadow: 0 0 40px rgba(224,87,128,.08);
}

/* --- Sidebar — Liquid Glass Nav --- */
.sidebar {
  background: rgba(45,19,32,.75);
  backdrop-filter: blur(var(--lg-blur-heavy));
  -webkit-backdrop-filter: blur(var(--lg-blur-heavy));
  border-right: 1px solid var(--lg-border);
  box-shadow: 4px 0 24px rgba(0,0,0,.2);
}
/* Specular rim on sidebar */
.sidebar::after {
  content: '';
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 1px;
  background: linear-gradient(180deg, rgba(255,255,255,.12) 0%, rgba(255,255,255,.03) 50%, rgba(255,255,255,.08) 100%);
  pointer-events: none;
}

.nav-item {
  transition: all .3s cubic-bezier(.4,0,.2,1);
  position: relative;
}
.nav-item:hover {
  background: rgba(255,255,255,.06);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.06);
}
.nav-item.active {
  background: rgba(224,87,128,.1);
  box-shadow: inset 0 0 0 1px rgba(224,87,128,.15), 0 2px 8px rgba(224,87,128,.1);
}
/* Active indicator glow */
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 25%; bottom: 25%;
  width: 3px;
  background: var(--rose);
  border-radius: 0 4px 4px 0;
  box-shadow: 0 0 12px rgba(224,87,128,.5);
}

/* --- Mobile Tab Bar — Liquid Glass --- */
.mobile-tabs {
  background: rgba(45,19,32,.7);
  backdrop-filter: blur(var(--lg-blur-heavy));
  -webkit-backdrop-filter: blur(var(--lg-blur-heavy));
  border-top: 1px solid var(--lg-border);
  box-shadow: 0 -4px 24px rgba(0,0,0,.2);
}
/* Top specular edge */
.mobile-tabs::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, rgba(255,255,255,.03) 0%, rgba(255,255,255,.12) 50%, rgba(255,255,255,.03) 100%);
  pointer-events: none;
}

.tab-item.active {
  color: var(--rose);
  position: relative;
}
.tab-item.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%; transform: translateX(-50%);
  width: 20px; height: 3px;
  background: var(--rose);
  border-radius: 4px;
  box-shadow: 0 0 10px rgba(224,87,128,.5);
}

/* --- Favorite Cards — Liquid Glass --- */
.fav-card {
  background: var(--lg-bg);
  border: 1px solid var(--lg-border);
  backdrop-filter: blur(var(--lg-blur));
  -webkit-backdrop-filter: blur(var(--lg-blur));
  box-shadow: var(--lg-shadow), var(--lg-inset);
  position: relative;
  overflow: hidden;
  transition: all .4s cubic-bezier(.4,0,.2,1);
}
.fav-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 50%;
  background: var(--lg-specular);
  pointer-events: none;
  z-index: 0;
}
.fav-card:hover {
  border-color: var(--lg-border-hover);
  background: var(--lg-bg-hover);
  box-shadow: var(--lg-shadow-elevated), var(--lg-inset);
  transform: translateY(-4px);
}

/* --- Timeline Cards — Liquid Glass --- */
.timeline-card {
  background: var(--lg-bg);
  border: 1px solid var(--lg-border);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--lg-shadow), var(--lg-inset);
  position: relative;
  overflow: hidden;
  transition: all .4s cubic-bezier(.4,0,.2,1);
}
.timeline-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 50%;
  background: var(--lg-specular);
  pointer-events: none;
}
.timeline-card:hover {
  border-color: var(--lg-border-hover);
  transform: translateY(-2px);
  box-shadow: var(--lg-shadow-elevated), var(--lg-inset);
}

/* Timeline dot glow */
.timeline-dot {
  box-shadow: 0 0 12px rgba(224,87,128,.4), 0 0 4px rgba(224,87,128,.2);
}
.timeline-dot.completed {
  box-shadow: 0 0 12px rgba(0,184,148,.4), 0 0 4px rgba(0,184,148,.2);
}
.timeline-dot.upcoming {
  box-shadow: 0 0 12px rgba(249,202,36,.4), 0 0 4px rgba(249,202,36,.2);
}

/* --- Editable Sections — Liquid Glass --- */
.editable-section {
  background: var(--lg-bg);
  border: 1px solid var(--lg-border);
  backdrop-filter: blur(var(--lg-blur));
  -webkit-backdrop-filter: blur(var(--lg-blur));
  box-shadow: var(--lg-shadow), var(--lg-inset);
  position: relative;
  overflow: hidden;
}
.editable-section::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 50%;
  background: var(--lg-specular);
  pointer-events: none;
  z-index: 0;
}

/* --- Form Inputs — Frosted Glass --- */
.form-input {
  background: rgba(255,255,255,.04);
  border: 1px solid var(--lg-border);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: all .3s cubic-bezier(.4,0,.2,1);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
}
.form-input:focus {
  background: rgba(255,255,255,.06);
  border-color: var(--rose);
  box-shadow: 0 0 0 3px rgba(224,87,128,.12), inset 0 1px 0 rgba(255,255,255,.08), 0 4px 16px rgba(224,87,128,.08);
}

/* --- Choice Cards — Liquid Glass --- */
.choice {
  background: var(--lg-bg);
  border: 2px solid var(--lg-border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--lg-inset);
  transition: all .3s cubic-bezier(.4,0,.2,1);
  position: relative;
  overflow: hidden;
}
.choice::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 50%;
  background: var(--lg-specular);
  pointer-events: none;
  opacity: 0;
  transition: opacity .3s;
}
.choice:hover::before,
.choice.selected::before {
  opacity: 1;
}
.choice:hover {
  border-color: rgba(224,87,128,.35);
  background: rgba(224,87,128,.06);
  box-shadow: var(--lg-shadow), var(--lg-inset);
  transform: translateY(-2px);
}
.choice.selected {
  border-color: var(--rose);
  background: rgba(224,87,128,.08);
  box-shadow: 0 0 0 3px rgba(224,87,128,.12), var(--lg-shadow), var(--lg-inset);
}

/* --- Chips — Glass Pill --- */
.chip {
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
  transition: all .3s cubic-bezier(.4,0,.2,1);
}
.chip:hover {
  background: rgba(255,255,255,.08);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,.15), inset 0 1px 0 rgba(255,255,255,.08);
}
.chip.active {
  box-shadow: 0 0 0 2px rgba(224,87,128,.15), 0 4px 12px rgba(224,87,128,.1), inset 0 1px 0 rgba(255,255,255,.1);
}

/* --- Buttons — Glass Refinement --- */
.btn-primary {
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(224,87,128,.3), var(--lg-inset);
}
.btn-primary::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 50%;
  background: linear-gradient(180deg, rgba(255,255,255,.15) 0%, rgba(255,255,255,0) 100%);
  pointer-events: none;
  border-radius: inherit;
}
.btn-primary:hover {
  box-shadow: 0 8px 32px rgba(224,87,128,.45), 0 0 16px rgba(224,87,128,.2), var(--lg-inset);
}

.btn-ghost {
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--lg-border);
  box-shadow: var(--lg-inset);
}
.btn-ghost:hover {
  background: rgba(255,255,255,.08);
  border-color: var(--lg-border-hover);
  box-shadow: 0 4px 16px rgba(0,0,0,.2), var(--lg-inset);
}

.btn-icon {
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: var(--lg-inset);
  transition: all .3s cubic-bezier(.4,0,.2,1);
}
.btn-icon:hover {
  box-shadow: 0 4px 16px rgba(224,87,128,.15), var(--lg-inset);
  transform: scale(1.05);
}

/* --- Modal — Liquid Glass --- */
.modal-overlay {
  background: rgba(0,0,0,.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.modal {
  background: rgba(45,19,32,.85);
  border: 1px solid var(--lg-border);
  backdrop-filter: blur(var(--lg-blur-heavy));
  -webkit-backdrop-filter: blur(var(--lg-blur-heavy));
  box-shadow: var(--lg-shadow-elevated), var(--lg-inset);
  position: relative;
  overflow: hidden;
}
.modal::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 40%;
  background: var(--lg-specular);
  pointer-events: none;
  z-index: 0;
}

/* --- Plan Viewer Topbar — Liquid Glass --- */
.plan-topbar {
  background: rgba(45,19,32,.8);
  backdrop-filter: blur(var(--lg-blur-heavy));
  -webkit-backdrop-filter: blur(var(--lg-blur-heavy));
  border-bottom: 1px solid var(--lg-border);
  box-shadow: 0 4px 24px rgba(0,0,0,.2);
}
.plan-topbar::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, rgba(255,255,255,.03) 0%, rgba(255,255,255,.1) 50%, rgba(255,255,255,.03) 100%);
  pointer-events: none;
}

/* Plan FAB */
.plan-fab {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 4px 20px rgba(224,87,128,.4), var(--lg-inset);
  position: relative;
  overflow: hidden;
}
.plan-fab::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 50%;
  background: linear-gradient(180deg, rgba(255,255,255,.15) 0%, rgba(255,255,255,0) 100%);
  pointer-events: none;
  border-radius: inherit;
}

/* --- Status Badges — Glass Refinement --- */
.badge {
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.badge-requested {
  box-shadow: 0 2px 8px rgba(249,202,36,.15), inset 0 1px 0 rgba(249,202,36,.1);
}
.badge-progress {
  box-shadow: 0 2px 8px rgba(116,185,255,.15), inset 0 1px 0 rgba(116,185,255,.1);
}
.badge-delivered {
  box-shadow: 0 2px 8px rgba(0,184,148,.15), inset 0 1px 0 rgba(0,184,148,.1);
}

/* --- Plan Frame — Refined Shadow --- */
.plan-frame {
  box-shadow: 0 16px 64px rgba(0,0,0,.4), 0 4px 16px rgba(0,0,0,.2);
}

/* --- Skeleton Cards — Glass Shimmer --- */
.plan-card-skeleton {
  background: var(--lg-bg);
  border: 1px solid var(--lg-border);
  box-shadow: var(--lg-shadow), var(--lg-inset);
}

/* --- Edit Button — Glass Pill --- */
.edit-btn {
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: var(--lg-inset);
  transition: all .3s cubic-bezier(.4,0,.2,1);
}
.edit-btn:hover {
  box-shadow: 0 4px 12px rgba(224,87,128,.15), var(--lg-inset);
  transform: translateY(-1px);
}

/* --- Toggle Switch — Glass Refinement --- */
.toggle-slider {
  box-shadow: inset 0 1px 2px rgba(0,0,0,.3), 0 1px 0 rgba(255,255,255,.05);
}
.toggle-slider::before {
  box-shadow: 0 2px 6px rgba(0,0,0,.3), inset 0 1px 0 rgba(255,255,255,.2);
}

/* --- Scrollbar Glass Styling --- */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,.1);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,.18);
}

/* --- Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
  body::before, body::after { animation: none; }
  .plan-card, .fav-card, .timeline-card, .choice, .chip,
  .btn-primary, .btn-ghost, .btn-icon, .edit-btn {
    transition-duration: 0.01ms !important;
  }
}
