/* ============================================================
   PREMIUM GLASSMORPHISM OVERRIDES
   ============================================================ */

/* Mesh animated background */
.mesh-bg {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: -1;
  background: var(--bg);
  overflow: hidden;
}

.mesh-blob {
  position: absolute;
  filter: blur(80px);
  opacity: 0.6;
  border-radius: 50%;
  animation: floatBlobs 20s infinite alternate ease-in-out;
}

.blob-1 {
  top: -10%;
  left: -10%;
  width: 50vw;
  height: 50vw;
  background: #8b5cf6;
}

.blob-2 {
  bottom: -10%;
  right: -10%;
  width: 60vw;
  height: 60vw;
  background: #ec4899;
  animation-delay: -5s;
}

.blob-3 {
  top: 40%;
  left: 60%;
  width: 40vw;
  height: 40vw;
  background: #3b82f6;
  animation-delay: -10s;
}

@keyframes floatBlobs {
  0% {
    transform: translate(0, 0) scale(1);
  }

  50% {
    transform: translate(10vw, 20vh) scale(1.1);
  }

  100% {
    transform: translate(-20vw, 10vh) scale(0.9);
  }
}

/* Glass Theme Variables */
:root {
  --glass-bg: rgba(255, 255, 255, 0.55);
  --glass-border: rgba(255, 255, 255, 0.45);
  --glass-shadow: 0 8px 32px rgba(31, 38, 135, 0.07);
}

body.dark-mode {
  --glass-bg: rgba(30, 41, 59, 0.6);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

body.dark-mode .blob-1 {
  background: #4c1d95;
  filter: blur(100px);
}

body.dark-mode .blob-2 {
  background: #831843;
  filter: blur(100px);
}

body.dark-mode .blob-3 {
  background: #1e3a8a;
  filter: blur(100px);
}

/* Remove default solid body background */
body {
  background: transparent !important;
}

/* Apply Glass to Containers */
.topbar,
.bottom-nav,
.bottom-sheet,
.stat-chip,
.search-bar,
.member-card,
.hero-card,
.mcard,
.mfull-card,
.sheet-amt-wrap,
.sheet-text-input {
  background: var(--glass-bg) !important;
  backdrop-filter: blur(24px) !important;
  -webkit-backdrop-filter: blur(24px) !important;
  border: 1px solid var(--glass-border) !important;
  box-shadow: var(--glass-shadow) !important;
}

.stat-chip,
.search-bar,
.member-card,
.hero-card,
.mcard,
.mfull-card,
.sheet-amt-wrap,
.sheet-text-input {
  margin-bottom: 10px;
}

.lock-card {
  position: relative;
  width: 90%;
  max-width: 400px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  border-radius: 24px;
  padding: 40px 24px;
  text-align: center;
}

/* Fix Modal Overlay Clipping Bug */
.sheet-overlay {
  z-index: 9991 !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
  background: rgba(0, 0, 0, 0.5) !important;
}

.bottom-sheet {
  z-index: 9992 !important;
  transform: translateZ(0);
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1), opacity 0.35s ease, visibility 0.35s !important;
}

.bottom-sheet.open {
  opacity: 1 !important;
  pointer-events: auto !important;
  visibility: visible !important;
}

/* Ensure bottom nav has proper border */
.bottom-nav {
  border-top: 1px solid var(--glass-border) !important;
}

/* Make sure text doesn't inherit background */
.search-bar input,
.search-bar select {
  background: transparent !important;
  border: none !important;
}

/* Squircles & Avatars */
.mc-avatar,
.mfull-avatar,
.sheet-member-avatar,
.topbar-logo,
.stat-chip,
.hero-card,
.mcard {
  border-radius: 20px !important;
}

/* Micro Animations - hover states */
.member-card,
.mcard,
.stat-chip,
.hero-card {
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease, border-color 0.3s ease !important;
}

.member-card:hover,
.mcard:hover,
.stat-chip:hover,
.hero-card:hover {
  transform: translateY(-4px) scale(1.02) !important;
  box-shadow: 0 12px 40px rgba(99, 102, 241, 0.15) !important;
  border-color: rgba(255, 255, 255, 0.8) !important;
}

body.dark-mode .member-card:hover,
body.dark-mode .mcard:hover,
body.dark-mode .stat-chip:hover,
body.dark-mode .hero-card:hover {
  border-color: rgba(255, 255, 255, 0.25) !important;
}

/* Refined Action Buttons */
.sheet-save-btn,
.topbar-fab {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #ec4899 100%) !important;
  color: white !important;
  border: none !important;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4) !important;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease !important;
}

.sheet-save-btn:active,
.topbar-fab:active {
  transform: scale(0.92) !important;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3) !important;
}

/* Month Button Glassing */
.mc-month-btn {
  background: rgba(255, 255, 255, 0.3) !important;
  border: 1px solid var(--glass-border) !important;
}

body.dark-mode .mc-month-btn {
  background: rgba(30, 41, 59, 0.4) !important;
}

.mc-month-btn.is-paid {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.35), rgba(16, 185, 129, 0.15)) !important;
  border-color: rgba(16, 185, 129, 0.3) !important;
}

.mc-month-btn.is-unpaid {
  background: rgba(239, 68, 68, 0.2) !important;
  border-color: rgba(239, 68, 68, 0.2) !important;
}

/* ============================================================
   SMOOTH AS BUTTER ANIMATIONS & ACCORDIONS
   ============================================================ */

/* Member Card Accordion */
.mc-months {
  display: block !important;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  border-top: none !important;
  transition: max-height 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease, padding 0.4s ease !important;
}

.member-card.expanded .mc-months {
  max-height: 600px !important;
  opacity: 1;
  padding-top: 14px !important;
  padding-bottom: 16px !important;
  border-top: 1px solid var(--glass-border) !important;
}

/* Payment Modal Paid Fields Accordion */
.sheet-paid-fields {
  display: block !important;
  max-height: 400px;
  opacity: 1;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease !important;
  animation: none !important;
}

.sheet-paid-fields.hidden {
  max-height: 0 !important;
  opacity: 0 !important;
  margin: 0 !important;
  pointer-events: none;
}

/* Modal Open/Close smoother transition */
.bottom-sheet {
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.35s ease, visibility 0.35s !important;
}

.sheet-overlay {
  transition: opacity 0.4s ease !important;
}

/* Button Loading State Spinner Setup */
.btn-loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}

.btn-loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin-top: -10px;
  margin-left: -10px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  100% {
    transform: rotate(360deg);
  }
}

/* ============================================================
   LOCK SCREEN & VERIFICATION MODAL
   ============================================================ */
.lock-screen {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 100000;
  background: var(--bg);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.lock-screen.hidden {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

.lock-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.lock-title {
  font-family: 'Nunito', sans-serif;
  font-size: 26px;
  font-weight: 800;
  color: var(--text);
}

.lock-sub {
  font-size: 14px;
  color: var(--muted);
  margin-top: 8px;
  font-weight: 500;
}

.lock-error {
  color: #ef4444 !important;
  font-weight: 700;
}

/* Fix Desktop Gap */
@media (min-width: 768px) {
  .main {
    max-width: none !important;
    padding-right: 28px !important;
  }
}

.bnav-item,
.dnav-btn {
  text-decoration: none;
}