/* =====================================================================
   Launch-announcement popup (Mock HTML/bachpan-launch-popup.html).
   Rendered by Views/Shared/_LaunchPopup.cshtml, controlled by
   wwwroot/js/bp-launch-popup.js. Loaded on every page via _Layout.cshtml.

   Naming: every selector is bp-launch-* so it cannot collide with the
   existing preferences modal, feedback widget or share modal.
   ===================================================================== */

.bp-launch-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 20, 30, .65);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1200;
    padding: 1rem;
    animation: bpLaunchFadeIn .22s ease;
}

.bp-launch-overlay.is-open { display: flex; }

@keyframes bpLaunchFadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ─── POPUP CARD ───────────────────────────────────────────────── */
/* max-height + overflow-y must sit on the BASE rule, not just the mobile
   media query. Without it the popup grew to its full content height
   (~700px) on 540-1024px viewports — taller than most laptops in
   landscape and any phone in landscape — so the header (top) and CTA
   (bottom) clipped against the viewport edges.

   max-width raised from 460px → 640px so on typical desktop viewports
   (>=720px tall) all content fits in 90vh without the vertical scrollbar
   appearing. A wider card lets the feature rows breathe horizontally
   (description text stays on 1–2 lines instead of 3), reducing the total
   card height enough to clear the viewport. */
.bp-launch-popup {
    background: #FFFFFF;
    border-radius: 20px;
    width: 100%;
    max-width: 640px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 24px 64px rgba(0, 0, 0, .22);
    animation: bpLaunchSlideUp .28s cubic-bezier(.34, 1.3, .64, 1);
    position: relative;
    font-family: 'Poppins', sans-serif;
    color: #1A1A1A;
}

