/* -----------------------------------------------------
   MindMesh Animated Background Collection
   ----------------------------------------------------- */


/* ======================================================================
   Name: Soft Pulse Glow
   ====================================================================== */
.mm-bg-pulse {
  background: radial-gradient(circle at 50% 50%, #3b0764, #0f172a);
  animation: mmPulse 12s ease-in-out infinite;
}

@keyframes mmPulse {
  0% { background-size: 100% 100%; opacity: 0.85; }
  50% { background-size: 120% 120%; opacity: 1; }
  100% { background-size: 100% 100%; opacity: 0.85; }
}


/* ======================================================================
   Name: Aurora Ribbon Sweep
   ====================================================================== */
.mm-bg-aurora {
  background: linear-gradient(
    120deg,
    rgba(124, 58, 237, 0.3),
    rgba(59, 130, 246, 0.2),
    rgba(16, 185, 129, 0.3)
  );
  background-size: 300% 300%;
  animation: mmAuroraSweep 18s ease-in-out infinite;
}

@keyframes mmAuroraSweep {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}


/* ======================================================================
   Name: Geometric Drift Grid
   ====================================================================== */
.mm-bg-grid {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 50px 50px;
  animation: mmGridDrift 40s linear infinite;
}

@keyframes mmGridDrift {
  0% { background-position: 0 0; }
  100% { background-position: 500px 500px; }
}


/* ======================================================================
   Name: Chromatic Flow
   ====================================================================== */
.mm-bg-chroma {
  background: linear-gradient(
    145deg,
    #0f172a,
    #1e3a8a,
    #7c3aed,
    #db2777,
    #1e3a8a
  );
  background-size: 500% 500%;
  animation: mmChromaFlow 35s ease-in-out infinite;
}

@keyframes mmChromaFlow {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}


/* ======================================================================
   Name: Widget Glow Halo
   ====================================================================== */
.mm-widget-halo {
  position: relative;
  overflow: hidden;
}

.mm-widget-halo::before {
  content: '';
  position: absolute;
  inset: -40%;
  background: radial-gradient(circle at 50% 50%,
    rgba(255,255,255,0.18),
    rgba(255,255,255,0) 60%
  );
  transform: rotate(10deg);
  opacity: 0.7;
  pointer-events: none;
}

/* Simple animated gradient background for the dashboard */
.dashboard-bg-animated {
  background: linear-gradient(135deg, #1e3a8a, #7c3aed, #0f172a);
  background-size: 400% 400%;
  animation: mindmeshGradientFlow 30s ease infinite;
}

@keyframes mindmeshGradientFlow {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.dashboard-bg-wrapper {
  min-height: 100vh;
  padding-bottom: 2rem;
}

.profile-bg-wrapper {
  min-height: calc(100vh - 4rem);
}

/* GridStack: content should fill the item box */
.grid-stack-item-content {
  height: auto;
}


/* Nav tightening: collapse profile dropdown to avatar-only under 1090px */
@media (max-width: 1090px) {
  .mm-user-menu-name,
  .mm-user-menu-chevron {
    display: none;
  }

  .mm-user-menu-button {
    padding-left: 0.25rem;
    padding-right: 0.25rem;
  }
}


/* Nav tightening: reduce primary nav link size under 1200px */
@media (max-width: 1200px) {
  .mm-primary-nav a {
    padding-left: 0.525rem;
    padding-right: 0.525rem;
  }
}

/* Fully tight */
@media (max-width: 1000px) {
  .mm-primary-nav a {
    font-size: 0.7rem;
    padding: 0.275rem 0.3rem;
  }
}

.mm-qa-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
}

.mm-qa-label {
  font-size: 13px;
}

.mm-qa-row button:active {
  transform: translateY(1px);
  filter: brightness(0.95);
}

.mm-ico {
  display: inline-block;
  vertical-align: -0.125em;
}


/* -----------------------------------------------------
   Fixed top navigation
   ----------------------------------------------------- */

:root {
  --mm-nav-height: 64px;
}

/* Prevent layout shift and hidden anchors */
html {
  scrollbar-gutter: stable;
  scroll-padding-top: var(--mm-nav-height);
  scroll-behavior: smooth;
}

body {
  padding-top: var(--mm-nav-height);
}

/* Fixed nav with glass styling */
body > nav.bg-white.shadow {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;

  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);

  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}


/* -----------------------------------------------------
   Primary nav states
   ----------------------------------------------------- */

.mm-primary-nav a {
  letter-spacing: 0.01em;
  line-height: 1.1;
  transition:
    background-color 120ms ease,
    color 120ms ease,
    box-shadow 120ms ease,
    transform 120ms ease;
}

/* Prominent hover */
.mm-primary-nav a:hover {
  background: rgba(37, 99, 235, 0.12);
  color: #2563eb;
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.18);
  transform: translateY(-1px);
}

