/* ============================================================
   Recently Viewed Names — nav-row icon + slide-in drawer
   Mirrors the bachpan-recently-viewed.html mock: the icon lives
   between Favourites and the user avatar on the bp-nav row, and
   reuses the existing .nav-icon-btn base styling.
   ============================================================ */

/* ── Nav-row icon — only the open-state + count badge are new;
       size / hover come from .nav-icon-btn in bachpan-design-system.css. ── */
.bp-rv-btn.is-open { background: rgba(255, 255, 255, .18); }

.bp-rv-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 999px;
    background: #E8920C;
    border: 2px solid #0077B6;
    color: #fff;
    font-size: .58rem;
    font-weight: 700;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bp-rv-badge[hidden] { display: none; }

/* ── Overlay ── */
.drawer-overlay {
    position: fixed;
    inset: 0;
    z-index: 300;
    background: rgba(28, 43, 58, .35);
    display: none;
    animation: rvFadeIn .18s ease-out;
}

.drawer-overlay.is-open { display: block; }

@keyframes rvFadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ── Drawer shell ── */
.rv-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 400;
    width: 380px;
    max-width: 100vw;
    background: #FFFFFF;
    box-shadow: -4px 0 32px rgba(0, 0, 0, .15);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform .25s cubic-bezier(.4, 0, .2, 1);
    visibility: hidden;
}

.rv-drawer.is-open {
    transform: translateX(0);
    visibility: visible;
}

@media (max-width: 600px) {
    .rv-drawer {
        top: auto;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        height: 80vh;
        border-radius: 14px 14px 0 0;
        box-shadow: 0 -4px 32px rgba(0, 0, 0, .15);
        transform: translateY(100%);
    }
    .rv-drawer.is-open { transform: translateY(0); }
    .rv-drawer::before {
        content: '';
        display: block;
        width: 36px;
        height: 4px;
        background: #D0CBC3;
        border-radius: 2px;
        margin: .65rem auto .1rem;
        flex-shrink: 0;
    }
}

/* ── Header ── */
.rv-head {
    padding: .9rem 1.1rem .75rem;
    border-bottom: 1px solid #EAE6E1;
    flex-shrink: 0;
}

.rv-head__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: .5rem;
}

.rv-head__title {
    font-size: .9rem;
    font-weight: 700;
    color: #1A1A1A;
    display: flex;
    align-items: center;
    gap: .45rem;
}

.rv-head__icon {
    width: 16px;
    height: 16px;
    color: #0077B6;
}

.rv-head__close {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1.5px solid #D0CBC3;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all .15s;
    padding: 0;
}

