/* ============================================================
   BUDDY MARKETPLACE
   Buddy Level badges, achievement badges, the Experience package
   selector and the introduction-video affordance.

   Built from the same tokens as public.css. The brief here was "warm,
   social, premium, human" — so: no gold gradients, no VIP crowns, no
   trophy walls. A level badge is a small quiet pill; the Buddy's own
   photo stays the loudest thing on the card.

   A badge NEVER relies on colour alone: every one carries its own word.
   ============================================================ */

/* ---------- Buddy Level badge ---------- */
.lvl-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.3px;
    padding: 4px 10px;
    border-radius: 999px;
    white-space: nowrap;
    line-height: 1.3;
}
.lvl-badge .lvl-ico { font-size: 0.78rem; line-height: 1; }

.lvl-rising  { background: #e7f6ec; color: #17603a; }
.lvl-premium { background: #eef2fb; color: #23407c; }

/* Slightly larger on a profile header, where it sits beside the name. */
.lvl-badge-lg { font-size: 0.78rem; padding: 6px 13px; }

/* ---------- achievement badge ---------- */
/* At most ONE of these ever appears next to a level badge. */
.ach-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.68rem;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 999px;
    background: #fff2e3;
    color: #8a4a06;
    white-space: nowrap;
    line-height: 1.3;
}

.lvl-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    margin-bottom: 8px;
}

/* ---------- intro video play button over the photo ---------- */
/* The photo stays the main visual element: this is a 40px circle in the
   corner, not a player. Nothing about the card layout shifts when it is
   absent. */
.iv-play {
    position: absolute;
    right: 10px;
    bottom: 10px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.92);
    background: rgba(17, 24, 39, 0.62);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.92rem;
    cursor: pointer;
    padding: 0;
    backdrop-filter: blur(3px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28);
    transition: transform .15s ease, background .15s ease;
    z-index: 2;
}
.iv-play:hover,
.iv-play:focus-visible { background: rgba(17, 24, 39, 0.82); transform: scale(1.06); }
.iv-play:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
/* 44px is already an adequate touch target; keep it there on small screens
   rather than shrinking it to fit. */

/* The label that appears beside the button on hover/focus, desktop only.
   Hidden on touch, where there is no hover and the icon speaks for itself. */
.iv-play-label {
    position: absolute;
    right: 60px;
    bottom: 19px;
    background: rgba(17, 24, 39, 0.82);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 5px 10px;
    border-radius: 8px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity .15s ease;
    z-index: 2;
}
.iv-play:hover + .iv-play-label,
.iv-play:focus-visible + .iv-play-label { opacity: 1; }
@media (hover: none) {
    .iv-play-label { display: none; }
}

