/* ═══════════════════════════════════════════════════════════════════════
   LEOMEE — Web focus layer
   ───────────────────────────────────────────────────────────────────────
   The website is a "try it" surface for the two things people use every
   day: the Feed and Chats. This layer (loaded last, scoped to
   body.lm-focus) does three jobs:

     1. One accent. The same indigo→violet as the mobile app's Home and
        Messages (#6D28D9 / #8B5CF6) replaces the electric blue + indigo mix.
     2. Two destinations. Styles the slimmed sidebar (Feed, Chats, New post)
        and the 3-slot mobile bottom bar with labels.
     3. Small fixes: the mobile header no longer pushes "Login" off-screen,
        Chats lists conversations on the LEFT on desktop.

   Remove the <link> in base.html and the `lm-focus` body class to revert.
   ═══════════════════════════════════════════════════════════════════════ */

body.lm-focus {
  --f-purple:      #6D28D9;
  --f-purple-2:    #8B5CF6;
  --f-purple-deep: #1E0B5E;
  --f-purple-soft: rgba(109, 40, 217, 0.10);
  --f-grad:        linear-gradient(135deg, #6D28D9 0%, #8B5CF6 100%);

  /* Re-point every accent token the older layers read. */
  --c-primary:       var(--f-purple);
  --c-primary-h:     #5B21B6;
  --c-accent:        var(--f-purple-2);
  --c-grad:          var(--f-grad);
  --gradient-primary: var(--f-grad);
  --electric-blue:   var(--f-purple);
  --electric-blue-rgb: 109, 40, 217;
  --electric-blue-light: #EDE9FE;
  --neon-purple:     var(--f-purple-2);
  --accent-purple:   var(--f-purple-2);
  --ring:            0 0 0 3px rgba(109, 40, 217, 0.22);
}

body.lm-focus[data-theme="dark"] {
  --f-purple:      #8B5CF6;
  --f-purple-soft: rgba(139, 92, 246, 0.16);
  --c-primary:     #8B5CF6;
  --c-primary-h:   #7C3AED;
  --electric-blue: #8B5CF6;
  --electric-blue-rgb: 139, 92, 246;
  --ring:          0 0 0 3px rgba(139, 92, 246, 0.30);
}

/* ── Desktop sidebar: Feed, Chats, New post ─────────────────────────── */
body.lm-focus .menu-options {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

body.lm-focus .menu-item {
  font-size: 1rem;
  font-weight: 600;
  padding: 12px 14px;
}

body.lm-focus .menu-item.active {
  color: var(--f-purple) !important;
  background: var(--f-purple-soft) !important;
}

body.lm-focus .menu-item.active i,
body.lm-focus .menu-item.active svg { color: var(--f-purple) !important; }

body.lm-focus .menu-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--f-grad);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 10px 22px -12px rgba(109, 40, 217, 0.7);
  transition: transform .18s ease, box-shadow .18s ease;
}

body.lm-focus .menu-cta:hover { transform: translateY(-1px); box-shadow: 0 14px 28px -12px rgba(109, 40, 217, 0.8); }
body.lm-focus .menu-cta svg,
body.lm-focus .menu-cta i { width: 18px; height: 18px; color: #fff; }

/* ── Mobile bottom bar: Feed · (+) · Chats ──────────────────────────── */
@media (max-width: 992px) {
  body.lm-focus .mobile-bottom-nav {
    /* The pill bar sat at width:100% PLUS side margins, so it ran past the
       right edge of the screen. Pin both edges instead. */
    width: auto !important;
    left: 12px !important;
    right: 12px !important;
    margin: 0 !important;
    justify-content: space-around;
    align-items: center;
    padding: 6px 12px calc(6px + env(safe-area-inset-bottom));
  }

  body.lm-focus .mobile-bottom-nav a {
    flex-direction: column;
    gap: 2px;
    min-width: 72px;
    padding: 6px 10px;
    font-size: 1rem;
    color: var(--text-muted);
    background: none !important;
    box-shadow: none !important;
    text-decoration: none !important;
  }

  body.lm-focus .mobile-bottom-nav a.active { color: var(--f-purple) !important; }

  body.lm-focus .mbn-label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.01em;
  }

  body.lm-focus .mobile-bottom-nav a.mbn-create {
    min-width: 0;
    width: 52px;
    height: 52px;
    padding: 0;
    border-radius: 50%;
    background: var(--f-grad) !important;
    color: #fff !important;
    box-shadow: 0 10px 22px -10px rgba(109, 40, 217, 0.8) !important;
    margin-top: -18px;
  }

  body.lm-focus .mobile-bottom-nav a.mbn-create svg { width: 24px; height: 24px; }

  body.lm-focus .mobile-bottom-nav .badge {
    position: absolute;
    top: 2px;
    right: 14px;
  }

  /* Header: keep logo + actions on one line at phone widths. */
  body.lm-focus .header-content { gap: 10px; }
  body.lm-focus .header-search { display: none; }
  body.lm-focus .logo-mark { width: 112px; height: auto; }
  body.lm-focus #guestActions a.header-nav-btn {
    padding: 8px 14px !important;
    font-size: 0.85rem;
    white-space: nowrap;
  }
}

@media (max-width: 380px) {
  body.lm-focus #guestActions a.header-nav-btn svg,
  body.lm-focus #guestActions a.header-nav-btn i { display: none; }
}

/* ── Home: New post button + Chats side card ────────────────────────── */
body.lm-focus .feed-new-post {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 12px;
  background: var(--f-grad);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 10px 22px -12px rgba(109, 40, 217, 0.7);
}

body.lm-focus .feed-new-post svg,
body.lm-focus .feed-new-post i { width: 16px; height: 16px; }

body.lm-focus .side-card {
  padding: 24px 22px;
  border-radius: 20px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
}

body.lm-focus .side-card__icon {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--f-purple-soft);
  color: var(--f-purple);
}

body.lm-focus .side-card__icon svg { width: 22px; height: 22px; }

body.lm-focus .side-card__title {
  margin: 14px 0 6px;
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-primary);
}

body.lm-focus .side-card__text {
  margin: 0 0 18px;
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--text-secondary);
}

body.lm-focus .side-card__btn {
  display: block;
  text-align: center;
  padding: 11px 16px;
  border-radius: 12px;
  background: var(--f-grad);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
}

body.lm-focus .side-card__list {
  list-style: none;
  margin: 18px 0 0;
  padding: 16px 0 0;
  border-top: 1px solid var(--border-color);
  display: grid;
  gap: 10px;
}

body.lm-focus .side-card__list li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

body.lm-focus .side-card__list svg { width: 16px; height: 16px; color: var(--f-purple); }

/* ── Tabs (Feed and Chats) use the same purple pill ─────────────────── */
body.lm-focus .tab-btn.active {
  color: var(--f-purple) !important;
  border-color: var(--f-purple) !important;
  box-shadow: none !important;
}

/* ── Chats: conversation list on the LEFT on desktop ────────────────── */
@media (min-width: 993px) {
  body.lm-focus .layout-container:has(#connectionsList) .right-container { order: 1; }
  body.lm-focus .layout-container:has(#connectionsList) .main-content { order: 2; }
}

/* ── Keyboard focus stays visible everywhere we added controls ──────── */
body.lm-focus .menu-cta:focus-visible,
body.lm-focus .feed-new-post:focus-visible,
body.lm-focus .side-card__btn:focus-visible,
body.lm-focus .mobile-bottom-nav a:focus-visible {
  outline: 2px solid var(--f-purple);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  body.lm-focus .menu-cta,
  body.lm-focus .feed-new-post { transition: none; }
}
