/* ==========================================================================
   daybreak.popupmenu.css
   Redesigned header user menu (the popup under the avatar / down-arrow).
   Used by #master-listnav-container on both desktop and mobile.

   Class prefix: .pm-  (popup menu) — namespaced to avoid any collision with
   Foundation globals (.reveal, .button, .callout, .close, .tabs, etc.).
   See CLAUDE.md "Foundation .reveal conflict".
   ========================================================================== */

.pm {
    --pm-ink: #1f2330;
    --pm-ink-soft: #6b7280;
    --pm-ink-faint: #9aa1ad;
    --pm-line: #ececec;

    /* Tile colours */
    --pm-tile-creme-bg: #f3ead9;
    --pm-tile-creme-fg: #b07d2e;
    --pm-tile-green-bg: #d8efd2;
    --pm-tile-green-fg: #3f8a4e;
    --pm-tile-blue-bg: #dbe7fb;
    --pm-tile-blue-fg: #2f6dd0;

    /* Progress-bar colours */
    --pm-bar-track: #f0f0ee;
    --pm-bar-amber: #f0a93b;
    --pm-bar-red: #e0584f;
    --pm-bar-green: #3f8a4e;
    --pm-bar-blue: #2f6dd0;

    font-family: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--pm-ink);
    text-align: left;
}

/* Reset some inherited header styles inside the menu */
.pm a {
    color: inherit;
    text-decoration: none;
    font-weight: inherit;
}

/* --------------------------------------------------------------------------
   Profile header (avatar · name · @username · N goals done · gear)
   -------------------------------------------------------------------------- */
.pm-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 12px 12px;
}

.pm-profile-avatar img,
.pm-profile-avatar .pm-avatar-fallback {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: block;
    object-fit: cover;
}

.pm-avatar-fallback {
    background-color: #cfe0f7;
    color: #2f6dd0;
    font-weight: 700;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
}

.pm-profile-text {
    flex-grow: 1;
    min-width: 0;
    line-height: 1.2;
}

.pm-profile-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--pm-ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pm-profile-meta {
    font-size: 0.78rem;
    color: var(--pm-ink-soft);
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pm-gear {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border: 1px solid var(--pm-line);
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--pm-ink-soft);
    font-size: 0.85rem;
    cursor: pointer;
    background-color: #fff;
    transition: background-color .12s ease, color .12s ease;
}

.pm-gear:hover {
    background-color: #f6f6f4;
    color: var(--pm-ink);
}

/* --------------------------------------------------------------------------
   Section labels (ACCOUNT / ACTIVE LISTS)
   -------------------------------------------------------------------------- */
.pm-section-label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--pm-ink-faint);
    padding: 9px 12px 4px;
    border-top: 1px solid var(--pm-line);
}

/* --------------------------------------------------------------------------
   Account rows (Notifications / Followers / Habits)
   -------------------------------------------------------------------------- */
.pm-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px;
    cursor: pointer;
    transition: background-color .12s ease;
}

.pm-row:hover {
    background-color: #faf9f6;
}

.pm-row-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 9px;
    background-color: #f4f3ef;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--pm-ink-soft);
    font-size: 0.82rem;
}

.pm-row-text {
    flex-grow: 1;
    min-width: 0;
    line-height: 1.2;
}

.pm-row-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--pm-ink);
}

.pm-row-sub {
    font-size: 0.76rem;
    color: var(--pm-ink-soft);
    margin-top: 1px;
}

.pm-row-trailing {
    flex-shrink: 0;
    font-size: 0.78rem;
    color: var(--pm-ink-soft);
    white-space: nowrap;
}

/* unread dot on Notifications */
.pm-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background-color: #e0584f;
    display: inline-block;
}

/* --------------------------------------------------------------------------
   List rows (ACTIVE LISTS)
   -------------------------------------------------------------------------- */
.pm-list {
    display: block;
    padding: 7px 12px 8px;
    border-top: 1px solid var(--pm-line);
    cursor: pointer;
    transition: background-color .12s ease;
}

.pm-list:first-of-type {
    border-top: none;
}

.pm-list:hover {
    background-color: #faf9f6;
}

.pm-list-main {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pm-tile {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.82rem;
    /* default = creme (regular lists) */
    background-color: var(--pm-tile-creme-bg);
    color: var(--pm-tile-creme-fg);
}

.pm-tile.pm-tile-green {
    background-color: var(--pm-tile-green-bg);
    color: var(--pm-tile-green-fg);
}

.pm-tile.pm-tile-blue {
    background-color: var(--pm-tile-blue-bg);
    color: var(--pm-tile-blue-fg);
}

.pm-list-text {
    flex-grow: 1;
    min-width: 0;
    line-height: 1.2;
}

.pm-list-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--pm-ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pm-list-lock {
    font-size: 0.7rem;
    color: var(--pm-ink-faint);
    margin-left: 5px;
}

.pm-list-sub {
    font-size: 0.76rem;
    color: var(--pm-ink-soft);
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Overdue pill */
.pm-pill-overdue {
    display: inline-block;
    font-size: 0.66rem;
    font-weight: 700;
    color: var(--pm-bar-red);
    background-color: #fbe6e4;
    border-radius: 5px;
    padding: 1px 5px;
    margin-right: 5px;
    vertical-align: 1px;
}

/* Progress bar */
.pm-bar {
    height: 3px;
    border-radius: 3px;
    background-color: var(--pm-bar-track);
    margin-top: 7px;
    overflow: hidden;
}

.pm-bar-fill {
    height: 100%;
    border-radius: 3px;
    background-color: var(--pm-bar-amber);
}

.pm-bar-fill.pm-bar-red { background-color: var(--pm-bar-red); }
.pm-bar-fill.pm-bar-green { background-color: var(--pm-bar-green); }
.pm-bar-fill.pm-bar-blue { background-color: var(--pm-bar-blue); }

/* --------------------------------------------------------------------------
   New list button
   -------------------------------------------------------------------------- */
.pm-newlist {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin: 9px 12px 11px;
    padding: 8px;
    border: 1px dashed #d6d6d0;
    border-radius: 9px;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--pm-ink-soft);
    cursor: pointer;
    transition: border-color .12s ease, color .12s ease, background-color .12s ease;
}

.pm-newlist:hover {
    border-color: #b9b9b0;
    color: var(--pm-ink);
    background-color: #faf9f6;
}

/* --------------------------------------------------------------------------
   Desktop container chrome — make the dropdown a clean white card.
   (Overrides the legacy padding set on #master-listnav-container.)
   -------------------------------------------------------------------------- */
#master-listnav-container {
    padding: 0;
    box-shadow: 0 12px 32px rgba(31, 35, 48, 0.16);
    border: 1px solid #eee;
    background-color: #fff;
    overflow: hidden;
}

/* Inner card scrolls when the menu is taller than the viewport. The container
   keeps overflow:hidden so the rounded corners clip the scroll area. */
#master-listnav-container .pm {
    max-height: calc(100vh - 80px);
    overflow-y: auto;
    overscroll-behavior: contain;
}

/* --------------------------------------------------------------------------
   Mobile — the same .pm markup renders inside the full-height slide panel
   (#master-listsmenu-small), which already scrolls. No floating card.
   -------------------------------------------------------------------------- */
#master-listsmenu-small .pm {
    background-color: #fff;
    padding-bottom: 24px;
}

@media (max-width: 670px) {
    .pm-profile-name { font-size: 0.95rem; }
    .pm-row-title,
    .pm-list-name { font-size: 0.85rem; }
    .pm-row-sub,
    .pm-list-sub { font-size: 0.76rem; }
}
