/* =========================================================
   SOCIAL.CSS  (new file, loaded after style.css)
   Search, gallery, full screen viewer, user chooser, status likes.
   Uses the same colors as style.css (--magenta, --paper, --line ...).
   ========================================================= */

/* sheets and likes must float above the full screen viewers */
.modal { z-index: 80; }

/* ---------- small shared pieces ---------- */
.chip {
    flex: none;
    height: 34px;
    padding: 0 14px;
    border-radius: 17px;
    border: 1.5px solid var(--line);
    background: #fff;
    color: var(--ink);
    font-family: var(--body);
    font-size: 13.5px;
    font-weight: 700;
    white-space: nowrap;
    transition: background .15s ease, color .15s ease, border-color .15s ease, transform .15s ease;
}
.chip i { font-style: normal; opacity: .55; margin-left: 4px; font-weight: 600; }
.chip.on {
    background-image: var(--brand);
    background-color: var(--magenta);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 6px 16px rgba(255, 46, 147, .3);
}
select.chip {
    -webkit-appearance: none;
    appearance: none;
    padding-right: 30px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238E7284' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 14px;
    cursor: pointer;
}
select.chip.on {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"), var(--brand);
    background-repeat: no-repeat, no-repeat;
    background-position: right 10px center, center;
    background-size: 14px, auto;
}

/* the heart bounces when you like */
@keyframes heartpop { 0% { transform: scale(1); } 40% { transform: scale(1.45); } 100% { transform: scale(1.1); } }
.likebtn.pop { animation: heartpop .35s ease; }

/* =========================================================
   1. SEARCH PAGE
   ========================================================= */
.searchPage {
    position: absolute;
    top: 0; left: 0; right: 0;
    min-height: 100vh;
    display: none;
    flex-direction: column;
    background: var(--paper);
    background-image: radial-gradient(circle at 85% -5%, rgba(255, 46, 147, .12), transparent 45%);
    z-index: 1;
    padding-bottom: calc(var(--nav-h) + var(--safe-b) + 24px);
}
.s-head {
    position: sticky;
    top: 0;
    z-index: 3;
    padding: calc(14px + var(--safe-t)) 16px 10px;
    background: rgba(255, 248, 251, .92);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
}
.s-head h3 {
    margin: 0 0 10px 4px;
    font-family: var(--display);
    font-weight: 800;
    font-size: 26px;
    letter-spacing: -.5px;
}
.s-box {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 50px;
    padding: 0 8px 0 16px;
    border-radius: 25px;
    background: #fff;
    border: 1.5px solid var(--line);
    box-shadow: 0 6px 20px rgba(27, 10, 23, .06);
    transition: border-color .15s ease, box-shadow .15s ease;
}
.s-box:focus-within {
    border-color: var(--magenta);
    box-shadow: 0 0 0 4px rgba(255, 46, 147, .14), 0 6px 20px rgba(27, 10, 23, .06);
}
.s-ic { flex: none; width: 20px; height: 20px; fill: none; stroke: var(--mist); stroke-width: 2.2; stroke-linecap: round; }
.s-box input {
    flex: 1;
    min-width: 0;
    height: 100%;
    border: none;
    outline: none;
    background: transparent;
    font-family: var(--body);
    font-size: 16px;
    color: var(--ink);
}
.s-clear {
    display: none;
    flex: none;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    background: var(--blush);
    color: var(--mist);
    font-size: 14px;
}
.s-filters {
    display: flex;
    gap: 8px;
    padding: 12px 0 2px;
    overflow-x: auto;
    scrollbar-width: none;
}
.s-filters::-webkit-scrollbar { display: none; }

.s-body { padding: 6px 14px 0; }
.s-sec {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 4px 8px;
}
.s-sec h5 {
    margin: 0;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--mist);
}
.s-sec span { font-size: 12px; font-weight: 700; color: var(--mist); }
.s-link { font-size: 13px; font-weight: 700; color: var(--magenta); }
.s-recent { display: flex; flex-wrap: wrap; gap: 8px; }
.s-none { margin: 4px; color: var(--mist); font-size: 15px; }