.rv-head__close:hover { border-color: #1A1A1A; }

.rv-head__close svg {
    width: 12px;
    height: 12px;
    color: #585450;
}

/* ── Sync pill ── */
.rv-pill {
    display: inline-flex;
    align-items: center;
    gap: .28rem;
    padding: .15rem .58rem;
    border-radius: 999px;
    font-size: .65rem;
    font-weight: 600;
    border: 1px solid;
}

.rv-pill--synced  { background: #E2F6EB; color: #0F5A30; border-color: #6FD0A0; }
.rv-pill--local   { background: #FFF4E0; color: #7A3C00; border-color: #FFD88A; }

/* ── Search ── */
.rv-search {
    display: flex;
    align-items: center;
    gap: .5rem;
    background: #FAFAF7;
    border: 1.5px solid #D0CBC3;
    border-radius: 999px;
    padding: .32rem .75rem;
    transition: border-color .15s;
}

.rv-search:focus-within { border-color: #0077B6; }

.rv-search svg {
    width: 13px;
    height: 13px;
    color: #9A948E;
    flex-shrink: 0;
}

/* Visually hidden label (accessibility) */
.rv-search__label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.rv-search__input {
    border: none;
    background: transparent;
    outline: none;
    font-size: .75rem;
    font-family: 'Poppins', sans-serif;
    color: #1A1A1A;
    flex: 1;
    width: 100%;
}

.rv-search__input::placeholder { color: #9A948E; }

/* ── Actions row ── */
.rv-actions {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-top: .5rem;
}

.rv-actions__count {
    font-size: .7rem;
    color: #9A948E;
}

.rv-actions__count span {
    color: #0077B6;
    font-weight: 600;
}

.rv-actions__clear {
    margin-left: auto;
    font-size: .7rem;
    font-weight: 600;
    color: #9A948E;
    cursor: pointer;
    border: none;
    background: none;
    font-family: 'Poppins', sans-serif;
    display: flex;
    align-items: center;
    gap: .2rem;
    transition: color .12s;
}

.rv-actions__clear[hidden] { display: none; }

.rv-actions__clear:hover { color: #C0392B; }

.rv-actions__clear svg {
    width: 11px;
    height: 11px;
}

/* ── Scrollable body ── */
.rv-body {
    flex: 1;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #D0CBC3 transparent;
}

.rv-body::-webkit-scrollbar { width: 4px; }

.rv-body::-webkit-scrollbar-thumb {
    background: #D0CBC3;
    border-radius: 2px;
}

/* ── Day group ── */
.rv-group { padding: .75rem 1.1rem .35rem; }

.rv-group__label {
    font-size: .62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: #9A948E;
    display: flex;
    align-items: center;
    gap: .4rem;
    margin-bottom: .5rem;
}

.rv-group__label::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #EAE6E1;
}

/* ── Name row ── */
.rv-row {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .55rem .65rem;
    border-radius: 10px;
    cursor: pointer;
    transition: all .15s;
    position: relative;
    margin-bottom: .25rem;
    text-decoration: none;
    color: inherit;
}

.rv-row:hover { background: #FAFAF7; }
.rv-row:hover .rv-row__remove { opacity: 1; }

.rv-row__stripe {
    width: 3px;
    border-radius: 2px;
    align-self: stretch;
    flex-shrink: 0;
}


.rv-row__info {
    flex: 1;
    min-width: 0;
}

.rv-row__name-line {
    display: flex;
    align-items: baseline;
    gap: .4rem;
    margin-bottom: .08rem;
}

.rv-row__name {
    font-size: .88rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #3D82C4;
}

.rv-row__name--girl { color: #B5294E; }

.rv-row__deva {
    font-family: 'Noto Sans Devanagari', 'Noto Sans', sans-serif;
    font-size: .72rem;
    color: #9A948E;
}

.rv-row__meaning {
    font-size: .68rem;
    color: #585450;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: .2rem;
}

.rv-row__meta {
    display: flex;
    gap: .3rem;
    align-items: center;
}

.rv-row__badge {
    font-size: .58rem;
    font-weight: 600;
    padding: .08rem .38rem;
    border-radius: 999px;
    border: 1px solid;
}

.rv-row__badge--rel   { background: #FFF4E0; color: #7A3C00; border-color: #FFD88A; }
.rv-row__badge--rashi { background: #F0EEF8; color: #534AB7; border-color: #C9C4ED; }

.rv-row__time {
    font-size: .6rem;
    color: #9A948E;
    flex-shrink: 0;
    white-space: nowrap;
}

.rv-row__actions {
    display: flex;
    gap: .22rem;
    align-items: center;
    flex-shrink: 0;
}

.rv-row__remove {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 1px solid #D0CBC3;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #9A948E;
    transition: all .14s;
    opacity: 0;
    padding: 0;
}

.rv-row__remove:hover {
    color: #C0392B;
    border-color: #C0392B;
    background: #FEF0EE;
}

.rv-row__remove svg {
    width: 10px;
    height: 10px;
}

/* ── Empty state ── */
.rv-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1.5rem;
    text-align: center;
    flex: 1;
}

.rv-empty__icon {
    font-size: 2.5rem;
    margin-bottom: .75rem;
    opacity: .5;
}

.rv-empty__title {
    font-size: .88rem;
    font-weight: 600;
    color: #585450;
    margin-bottom: .35rem;
}

.rv-empty__sub {
    font-size: .75rem;
    color: #9A948E;
    line-height: 1.6;
}

/* ── Footer ── */
.rv-foot {
    padding: .65rem 1.1rem;
    border-top: 1px solid #EAE6E1;
    background: #FAFAF7;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
}

.rv-foot[hidden] { display: none; }

.rv-foot__tip {
    font-size: .65rem;
    color: #9A948E;
    line-height: 1.45;
    flex: 1;
    display: inline-flex;
    align-items: center;
    gap: .25rem;
}

.rv-foot__tip svg {
    width: 11px;
    height: 11px;
    color: #0077B6;
}

.rv-foot__login {
    color: #0077B6;
    font-weight: 600;
    margin: 0 .25rem;
}

.rv-foot__close {
    height: 32px;
    padding: 0 .9rem;
    border-radius: 999px;
    border: 1.5px solid #D0CBC3;
    background: transparent;
    font-size: .72rem;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
    color: #585450;
    transition: all .15s;
    white-space: nowrap;
}

.rv-foot__close:hover {
    border-color: #0077B6;
    color: #0077B6;
}