/* Active nav pill */
.mm-primary-nav a.text-blue-600.font-semibold.bg-blue-50 {
  background: rgba(37, 99, 235, 0.14);
  border: 1px solid rgba(37, 99, 235, 0.22);
}

/* Active + hover */
.mm-primary-nav a.text-blue-600.font-semibold.bg-blue-50:hover {
  background: rgba(37, 99, 235, 0.18);
}


/* Mobile menu hover consistency */
#mobile-nav a:hover {
  background: rgba(37, 99, 235, 0.12);
}


/* -----------------------------------------------------
   Icon buttons & dropdowns
   ----------------------------------------------------- */

#mm-layout-controls button,
#mm-messages-link,
#mm-notifications-toggle,
.mm-profile-settings-btn,
.mm-user-menu-button {
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
}

/* Dropdowns match glass header */
#mm-layout-menu,
#mm-notifications-panel,
#user-menu-panel {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}


/* -----------------------------------------------------
   Accessibility polish
   ----------------------------------------------------- */

:focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.55);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* GridStack drag/resize should not be animated by your theme */
.grid-stack-item,
.grid-stack-item-content {
  transition: none !important;
}

/* Give the browser a hint that transforms will change */
.grid-stack-item {
  will-change: transform;
}

.sc-mood-share-btn {
  color: #ffffff !important;
}

/* The mobile panel owns scrolling, including its empty space. */
@media (max-width: 767px) {
  #mobile-nav {
    height: calc(100vh - var(--mm-nav-height, 64px));
    height: calc(100dvh - var(--mm-nav-height, 64px));
    max-height: calc(100vh - var(--mm-nav-height, 64px));
    max-height: calc(100dvh - var(--mm-nav-height, 64px));
    overflow-y: auto;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
    background: white;
  }
}

/* Share the compact phone gutter across personal and business widget pages. */
@media (max-width: 767px) {
  .profile-bg-wrapper > main,
  .mm-biz-page > main {
    padding-left: 8px;
    padding-right: 8px;
  }
  .profile-bg-wrapper { padding-top: 12px; }
  #profile-widgets-container, #biz-widgets-container { margin-top: 12px; }
  #profile-widgets-container > .grid-stack-item > .grid-stack-item-content,
  #biz-widgets-container > .grid-stack-item > .grid-stack-item-content {
    left: 0 !important;
    right: 0 !important;
  }
}

/* A phone stack follows saved rows, without desktop-sized empty cells. */
@media (max-width: 767px) {
  #profile-widgets-container, #biz-widgets-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    height: auto !important;
    min-height: 0 !important;
  }
  #profile-widgets-container > .grid-stack-item,
  #biz-widgets-container > .grid-stack-item {
    position: relative !important;
    inset: auto !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0;
  }
  #profile-widgets-container > .grid-stack-item > .grid-stack-item-content,
  #biz-widgets-container > .grid-stack-item > .grid-stack-item-content {
    position: relative !important;
    inset: auto !important;
    height: auto;
  }
  #profile-widgets-container .mm-pw,
  #biz-widgets-container .mm-pw {
    height: auto;
  }
  #profile-widgets-container .mm-business-calendar,
  #biz-widgets-container .mm-business-calendar {
    height: auto !important;
    max-height: none !important;
  }
}