.s-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
    padding: 10px 12px;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 4px 16px rgba(27, 10, 23, .06);
    cursor: pointer;
    transition: transform .15s ease;
}
.s-row:active { transform: scale(.985); }
.s-av { width: 52px; height: 52px; }
.s-mid { flex: 1; min-width: 0; }
.s-name {
    margin: 0;
    font-family: var(--display);
    font-weight: 800;
    font-size: 16px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.s-sub { margin: 2px 0 0; font-size: 13px; font-weight: 500; color: var(--mist); }
.s-name mark {
    padding: 0;
    color: inherit;
    background: linear-gradient(transparent 58%, rgba(255, 46, 147, .3) 58%);
}
.s-msg {
    flex: none;
    height: 36px;
    padding: 0 16px;
    border-radius: 18px;
    background-image: var(--brand);
    background-color: var(--magenta);
    color: #fff;
    font-size: 13.5px;
    font-weight: 700;
    box-shadow: 0 6px 16px rgba(255, 46, 147, .3);
}
/* loading skeleton */
@keyframes shimmer { 0% { background-position: -300px 0; } 100% { background-position: 300px 0; } }
.s-row.sk i, .s-row.sk b, .g-item.sk {
    background: linear-gradient(90deg, #f6e7ee 0%, #fdf1f6 50%, #f6e7ee 100%);
    background-size: 600px 100%;
    animation: shimmer 1.2s linear infinite;
}
.s-row.sk i { width: 52px; height: 52px; border-radius: 50%; }
.s-row.sk b { flex: 1; height: 16px; border-radius: 8px; }
.s-grid { margin: 0 -14px; }

/* =========================================================
   2. GALLERY
   ========================================================= */
.gallery {
    position: fixed;
    inset: 0;
    z-index: 40;
    display: none;
    flex-direction: column;
    overflow-y: auto;
    background: var(--paper);
}
.g-head {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: calc(12px + var(--safe-t)) 16px 10px;
    background: rgba(255, 248, 251, .94);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}
.g-title { flex: 1; min-width: 0; }
.g-title h3 {
    margin: 0;
    font-family: var(--display);
    font-weight: 800;
    font-size: 22px;
    letter-spacing: -.4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.g-title small { color: var(--mist); font-size: 13px; font-weight: 600; }
.g-chips {
    display: flex;
    gap: 8px;
    padding: 4px 16px 12px;
    overflow-x: auto;
    scrollbar-width: none;
}
.g-chips::-webkit-scrollbar { display: none; }
.g-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 3px;
    padding-bottom: calc(24px + var(--safe-b));
}
.g-item {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 1;
    padding: 0;
    overflow: hidden;
    background: var(--line);
    border-radius: 0;
}
.g-item img, .g-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
}
.g-play {
    position: absolute;
    right: 6px; top: 6px;
    width: 24px; height: 24px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: rgba(0, 0, 0, .55);
    color: #fff;
    font-size: 10px;
    padding-left: 2px;
}
.g-tag {
    position: absolute;
    left: 6px; top: 6px;
    padding: 3px 8px;
    border-radius: 10px;
    background: rgba(27, 10, 23, .65);
    color: #fff;
    font-size: 10.5px;
    font-weight: 700;
}
.g-tag.st { background-image: var(--brand); }
.g-likes {
    position: absolute;
    left: 6px; bottom: 6px;
    padding: 2px 8px;
    border-radius: 10px;
    background: rgba(0, 0, 0, .55);
    color: #fff;
    font-size: 11.5px;
    font-weight: 700;
}

/* =========================================================
   3. FULL SCREEN POST VIEWER
   ========================================================= */
.pviewer {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: none;
    background: #000;
    color: #fff;
    user-select: none;
    -webkit-user-select: none;
}
.pv-stage {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: none;
}
.pv-stage img, .pv-stage video {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
.pv-top, .pv-bottom { position: absolute; left: 0; right: 0; z-index: 3; transition: opacity .2s ease; }
.pv-top {
    top: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: calc(10px + var(--safe-t)) 12px 26px;
    background: linear-gradient(rgba(0, 0, 0, .7), transparent);
}
.pv-bottom {
    bottom: 0;
    padding: 50px 16px calc(14px + var(--safe-b));
    background: linear-gradient(transparent, rgba(0, 0, 0, .78));
}
.pv-hide .pv-top, .pv-hide .pv-bottom, .pv-hide .pv-arrow { opacity: 0; pointer-events: none; }
.pv-btn {
    flex: none;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .14);
    color: #fff;
    font-size: 22px;
    line-height: 1;
}
.pv-btn.dark { background: var(--blush); color: var(--ink); }
.pv-who { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; cursor: pointer; }
.pv-av {
    flex: none;
    width: 40px; height: 40px;
    border-radius: 50%;
    background-color: #4a3342;
    background-size: cover;
    background-position: center;
}
.pv-name { display: flex; flex-direction: column; min-width: 0; }
.pv-name b { font-family: var(--display); font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pv-name small { font-size: 12px; opacity: .75; }
.pv-caption {
    margin: 0 0 10px;
    max-height: 30vh;
    overflow-y: auto;
    font-size: 16px;
    line-height: 1.4;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}
.pv-actions { display: flex; align-items: center; gap: 4px; }
.pv-counter { margin-left: auto; font-size: 13px; font-weight: 700; opacity: .7; }
.pv-arrow {
    position: absolute;
    top: 50%;
    z-index: 3;
    width: 46px; height: 46px;
    margin-top: -23px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .16);
    color: #fff;
    font-size: 30px;
    line-height: 1;
    padding-bottom: 4px;
    transition: opacity .2s ease;
}
.pv-arrow.l { left: 12px; }
.pv-arrow.r { right: 12px; }
@media (hover: none) { .pv-arrow { display: none; } }

/* hearts on dark screens (viewer + status) */
.pviewer .likebtn, .sv-actions .likebtn { background-color: rgba(255, 255, 255, .14); opacity: .8; }
.pviewer .likebtn.liked, .sv-actions .likebtn.liked { opacity: 1; background-color: rgba(255, 46, 147, .25); }
.pviewer .likecount, .sv-actions .likecount { color: #fff; }

/* =========================================================
   LIKES ON STATUS
   ========================================================= */
.sv-actions {
    position: absolute;
    right: 12px;
    bottom: calc(96px + var(--safe-b));
    z-index: 4;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
}
.sv-actions .likecount { height: 28px; font-size: 13px; text-shadow: 0 1px 4px rgba(0, 0, 0, .6); }

/* =========================================================
   FEED: tap a photo or video to open it
   ========================================================= */
.mediawrap { position: relative; cursor: pointer; }
.mediawrap .postmedia { pointer-events: none; }
.playbadge {
    position: absolute;
    left: 50%; top: 50%;
    width: 62px; height: 62px;
    margin: -31px 0 0 -31px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    padding-left: 5px;
    background: rgba(27, 10, 23, .6);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    color: #fff;
    font-size: 22px;
    pointer-events: none;
}

/* =========================================================
   BOTTOM SHEETS: chooser, manage, edit, delete
   ========================================================= */
.uc-head { display: flex; align-items: center; gap: 14px; padding-bottom: 6px; }
.uc-ring { width: 64px; height: 64px; }
.uc-ring .sav { border-color: #fff; }
.uc-name { margin: 0; font-family: var(--display); font-weight: 800; font-size: 19px; }
.uc-sub { margin: 2px 0 0; font-size: 13px; color: var(--mist); }
.uc-row {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 14px;
    border-radius: 18px;
    background: var(--blush);
    color: var(--ink);
    text-align: left;
    font-family: var(--body);
}
.uc-row:active { background: var(--line); }
.uc-row b { display: block; font-size: 16px; }
.uc-row small { display: block; margin-top: 2px; font-size: 13px; color: var(--mist); }
.uc-ic {
    flex: none;
    width: 42px; height: 42px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: #fff;
    font-size: 20px;
}
.uc-ic.st { background-image: var(--brand); color: #fff; font-weight: 800; }
.uc-row.danger b { color: var(--danger); }
.btn-del { background: var(--danger); color: #fff; }
.sheet-note { margin: 0; color: var(--mist); font-size: 15px; line-height: 1.45; }