/* A text version for the profile page, next to the Buddy's name. */
.iv-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    border-radius: 999px;
    border: 2px solid var(--blue);
    background: transparent;
    color: var(--blue);
    font-weight: 800;
    font-size: 0.86rem;
    cursor: pointer;
    transition: background .15s ease, color .15s ease;
}
.iv-btn:hover { background: var(--blue); color: #fff; }

/* ---------- video modal ---------- */
.iv-modal[hidden] { display: none; }
.iv-modal {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(15, 23, 42, 0.72);
}
.iv-dialog {
    position: relative;
    width: min(440px, 100%);
    max-height: 92vh;
    overflow-y: auto;
    background: var(--surface, #fff);
    border-radius: 22px;
    padding: 22px 22px 18px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}
.iv-dialog h2 {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--ink);
    margin: 0 0 4px;
}
.iv-dialog .iv-sub {
    font-size: 0.86rem;
    color: var(--muted);
    margin: 0 0 14px;
}
.iv-dialog video {
    width: 100%;
    max-height: 62vh;
    border-radius: 14px;
    background: #000;
    display: block;
}
.iv-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid var(--line);
    background: var(--surface-soft, #f4f6fa);
    color: var(--ink);
    font-size: 1rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.iv-close:hover { background: var(--line); }
.iv-actions { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }

/* On a phone the dialog becomes a bottom sheet, which is where a thumb is. */
@media (max-width: 620px) {
    .iv-modal { padding: 0; align-items: flex-end; }
    .iv-dialog {
        width: 100%;
        border-radius: 22px 22px 0 0;
        max-height: 88vh;
        padding: 20px 18px 22px;
    }
    .iv-actions .pg-btn { width: 100%; }
}

/* ---------- Experience package selector ---------- */
.pkg-list {
    display: grid;
    gap: 10px;
    margin: 6px 0 4px;
}
.pkg {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    text-align: left;
    padding: 14px 16px;
    border: 2px solid var(--line);
    border-radius: 16px;
    background: var(--surface, #fff);
    cursor: pointer;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.pkg:hover { border-color: var(--blue); }
.pkg:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.pkg[aria-pressed="true"] {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(30, 79, 145, 0.12);
}
/* Selection is not signalled by the border alone — the selected package also
   shows a check, so it survives a colour-blind or high-contrast viewer. */
.pkg[aria-pressed="true"] .pkg-check { opacity: 1; }
.pkg-check {
    opacity: 0;
    color: var(--blue);
    font-size: 0.9rem;
    flex: none;
}
.pkg-main { min-width: 0; }
.pkg-hours { font-weight: 800; color: var(--ink); font-size: 0.98rem; }
.pkg-name  { font-size: 0.8rem; color: var(--muted); }
.pkg-price { font-weight: 800; color: var(--ink); font-size: 0.98rem; white-space: nowrap; }
.pkg-badge {
    position: absolute;
    top: -9px;
    left: 14px;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    padding: 3px 9px;
    border-radius: 999px;
    background: var(--orange, #ef8b2c);
    color: #fff;
}
/* ---------------------------------------------------------------------------
   WHAT THIS PRICE INCLUDES

   A <details>, not a paragraph. The customer choosing a package needs the
   price and the length; whether the pho is included is the second question,
   and it belongs one tap away rather than as four lines of grey text under
   every ladder.
   --------------------------------------------------------------------------- */
.pkg-note {
    font-size: 0.78rem;
    color: var(--muted);
    line-height: 1.55;
    margin: 10px 0 0;
}

.pkg-note > summary {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 34px;
    font-size: 0.79rem;
    font-weight: 700;
    color: var(--blue, #1e4f91);
    cursor: pointer;
    list-style: none;
}

.pkg-note > summary::-webkit-details-marker { display: none; }

.pkg-note > summary::before {
    content: 'B';
    display: inline-grid;
    place-items: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1px solid var(--line);
    font-size: 0.72rem;
    line-height: 1;
}

.pkg-note[open] > summary::before { content: '2'; }

.pkg-note-body {
    padding: 11px 13px;
    margin-top: 4px;
    border-radius: 12px;
    background: var(--surface-soft, #f4f8ff);
    border: 1px solid var(--line);
}

.pkg-inc, .pkg-exc { list-style: none; margin: 0; padding: 0; }

.pkg-inc li, .pkg-exc li {
    position: relative;
    padding-left: 20px;
    font-size: 0.79rem;
    line-height: 1.65;
    color: var(--ink);
    font-weight: 500;
}

.pkg-inc li::before {
    content: '¹3';
    position: absolute;
    left: 0;
    color: #1c6b3f;
    font-weight: 800;
}

.pkg-exc li::before {
    content: '3';
    position: absolute;
    left: 2px;
    color: var(--muted);
    font-weight: 800;
}

.pkg-exc-h {
    margin: 9px 0 2px;
    font-size: 0.74rem;
    font-weight: 700;
    color: var(--muted);
}

.pkg-conf {
    margin-top: 9px;
    padding-top: 8px;
    border-top: 1px solid var(--line);
    font-size: 0.75rem;
    line-height: 1.6;
    color: var(--muted);
}

/* ---------------------------------------------------------------------------
   AVAILABILITY

   Two states with two different jobs. `avail-free` reports a fact and can
   afford to look positive. `avail-ask` is the honest fallback for a Buddy
   with no published hours: it must read as a normal next step, not as a
   problem with the profile, so it is neutral rather than warning-coloured.
   --------------------------------------------------------------------------- */
.avail-line {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 0 0 14px;
    padding: 10px 12px;
    border-radius: 12px;
    font-size: 0.79rem;
    line-height: 1.55;
    font-weight: 600;
}

.avail-line[hidden] { display: none; }

.avail-line i { margin-top: 2px; }

.avail-free {
    background: #e9f7ef;
    border: 1px solid #bfe6cf;
    color: #1c6b3f;
}

.avail-ask {
    background: var(--surface-soft, #f4f8ff);
    border: 1px solid var(--line);
    color: var(--ink);
    font-weight: 500;
}

/* ---------- Buddy Level filter chips ---------- */
.lvl-filter { display: flex; gap: 8px; flex-wrap: wrap; }
.lvl-filter button {
    padding: 9px 15px;
    border-radius: 999px;
    border: 2px solid var(--line);
    background: var(--surface, #fff);
    color: var(--muted);
    font-weight: 700;
    font-size: 0.84rem;
    cursor: pointer;
    white-space: nowrap;
}
.lvl-filter button[aria-pressed="true"] {
    border-color: var(--blue);
    color: var(--blue);
    background: rgba(30, 79, 145, 0.06);
}
.lvl-filter button:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }

/* ---------- level explainer ---------- */
.lvl-explain {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 14px;
    margin: 0 0 22px;
}
.lvl-explain > div {
    background: var(--surface-soft, #f7f9fc);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 16px 18px;
}
.lvl-explain h3 { font-size: 0.95rem; font-weight: 800; color: var(--ink); margin: 8px 0 5px; }
.lvl-explain p  { font-size: 0.84rem; color: var(--muted); line-height: 1.6; margin: 0; }


/* ---------------------------------------------------------------------------
   WHAT THIS BOOKING IS

   Deliberately quiet. It is a boundary, not a warning, and a boundary shouted
   at somebody who was never going to cross it reads as an accusation.
   --------------------------------------------------------------------------- */
.scope-note {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 12px 0 0;
    font-size: 0.75rem;
    line-height: 1.6;
    color: var(--muted);
}

.scope-note i { margin-top: 2px; opacity: 0.7; }
