/* Public profile (visitors who are not logged in) — app/Views/social/profile_public.php */
:root {
    --pp-teal: #00A99D;
    --pp-teal2: #1ABAB2;
    --pp-ink: #0F172A;
    --pp-muted: #64748B;
    --pp-line: #E2E8F0;
    --pp-bg: #F4F7FA;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    background: var(--pp-bg);
    color: var(--pp-ink);
    -webkit-font-smoothing: antialiased;
}
body.pp-lock { overflow: hidden; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font: inherit; cursor: pointer; }

.pp-ico { width: 18px; height: 18px; flex: 0 0 auto; }
.pp-ico-sm { width: 14px; height: 14px; }

/* Top bar */
.pp-top {
    position: sticky; top: 0; z-index: 30;
    background: rgba(255, 255, 255, .92);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--pp-line);
}
.pp-top-in {
    max-width: 1080px; margin: 0 auto; padding: 10px 16px;
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.pp-logo img { height: 30px; width: auto; }
.pp-top-actions { display: flex; gap: 8px; }

/* Buttons */
.pp-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    padding: 9px 16px; border-radius: 12px; border: 1px solid transparent;
    font-size: 13.5px; font-weight: 800; line-height: 1.2; white-space: nowrap;
    transition: transform .12s ease, background .15s ease, box-shadow .15s ease;
}
.pp-btn:active { transform: scale(.97); }
.pp-btn-primary {
    color: #fff; background: linear-gradient(90deg, var(--pp-teal), var(--pp-teal2));
    box-shadow: 0 6px 16px rgba(0, 169, 157, .25);
}
.pp-btn-primary:hover { box-shadow: 0 8px 20px rgba(0, 169, 157, .32); }
.pp-btn-outline { color: var(--pp-teal); background: #fff; border-color: var(--pp-teal); }
.pp-btn-outline:hover { background: #F0FDFA; }
.pp-btn-ghost { color: #334155; background: #F1F5F9; }
.pp-btn-ghost:hover { background: #E2E8F0; }
.pp-btn-icon { width: 46px; padding: 0; color: #334155; background: #F1F5F9; position: relative; }
.pp-btn-icon.pp-copied::after {
    content: 'Link copied'; position: absolute; bottom: calc(100% + 8px); right: 0;
    background: var(--pp-ink); color: #fff; font-size: 11px; padding: 5px 8px; border-radius: 8px; white-space: nowrap;
}
.pp-btn-lg { padding: 12px 18px; font-size: 14px; flex: 1; }
.pp-btn-block { display: flex; width: 100%; margin-top: 10px; }

/* Layout */
.pp-wrap { max-width: 1080px; margin: 0 auto; padding: 16px 16px 40px; }
.pp-card {
    background: #fff; border: 1px solid var(--pp-line); border-radius: 20px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, .04);
}
.pp-grid { display: grid; grid-template-columns: 1fr; gap: 16px; margin-top: 16px; }
.pp-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
@media (min-width: 900px) {
    .pp-grid { grid-template-columns: 340px 1fr; align-items: start; }
    .pp-col:first-child { position: sticky; top: 70px; }
}

/* Hero */
.pp-hero { overflow: hidden; }
.pp-banner {
    height: 150px; background-size: cover; background-position: center;
}
@media (min-width: 700px) { .pp-banner { height: 220px; } }
.pp-hero-body { padding: 0 18px 18px; position: relative; }
.pp-avatar {
    width: 112px; height: 112px; border-radius: 50%; object-fit: cover;
    border: 5px solid #fff; background: var(--pp-teal);
    margin-top: -56px; box-shadow: 0 6px 18px rgba(15, 23, 42, .15);
}
@media (min-width: 700px) {
    .pp-avatar { width: 140px; height: 140px; margin-top: -70px; }
}
.pp-id { margin-top: 10px; }
.pp-name {
    margin: 0; font-size: 24px; font-weight: 900; letter-spacing: -.02em;
    display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.pp-verified { width: 22px; height: 22px; }
.pp-handle { color: var(--pp-muted); font-weight: 700; font-size: 14px; margin-top: 2px; }
.pp-meta {
    display: inline-flex; align-items: center; gap: 5px; margin-top: 8px;
    color: var(--pp-muted); font-size: 13px; font-weight: 600;
}
.pp-meta .pp-ico { width: 15px; height: 15px; }
.pp-bio { margin: 12px 0 0; font-size: 14.5px; line-height: 1.55; color: #1E293B; white-space: normal; word-wrap: break-word; }

.pp-stats {
    display: flex; gap: 10px; margin-top: 16px;
}
.pp-stats > div {
    flex: 1; text-align: center; padding: 10px 6px; border-radius: 14px; background: #F8FAFC; border: 1px solid #EEF2F6;
}
.pp-stats strong { display: block; font-size: 17px; font-weight: 900; }
.pp-stats span { display: block; font-size: 11.5px; color: var(--pp-muted); font-weight: 700; margin-top: 2px; }

.pp-actions { display: flex; gap: 10px; margin-top: 16px; }

/* Sections */
.pp-section { padding: 16px 18px; }
.pp-h2 { margin: 0 0 12px; font-size: 13px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; color: #334155; }
.pp-h2-out { margin: 4px 4px 0; }
.pp-about { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.pp-about li { display: flex; gap: 10px; font-size: 13.5px; line-height: 1.4; }
.pp-about li > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.pp-about em { font-style: normal; color: var(--pp-muted); font-size: 12px; font-weight: 600; }
.pp-dot { width: 22px; text-align: center; flex: 0 0 22px; }
.pp-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.pp-chip {
    padding: 5px 10px; border-radius: 12px; font-size: 12px; font-weight: 700;
    background: #F0FDFA; color: #0F766E; border: 1px solid #99F6E4;
}
.pp-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.pp-link {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 6px 11px; border-radius: 10px; font-size: 12.5px; font-weight: 800;
    background: #F8FAFC; border: 1px solid var(--pp-line); color: #334155;
}
.pp-link:hover { border-color: var(--pp-teal); color: var(--pp-teal); }

.pp-photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.pp-photo { padding: 0; border: 0; border-radius: 10px; overflow: hidden; aspect-ratio: 1; background: #F1F5F9; }
.pp-photo img { width: 100%; height: 100%; object-fit: cover; }

.pp-cta { padding: 18px; text-align: center; background: linear-gradient(160deg, #F0FDFA, #fff 60%); }
.pp-cta h3 { margin: 0; font-size: 17px; font-weight: 900; }
.pp-cta p { margin: 6px 0 4px; color: var(--pp-muted); font-size: 13px; }

/* Posts */
.pp-post { padding: 14px 16px; }
.pp-post-head { display: flex; align-items: center; gap: 10px; }
.pp-post-av { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; background: var(--pp-teal); }
.pp-post-head strong { display: block; font-size: 14px; font-weight: 800; }
.pp-post-head span { display: block; font-size: 11.5px; color: var(--pp-muted); font-weight: 600; }
.pp-post-text { margin: 10px 0 0; font-size: 14px; line-height: 1.55; word-wrap: break-word; }
.pp-post-img {
    display: block; position: relative; width: 100%; margin-top: 10px; padding: 0; border: 0;
    border-radius: 14px; overflow: hidden; background: #F1F5F9;
}
.pp-post-img img { width: 100%; max-height: 520px; object-fit: cover; }
.pp-more {
    position: absolute; right: 10px; bottom: 10px; padding: 4px 9px; border-radius: 10px;
    background: rgba(15, 23, 42, .65); color: #fff; font-size: 12px; font-weight: 800;
}
.pp-post-foot { display: flex; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px solid #F1F5F9; }
.pp-post-foot button {
    border: 0; background: #F8FAFC; border-radius: 10px; padding: 7px 12px;
    font-size: 12.5px; font-weight: 800; color: #334155;
}
.pp-post-foot button:hover { background: #F0FDFA; }

.pp-empty { padding: 34px 20px; text-align: center; display: flex; flex-direction: column; gap: 6px; align-items: center; }
.pp-empty-ico { font-size: 30px; }
.pp-empty span { color: var(--pp-muted); font-size: 13px; }

.pp-foot { text-align: center; padding: 10px 16px 30px; color: var(--pp-muted); font-size: 12.5px; }
.pp-foot a:hover { color: var(--pp-teal); }

/* Login popup */
.pp-modal {
    position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center;
    padding: 16px; background: rgba(15, 23, 42, .55); backdrop-filter: blur(3px);
}
.pp-modal[hidden], .pp-lightbox[hidden] { display: none; }
.pp-modal-card {
    position: relative; width: 100%; max-width: 380px; background: #fff; border-radius: 24px;
    padding: 26px 22px 18px; text-align: center; box-shadow: 0 24px 60px rgba(15, 23, 42, .3);
    animation: pp-pop .22s ease-out;
}
@keyframes pp-pop { from { transform: translateY(12px) scale(.96); opacity: 0; } to { transform: none; opacity: 1; } }
.pp-modal-av {
    width: 72px; height: 72px; border-radius: 50%; object-fit: cover; margin: 0 auto 12px;
    border: 3px solid #fff; box-shadow: 0 0 0 3px #CCFBF1; background: var(--pp-teal);
}
.pp-modal-card h3 { margin: 0; font-size: 19px; font-weight: 900; }
.pp-modal-card p { margin: 8px 0 8px; color: var(--pp-muted); font-size: 13.5px; line-height: 1.5; }
.pp-modal-x {
    position: absolute; top: 10px; right: 12px; width: 34px; height: 34px; border-radius: 50%;
    border: 0; background: #F1F5F9; color: #334155; font-size: 22px; line-height: 1;
}
.pp-modal-later { margin-top: 10px; border: 0; background: none; color: var(--pp-muted); font-size: 13px; font-weight: 700; }

/* Photo viewer */
.pp-lightbox {
    position: fixed; inset: 0; z-index: 110; background: rgba(2, 6, 23, .92);
    display: flex; align-items: center; justify-content: center; padding: 16px;
}
.pp-lightbox img { max-width: 100%; max-height: 90vh; border-radius: 12px; object-fit: contain; }
.pp-lightbox-x { background: rgba(255, 255, 255, .15); color: #fff; }

@media (max-width: 420px) {
    .pp-top-actions .pp-btn { padding: 8px 12px; font-size: 12.5px; }
    .pp-name { font-size: 21px; }
    .pp-btn-lg { padding: 11px 12px; font-size: 13.5px; }
}
