/* ─────────────────────────────────────────────────────────────────
   Leomee — Sitewide theme overlay.
   Loaded by base.html AFTER style.css so it can re-skin the global
   chrome (header, background, buttons, links, typography) to match
   the welcome page, without rewriting every page-specific stylesheet.

   Design tokens, background stage, and the brand language are
   intentionally identical to welcome.css — that's the whole point.
   ───────────────────────────────────────────────────────────────── */

:root {
  --lm-bg:        #FAFBFE;
  --lm-bg-2:      #F1F3FA;
  --lm-surface:   rgba(15, 23, 42, 0.035);
  --lm-surface-2: rgba(15, 23, 42, 0.06);
  --lm-border:    rgba(15, 23, 42, 0.08);
  --lm-border-2:  rgba(15, 23, 42, 0.14);

  --lm-text:      #0A0F24;
  --lm-text-mut:  #4B5572;
  --lm-text-dim:  #8089A6;

  --lm-violet:    #7C3AED;
  --lm-violet-2:  #8B5CF6;
  --lm-cyan:      #06B6D4;
  --lm-magenta:   #EC4899;
  --lm-amber:     #F59E0B;

  --lm-grad-primary: linear-gradient(135deg, #7C3AED 0%, #06B6D4 100%);
  --lm-grad-text:    linear-gradient(120deg, #7C3AED 0%, #06B6D4 60%, #EC4899 100%);

  --lm-shadow-card: 0 10px 30px -12px rgba(20, 30, 60, 0.16);
  --lm-shadow-soft: 0 4px 14px -6px rgba(15, 23, 42, 0.08);

  --lm-ease:     cubic-bezier(.16,1,.3,1);
  --lm-ease-out: cubic-bezier(.22,1,.36,1);
}

/* ── Body / typography ────────────────────────────────────────── */
html, body {
  background: var(--lm-bg) !important;
  color: var(--lm-text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection { background: rgba(124, 58, 237, 0.22); color: var(--lm-text); }

/* ── Background stage (blobs + grid) ──────────────────────────── */
/* Sits behind every page chrome via base.html. No animation on the
 * blobs themselves — paints once, costs ~zero per frame. */
.lm-bg-stage {
  position: fixed; inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.lm-bg-blob {
  position: absolute;
  width: 38vmax; height: 38vmax;
  border-radius: 50%;
  filter: blur(70px);
  opacity: .18;
}
.lm-bg-blob--violet { background: #7C3AED; top: -14%; left: -10%; }
.lm-bg-blob--cyan   { background: #06B6D4; bottom: -16%; right: -8%; }
.lm-bg-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(15,23,42,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15,23,42,0.04) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse at center, #000 0%, transparent 65%);
  -webkit-mask-image: radial-gradient(ellipse at center, #000 0%, transparent 65%);
}

/* Make sure the actual page content stacks above the stage. */
.app-wrapper { position: relative; z-index: 1; }

/* On mobile, drop one blob to save a paint layer. */
@media (max-width: 720px) {
  .lm-bg-blob--cyan { display: none; }
}

/* ── Global header — modernized to match welcome nav ───────────
   Targets the existing `.main-header` from base.html.
   We turn it into a sticky glass bar that compacts on scroll
   (the `is-scrolled` class is toggled from base.html JS). */
.main-header {
  position: sticky;
  top: 0;
  z-index: 50;
  min-height: 64px !important;
  padding: 12px 0;
  background: transparent !important;
  border-bottom: 1px solid transparent !important;
  transition: padding .3s var(--lm-ease), background .3s var(--lm-ease), border-color .3s var(--lm-ease), box-shadow .3s var(--lm-ease);
}
.main-header.is-scrolled {
  background: rgba(250, 251, 254, 0.84) !important;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom-color: var(--lm-border) !important;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
  padding: 8px 0;
}
.main-header .header-content {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

/* Brand logo block — turn the existing `.logo` anchor into a
 * logo-image + wordmark pair. We render the image as a CSS bg so
 * we don't have to touch every base.html include in the codebase. */
.main-header .logo {
  display: inline-flex !important;
  align-items: center;
  gap: 10px;
  /* Outfit @ 800 matches the brand wordmark — bold, slightly geometric,
   * with the same vivid indigo-violet as the supplied reference. */
  font-family: 'Outfit', 'Inter', sans-serif !important;
  font-weight: 800 !important;
  font-size: 22px !important;
  letter-spacing: -0.01em;
  text-transform: none;
  color: #5854FF !important;
  text-decoration: none;
  transition: transform .2s var(--lm-ease);
}
/* Logo image rendered as a background on the ::before pseudo so we
 * don't have to edit every `.logo` markup in the codebase. The PNG
 * is shown bare — no rounded tile, no fallback colour, no shadow. */
.main-header .logo::before {
  content: '';
  width: 38px; height: 38px;
  background-image: var(--lm-logo-url, none);
  background-color: transparent;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  display: inline-block;
  flex-shrink: 0;
  transition: transform .25s var(--lm-ease);
}
.main-header .logo:hover::before { transform: rotate(-4deg) scale(1.05); }

/* Header nav buttons — softer, with glassy hover */
.main-header .header-nav-btn {
  display: inline-flex !important;
  align-items: center;
  gap: 8px;
  padding: 8px 14px !important;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 999px !important;
  font-family: 'Inter', sans-serif;
  font-size: 13px !important;
  font-weight: 600 !important;
  color: var(--lm-text-mut) !important;
  text-decoration: none;
  cursor: pointer;
  transition: color .2s ease, background .2s ease, border-color .2s ease, transform .2s var(--lm-ease);
  position: relative;
}
.main-header .header-nav-btn:hover {
  color: var(--lm-text) !important;
  background: rgba(15, 23, 42, 0.04);
  border-color: rgba(15, 23, 42, 0.06);
  transform: translateY(-1px);
}
.main-header .header-nav-btn .label { font-weight: 600; }
.main-header .header-nav-btn .badge {
  background: var(--lm-grad-primary);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 999px;
  margin-left: 4px;
}

/* The "Login / Register" pill in `#guestActions` is already inline-
 * styled with `background: var(--gradient-primary)`; nudge it to
 * match our pill scale + radius. */
#guestActions a {
  border-radius: 999px !important;
  padding: 9px 18px !important;
  font-size: 13px !important;
  background: var(--lm-grad-primary) !important;
  box-shadow: 0 10px 24px -10px rgba(124, 58, 237, 0.55);
  transition: transform .2s var(--lm-ease), box-shadow .3s var(--lm-ease);
}
#guestActions a:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 32px -12px rgba(124, 58, 237, 0.65);
}

/* User profile pill */
.main-header .user-profile-menu .user-badge {
  background: var(--lm-surface-2);
  border: 1px solid var(--lm-border);
  border-radius: 999px;
  padding: 4px 8px 4px 14px;
  transition: border-color .2s ease, transform .2s var(--lm-ease);
}
.main-header .user-profile-menu .user-badge:hover {
  border-color: rgba(124, 58, 237, .3);
  transform: translateY(-1px);
}
.main-header .avatar-circle-sm {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--lm-grad-primary);
  color: #fff;
  display: inline-grid; place-items: center;
}

/* ── Hide the original wordmark when the logo block renders ──── */
.main-header .logo > *:not(:first-child) {
  display: inline-block;
}

/* ── Generic polish (links, cards) ────────────────────────────── */
a { color: inherit; }
.card, .panel, .section-card {
  background: #fff;
  border: 1px solid var(--lm-border);
  border-radius: 16px;
  box-shadow: var(--lm-shadow-soft);
}

/* ── Buttons — when pages use raw .btn without their own styles. */
.btn--lm-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--lm-grad-primary);
  color: #fff;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 700;
  border: 0;
  box-shadow: 0 10px 22px -10px rgba(124, 58, 237, 0.55);
  transition: transform .2s var(--lm-ease), box-shadow .3s var(--lm-ease);
  cursor: pointer;
  text-decoration: none;
}
.btn--lm-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 32px -12px rgba(124, 58, 237, 0.65);
}

.btn--lm-ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: #fff;
  color: var(--lm-text);
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 700;
  border: 1px solid var(--lm-border-2);
  transition: transform .2s var(--lm-ease), background .2s ease, border-color .2s ease;
  cursor: pointer;
  text-decoration: none;
}
.btn--lm-ghost:hover {
  background: var(--lm-bg-2);
  border-color: rgba(15, 23, 42, .22);
  transform: translateY(-2px);
}

/* ── Reduced motion respect ───────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001s !important;
    transition-duration: .001s !important;
  }
}