@keyframes bpLaunchSlideUp {
    from { transform: translateY(28px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

/* ─── HEADER BAND ──────────────────────────────────────────────── */
.bp-launch-header {
    background: linear-gradient(135deg, #004F7C 0%, #0077B6 55%, #0095E0 100%);
    padding: 1.1rem 1.25rem .9rem;
    position: relative;
    overflow: hidden;
}

.bp-launch-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, rgba(255, 255, 255, .07) 1px, transparent 1px);
    background-size: 18px 18px;
}

.bp-launch-header::after {
    content: '';
    position: absolute;
    right: -40px;
    top: -40px;
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .05);
}

.bp-launch-eyebrow {
    font-size: .62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: rgba(255, 255, 255, .6);
    margin-bottom: .35rem;
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: .3rem;
}

.bp-launch-eyebrow::before {
    content: '';
    display: block;
    width: 18px;
    height: 1.5px;
    background: rgba(255, 255, 255, .4);
}

.bp-launch-title {
    font-size: 1.2rem;
    font-weight: 800;
    color: #fff;
    line-height: 1.15;
    margin-bottom: .25rem;
    position: relative;
    z-index: 1;
}

.bp-launch-title .bp-launch-hl { color: #FFD166; }

.bp-launch-subtitle {
    font-size: .68rem;
    color: rgba(255, 255, 255, .85);
    line-height: 1.5;
    position: relative;
    z-index: 1;
    max-width: 520px;
}

.bp-launch-subtitle strong { color: #fff; font-weight: 600; }

/* Close × */
.bp-launch-close {
    position: absolute;
    top: .75rem;
    right: .85rem;
    width: 30px;
    height: 30px;
    background: rgba(255, 255, 255, .12);
    border: none;
    border-radius: 50%;
    color: rgba(255, 255, 255, .85);
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .13s;
    z-index: 2;
    padding: 0;
    line-height: 1;
}

.bp-launch-close:hover { background: rgba(255, 255, 255, .22); }
.bp-launch-close:focus-visible { outline: 2px solid #FFD166; outline-offset: 2px; }

/* ─── BODY ─────────────────────────────────────────────────────── */
.bp-launch-body { padding: .85rem 1.15rem .75rem; }

/* Feature list */
.bp-launch-features {
    display: flex;
    flex-direction: column;
    gap: .4rem;
    margin-bottom: .8rem;
}

.bp-launch-feature {
    display: flex;
    align-items: flex-start;
    gap: .6rem;
    padding: .45rem .55rem;
    background: #F7F9FC;
    border-radius: 10px;
    border: 1px solid #EAF0F7;
    text-decoration: none;
    color: inherit;
    transition: background .12s, border-color .12s;
    cursor: pointer;
}

.bp-launch-feature:hover { background: #EDF4FB; border-color: #B8D6EF; }

.bp-launch-feature-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .9rem;
    flex-shrink: 0;
    margin-top: .05rem;
}

.bp-launch-feature-icon--blue    { background: #E3F1FA; }
.bp-launch-feature-icon--saffron { background: #FFF4E0; }
.bp-launch-feature-icon--violet  { background: #F0EEF8; }
.bp-launch-feature-icon--pink    { background: #FBE9EF; }

.bp-launch-feature-text { min-width: 0; flex: 1; }

.bp-launch-feature-name {
    font-size: .72rem;
    font-weight: 600;
    color: #1A1A1A;
    display: flex;
    align-items: center;
    gap: .3rem;
    margin-bottom: .05rem;
    flex-wrap: wrap;
    line-height: 1.3;
}

.bp-launch-feature-arrow {
    font-size: .62rem;
    color: #0077B6;
    margin-left: .15rem;
}

.bp-launch-feature-desc {
    font-size: .6rem;
    color: #585450;
    line-height: 1.4;
}

.bp-launch-feature-tag {
    font-size: .5rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    padding: .1rem .32rem;
    border-radius: 999px;
    background: rgba(0, 119, 182, .1);
    color: #0077B6;
    flex-shrink: 0;
    align-self: flex-start;
}

.bp-launch-feature-tag--new {
    background: rgba(232, 146, 12, .1);
    color: #E8920C;
}

/* ─── FEEDBACK ROW ─────────────────────────────────────────────── */
.bp-launch-feedback {
    background: linear-gradient(135deg, #FFF8EE, #FFF3E0);
    border: 1px solid #FFD88A;
    border-radius: 10px;
    padding: .55rem .7rem;
    display: flex;
    align-items: center;
    gap: .6rem;
    margin-bottom: .75rem;
}

.bp-launch-feedback-icon { font-size: 1.2rem; flex-shrink: 0; }
.bp-launch-feedback-text { flex: 1; min-width: 0; }
.bp-launch-feedback-title { font-size: .7rem; font-weight: 600; color: #7A3C00; margin-bottom: .08rem; }
.bp-launch-feedback-sub   { font-size: .6rem; color: #9A6020; line-height: 1.4; }

.bp-launch-feedback-btn {
    background: #E8920C;
    color: #fff;
    border: none;
    border-radius: 999px;
    font-size: .62rem;
    font-weight: 700;
    padding: .3rem .75rem;
    cursor: pointer;
    white-space: nowrap;
    font-family: inherit;
    flex-shrink: 0;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

.bp-launch-feedback-btn:hover { background: #C77A03; color: #fff; }

/* ─── SHARE ROW ────────────────────────────────────────────────── */
.bp-launch-share {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-bottom: .25rem;
    flex-wrap: wrap;
}

.bp-launch-share-label {
    font-size: .62rem;
    color: #9A948E;
    font-weight: 500;
    white-space: nowrap;
}

.bp-launch-share-btns { display: flex; gap: .38rem; flex-wrap: wrap; }

.bp-launch-share-btn {
    height: 28px;
    padding: 0 .7rem;
    border-radius: 999px;
    border: 1.5px solid #EAE6E1;
    background: #fff;
    font-size: .62rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    text-decoration: none;
    color: #585450;
    transition: all .12s;
    font-family: inherit;
}

.bp-launch-share-btn:hover { border-color: #0077B6; color: #0077B6; }

.bp-launch-share-btn--wa { border-color: #25D366; color: #128C7E; }
.bp-launch-share-btn--wa:hover { background: #E8F9EF; color: #128C7E; }

.bp-launch-share-btn--fb { border-color: #1877F2; color: #1877F2; }
.bp-launch-share-btn--fb:hover { background: #EBF3FF; color: #1877F2; }

.bp-launch-share-btn--tw { border-color: #000; color: #000; }
.bp-launch-share-btn--tw:hover { background: #F1F1F1; color: #000; }

/* ─── FOOTER ACTIONS ───────────────────────────────────────────── */
.bp-launch-footer {
    padding: .65rem 1.15rem .8rem;
    border-top: 1px solid #EAE6E1;
    display: flex;
    align-items: center;
    gap: .6rem;
}

.bp-launch-btn-primary {
    flex: 1;
    height: 38px;
    background: #0077B6;
    color: #fff;
    border: none;
    border-radius: 999px;
    font-size: .76rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    font-family: inherit;
    transition: background .13s;
}

.bp-launch-btn-primary:hover { background: #005f91; }
.bp-launch-btn-primary svg { width: 15px; height: 15px; }

.bp-launch-dismiss-label {
    font-size: .58rem;
    color: #9A948E;
    text-align: center;
    max-width: 120px;
    line-height: 1.4;
}

/* ─── MOBILE — centered floating card ──────────────────────────── */
/* Keeps the all-four-corners-rounded mock look on phones too, instead of
   switching to a bottom-sheet (which clipped its bottom corners flush
   with the screen edge). Overlay padding pulls the card slightly inset
   from the viewport so the shadow + rounded corners stay visible. */
@media (max-width: 540px) {
    .bp-launch-overlay {
        padding: .6rem;
    }

    .bp-launch-popup {
        max-width: none;
        width: 100%;
        max-height: 88vh;
        border-radius: 18px;
    }

    .bp-launch-header { padding: 1rem 1.1rem .85rem; }
    .bp-launch-title  { font-size: 1.1rem; }
    .bp-launch-subtitle { font-size: .66rem; }

    .bp-launch-body { padding: .8rem 1rem .65rem; }
    .bp-launch-features { gap: .35rem; }

    .bp-launch-feedback {
        flex-wrap: wrap;
        row-gap: .45rem;
    }

    .bp-launch-feedback-btn {
        flex-basis: 100%;
        text-align: center;
        justify-content: center;
    }

    .bp-launch-share { flex-direction: column; align-items: flex-start; gap: .4rem; }
    .bp-launch-share-btns { width: 100%; }

    .bp-launch-footer {
        flex-direction: column;
        align-items: stretch;
        gap: .4rem;
        padding: .6rem 1rem .8rem;
    }

    .bp-launch-btn-primary { width: 100%; }
    .bp-launch-dismiss-label { max-width: none; }
}

/* Defensive: when the popup is open, lock the page scroll. */
html.bp-launch-open,
body.bp-launch-open {
    overflow: hidden;
}
