/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg:        #0d0d0d;
    --surface:   #161616;
    --surface2:  #1e1e1e;
    --border:    #2a2a2a;
    --accent:    #ff3b6b;
    --accent2:   #ff6b35;
    --text:      #f0f0f0;
    --text-muted:#888;
    --radius:    14px;
    --shadow:    0 4px 24px rgba(0,0,0,0.5);
    --tab-h:     54px;
    --nav-h:     64px;
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* ===== APP CONTAINER ===== */
.app-container {
    display: flex;
    height: 100vh;
    background: var(--bg);
}

/* ===== SIDEBAR ===== */
.sidebar {
    width: 280px;
    background: rgba(13,13,13,0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 24px 16px;
    position: fixed;
    margin-top: 100px;
    left: 0;
    top: 0;
    height: 100vh;
    z-index: 100;
}

.sidebar-logo h1 {
    font-size: 1.8rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0 0 24px 0;
    text-align: center;
}

.sidebar-search {
    position: relative;
    margin-bottom: 32px;
}

.sidebar-search svg {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.sidebar-search input {
    width: 100%;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 16px 12px 42px;
    color: var(--text);
    font-size: 0.9rem;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
}

.sidebar-search input::placeholder { color: var(--text-muted); }

.sidebar-search input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(255,59,107,0.12);
}

.sidebar-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 12px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all .2s;
    cursor: pointer;
}

.nav-item:hover {
    background: var(--surface2);
    color: var(--text);
}

.nav-item.active {
    background: linear-gradient(135deg, rgba(255,59,107,0.15), rgba(255,107,53,0.1));
    color: var(--accent);
}

.nav-item.active svg {
    color: var(--accent);
}

.nav-item svg {
    flex-shrink: 0;
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 24px;
}

.btn-login {
    width: 100%;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    border: none;
    border-radius: 12px;
    color: #fff;
    font-size: 0.95rem;
    font-weight: 700;
    padding: 14px;
    cursor: pointer;
    transition: opacity .2s, transform .15s;
}

.btn-login:hover {
    opacity: .9;
    transform: scale(1.02);
}

/* ===== MAIN CONTENT ===== */
.main-content {
    flex: 1;
    margin-left: 280px;
    padding: 20px;
    overflow-y: auto;
}

.search-wrap {
    flex: 1;
    max-width: 400px;
    width: 300px;
    position: relative;
}

.search-wrap svg {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

#searchInput {
    width: 100%;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 50px;
    padding: 10px 16px 10px 42px;
    color: var(--text);
    font-size: 0.9rem;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
}

#searchInput::placeholder { color: var(--text-muted); }

#searchInput:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(255,59,107,0.12);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

.btn-icon {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    cursor: pointer;
    color: var(--text);
    transition: background .2s, border-color .2s;
}

.btn-icon:hover { background: var(--border); border-color: var(--accent); }

.avatar-nav {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--accent);
    cursor: pointer;
}

/* ===== TABS ===== */
.tabs-bar {
    position: sticky;
    top: var(--nav-h);
    z-index: 90;
    background: rgba(13,13,13,0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 20px;
    height: var(--tab-h);
    gap: 4px;
}

.tabs-left {
    display: flex;
    align-items: center;
    gap: 4px;
}

.tab-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 600;
    padding: 8px 18px;
    border-radius: 50px;
    cursor: pointer;
    transition: color .2s, background .2s;
    position: relative;
    white-space: nowrap;
}

.tab-btn:hover { color: var(--text); background: var(--surface2); }

.tab-btn.active {
    color: var(--text);
    background: linear-gradient(135deg, rgba(255,59,107,0.18), rgba(255,107,53,0.12));
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 18px;
    right: 18px;
    height: 2px;
    background: linear-gradient(90deg, var(--accent), var(--accent2));
    border-radius: 2px;
}


/* ===== MAIN LAYOUT ===== */
.main-wrap {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 16px 40px;
}

.profile-header {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    display: flex;
    gap: 16px;
    align-items: center;
}

.profile-top {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 16px;
    align-items: center;
    width: 100%;
}

.profile-avatar {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--accent);
}

.profile-meta h2 {
    margin-bottom: 6px;
    font-size: 1.2rem;
}

.profile-handle {
    color: var(--text-muted);
    margin-bottom: 6px;
}

.profile-bio {
    color: var(--text);
    margin-bottom: 8px;
}

.profile-stats {
    display: flex;
    gap: 10px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.profile-posts {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 18px;
}

/* ===== FEED GRID ===== */
#feedGrid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 18px;
    padding-top: 0;
}

#feedGrid.profile-mode {
    grid-template-columns: minmax(280px, 320px) 1fr;
    align-items: start;
}

#feedGrid.profile-mode .profile-header {
    position: sticky;
    top: 90px;
    height: fit-content;
}

#feedGrid.profile-mode .profile-posts {
    grid-column: 2 / -1;
}

/* ===== VERTICAL FEED (TikTok Style) ===== */
.feed-vertical {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 10px 0 40px;
    max-width: 450px;
    margin: 0 auto;
    height: calc(100vh - 60px);
    overflow-y: auto;
    scroll-snap-type: y mandatory;
    scrollbar-width: none;
}

.feed-vertical::-webkit-scrollbar {
    display: none;
}

.feed-vertical .card {
    width: 100%;
    height: 80vh;
    max-height: 80vh;
    max-width: 450px;
    border-radius: 16px;
    scroll-snap-align: center;
    position: relative;
    overflow: hidden;
}

.feed-vertical .card-thumb {
    width: 100%;
    height: 100%;
    aspect-ratio: 9/16;
}

.feed-vertical .card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.feed-vertical .card-body {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, transparent 100%);
    padding: 20px;
    z-index: 2;
}

.feed-vertical .card-creator {
    align-items: flex-end;
}

.feed-vertical .creator-info {
    text-align: left;
}

.feed-vertical .card-caption {
    color: #fff;
    margin-bottom: 16px;
    font-size: 0.95rem;
    line-height: 1.5;
}

.feed-vertical .card-meta {
    align-items: flex-end;
    justify-content: space-between;
}

.feed-vertical .btn-like,
.feed-vertical .meta-item {
    color: #fff;
}

.feed-vertical .btn-like.liked {
    color: var(--accent);
}

.feed-vertical .card-footer {
    position: absolute;
    bottom: 20px;
    right: 20px;
    left: 20px;
    padding: 0;
    z-index: 3;
}

.feed-vertical .btn-unlock {
    width: auto;
    min-width: 140px;
    max-width: 200px;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    border: none;
    border-radius: 12px;
    color: #fff;
    font-size: 0.85rem;
    font-weight: 700;
    padding: 12px 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: opacity .2s, transform .15s;
    box-shadow: 0 4px 12px rgba(255,59,107,0.3);
}

.feed-vertical .btn-unlock:hover {
    opacity: .9;
    transform: scale(1.02);
    box-shadow: 0 6px 16px rgba(255,59,107,0.4);
}

.feed-vertical #loadMoreWrap {
    display: none !important;
}

/* ===== REEL CARD (TikTok style) ===== */
.reel-card {
    position: relative;
    width: 100%;
    max-width: 420px;
    height: 85vh;
    border-radius: 18px;
    overflow: hidden;
    background: #000;
    scroll-snap-align: start;
    flex-shrink: 0;
    cursor: pointer;
}

.reel-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.reel-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    pointer-events: none;
}

.reel-overlay > * { pointer-events: auto; }

/* Right-side action buttons */
.reel-actions {
    position: absolute;
    right: 14px;
    bottom: 140px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
}

.reel-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.reel-btn-like,
.reel-btn-icon {
    background: rgba(255,255,255,0.12);
    backdrop-filter: blur(8px);
    border: none;
    border-radius: 50%;
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    cursor: pointer;
    color: #fff;
    transition: transform .15s, background .2s;
}

.reel-btn-like svg,
.reel-btn-icon svg {
    width: 22px;
    height: 22px;
    stroke: #fff;
    fill: none;
}

.reel-btn-like:hover,
.reel-btn-icon:hover { background: rgba(255,255,255,0.22); transform: scale(1.1); }

.reel-btn-like.liked svg { fill: var(--accent); stroke: var(--accent); }

.reel-action-count {
    font-size: 0.72rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 1px 4px rgba(0,0,0,0.7);
}

/* Bottom info */
.reel-info {
    padding: 16px 60px 20px 16px;
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, transparent 100%);
}

.reel-creator {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.reel-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #fff;
    flex-shrink: 0;
}

.reel-creator-meta {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.reel-creator-name {
    font-size: 0.9rem;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.reel-creator-handle {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.65);
}

.reel-follow-btn {
    flex-shrink: 0;
    font-size: 0.75rem;
    padding: 5px 14px;
}

.reel-caption {
    font-size: 0.88rem;
    color: rgba(255,255,255,0.92);
    line-height: 1.45;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.reel-time {
    font-size: 0.72rem;
    color: rgba(255,255,255,0.5);
}

/* Locked video — blur the actual video element */
.reel-video.is-locked {
    filter: blur(22px);
    transform: scale(1.08);
    transition: filter .4s, transform .4s;
}

/* Lock overlay — sits over blurred video, fully centered */
.reel-lock-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    pointer-events: none;
}

.reel-lock-box {
    pointer-events: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
}

.reel-lock-box svg {
    width: 44px;
    height: 44px;
    fill: #fff;
    stroke: none;
    filter: drop-shadow(0 2px 6px rgba(0,0,0,0.4));
}

.reel-lock-box span {
    font-size: 1rem;
    font-weight: 600;
    text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}

.reel-lock-box .btn-unlock {
    margin-top: 2px;
    padding: 11px 40px;
    font-size: 0.95rem;
    font-weight: 700;
    border-radius: 50px;
    min-width: 150px;
    background: linear-gradient(135deg, #ff4b5c, #e83347);
    border: none;
    color: #fff;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(232,51,71,0.45);
    transition: transform .15s, box-shadow .15s;
}

.reel-lock-box .btn-unlock:hover {
    transform: scale(1.04);
    box-shadow: 0 6px 20px rgba(232,51,71,0.55);
}

/* Mute button */
.reel-mute-btn {
    position: absolute;
    top: 14px;
    right: 14px;
    background: rgba(0,0,0,0.45);
    backdrop-filter: blur(6px);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    cursor: pointer;
    color: #fff;
    z-index: 10;
    transition: background .2s;
}

.reel-mute-btn:hover { background: rgba(0,0,0,0.65); }

/* feed-vertical: reel cards inside */
.feed-vertical .reel-card {
    width: 100%;
}

/* ===== CARD ===== */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform .22s, box-shadow .22s, border-color .22s;
    cursor: pointer;
    position: relative;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
    border-color: rgba(255,59,107,0.35);
}

/* Thumbnail */
.card-thumb {
    position: relative;
    width: 100%;
    aspect-ratio: 4/3;
    overflow: hidden;
    background: var(--surface2);
}

.card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .4s;
    display: block;
}

.card:hover .card-thumb img { transform: scale(1.05); }

.thumb-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 40%, rgba(0,0,0,0.7) 100%);
}

.badge-type {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0,0,0,0.65);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 6px;
    padding: 3px 8px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    display: flex;
    align-items: center;
    gap: 4px;
    color: #fff;
}

.badge-locked {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255,59,107,0.85);
    border-radius: 8px;
    padding: 4px 10px;
    font-size: 0.72rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 4px;
    color: #fff;
}

.price-tag {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    border-radius: 8px;
    padding: 4px 10px;
    font-size: 0.78rem;
    font-weight: 800;
    color: #fff;
}

/* Card Body */
.card-body {
    padding: 14px;
}

.card-creator {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.creator-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--accent);
    flex-shrink: 0;
}

.creator-info { flex: 1; min-width: 0; }

.creator-name {
    font-size: 0.88rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.verified-icon { color: #4ab3ff; flex-shrink: 0; }

.creator-handle {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.btn-follow {
    background: var(--surface2);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 5px 12px;
    border-radius: 50px;
    cursor: pointer;
    transition: all .2s;
    white-space: nowrap;
    flex-shrink: 0;
}

.btn-follow:hover,
.btn-follow.following {
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    border-color: transparent;
    color: #fff;
}

.card-caption {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 12px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-meta {
    display: flex;
    align-items: center;
    gap: 14px;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.meta-item svg { flex-shrink: 0; }

.btn-like {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.78rem;
    color: var(--text-muted);
    padding: 0;
    transition: color .2s;
}

.btn-like:hover, .btn-like.liked { color: var(--accent); }
.btn-like.liked svg { fill: var(--accent); }

.meta-time { margin-left: auto; font-size: 0.72rem; }

.card-footer {
    padding: 0 14px 14px;
}

.btn-unlock {
    width: 100%;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    border: none;
    border-radius: 10px;
    color: #fff;
    font-size: 0.85rem;
    font-weight: 700;
    padding: 11px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: opacity .2s, transform .15s;
}

.btn-unlock:hover { opacity: .9; transform: scale(1.01); }

/* ===== SKELETON LOADER ===== */
.skeleton {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    animation: pulse 1.4s ease-in-out infinite;
}

.skeleton-thumb {
    width: 100%;
    aspect-ratio: 4/3;
    background: var(--surface2);
}

.skeleton-body { padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.skeleton-line { background: var(--surface2); border-radius: 6px; height: 12px; }
.skeleton-line.short { width: 55%; }
.skeleton-line.med   { width: 75%; }
.skeleton-line.long  { width: 90%; }

@keyframes pulse {
    0%,100% { opacity: 1; }
    50%      { opacity: .55; }
}

/* ===== EMPTY STATE ===== */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
}

.empty-state svg { color: var(--text-muted); margin-bottom: 16px; opacity: .4; }
.empty-state h3  { font-size: 1.1rem; margin-bottom: 8px; }
.empty-state p   { color: var(--text-muted); font-size: 0.9rem; }

/* ===== LOAD MORE ===== */
#loadMoreWrap {
    text-align: center;
    padding: 28px 0 8px;
}

.btn-load-more {
    background: var(--surface2);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 700;
    padding: 12px 32px;
    border-radius: 50px;
    cursor: pointer;
    transition: all .2s;
}

.btn-load-more:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.btn-load-more:disabled {
    opacity: .4;
    cursor: not-allowed;
}

/* ===== TOAST ===== */
#toast {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 50px;
    padding: 10px 22px;
    font-size: 0.85rem;
    font-weight: 600;
    opacity: 0;
    transition: opacity .3s, transform .3s;
    z-index: 999;
    pointer-events: none;
    white-space: nowrap;
}

#toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ===== MOBILE UI ELEMENTS (hidden on desktop) ===== */
.mobile-topbar,
.mobile-bottom-nav,
.sidebar-overlay {
    display: none;
}

/* Mobile topbar permanently hidden */
.mobile-topbar { display: none !important; }

/* ===== RESPONSIVE — LAPTOP (1025px – 1280px) ===== */
@media (max-width: 1280px) and (min-width: 1025px) {
    .sidebar { width: 240px; }
    .main-content { margin-left: 240px; }
    #feedGrid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
}

/* ===== RESPONSIVE — TABLET (768px – 1024px) ===== */
@media (max-width: 1024px) and (min-width: 768px) {
    .sidebar {
        width: 68px;
        padding: 20px 8px;
        align-items: center;
    }

    .sidebar-logo h1 { display: none; }
    .sidebar-search  { display: none; }

    .nav-item {
        justify-content: center;
        padding: 12px;
        width: 100%;
        border-radius: 12px;
    }

    .nav-item span { display: none; }

    .main-content {
        margin-left: 68px;
        padding: 16px;
    }

    #feedGrid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 14px;
    }
}

/* ===== RESPONSIVE — MOBILE (< 768px) ===== */
@media (max-width: 767px) {

    /* --- Sidebar: hidden off-screen, slides in as overlay --- */
    .sidebar {
        transform: translateX(-100%);
        width: 280px;
        padding: 80px 16px 24px;
        margin-top: 0;
        top: 0;
        z-index: 300;
        transition: transform 0.28s ease;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    /* Re-show items hidden on tablet */
    .sidebar-logo h1 { display: block; }
    .sidebar-search  { display: block; }
    .nav-item span   { display: inline; }
    .nav-item        { justify-content: flex-start; padding: 12px 16px; }

    /* --- Dim overlay behind sidebar --- */
    .sidebar-overlay {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.65);
        z-index: 200;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.28s ease;
    }

    .sidebar-overlay.active {
        opacity: 1;
        pointer-events: auto;
    }

    /* --- Mobile top bar --- */
    .mobile-topbar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 10px 14px;
        background: rgba(13, 13, 13, 0.95);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        border-bottom: 1px solid var(--border);
        position: sticky;
        top: 0;
        z-index: 120;
    }

    .mobile-hamburger {
        background: var(--surface2);
        border: 1px solid var(--border);
        border-radius: 10px;
        color: var(--text);
        width: 38px;
        height: 38px;
        display: grid;
        place-items: center;
        cursor: pointer;
        flex-shrink: 0;
        transition: background .2s, border-color .2s;
    }

    .mobile-hamburger:hover {
        background: var(--border);
        border-color: var(--accent);
    }

    .mobile-topbar-logo {
        font-size: 1.25rem;
        font-weight: 800;
        background: linear-gradient(135deg, var(--accent), var(--accent2));
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
        letter-spacing: -0.3px;
    }

    /* spacer keeps logo centered */
    .mobile-topbar-spacer { width: 38px; flex-shrink: 0; }

    /* --- Main content: full width, room for bottom nav --- */
    .main-content {
        margin-left: 0;
        padding: 12px 10px 76px;   /* 76px = bottom-nav height + gap */
    }

    /* --- Bottom navigation bar --- */
    .mobile-bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 60px;
        background: rgba(13, 13, 13, 0.97);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-top: 1px solid var(--border);
        z-index: 120;
    }

    .mobile-nav-item {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        color: var(--text-muted);
        text-decoration: none;
        font-size: 0.62rem;
        font-weight: 600;
        background: none;
        border: none;
        cursor: pointer;
        transition: color .2s;
        padding: 6px 0;
        letter-spacing: .3px;
    }

    .mobile-nav-item.active  { color: var(--accent); }
    .mobile-nav-item svg     { width: 22px; height: 22px; flex-shrink: 0; }

    /* --- Feed grid adjustments --- */
    #feedGrid { grid-template-columns: 1fr 1fr; gap: 10px; }

    .card-body    { padding: 10px; }
    .card-footer  { padding: 0 10px 10px; }
    .creator-name { font-size: 0.78rem; }
    .btn-follow   { display: none; }

    /* Vertical feed (For You reels) — force single-column full-width on mobile */
    #feedGrid.feed-vertical {
        display: flex !important;
        flex-direction: column;
        grid-template-columns: unset;
        max-width: 100%;
        width: 100%;
        height: calc(100dvh - 130px);
        padding: 0 0 10px;
        margin: 0;
    }

    #feedGrid.feed-vertical .reel-card,
    #feedGrid.feed-vertical .card {
        width: 100%;
        max-width: 100%;
        border-radius: 10px;
    }
}

/* ===== MOBILE XS (< 420px) ===== */
@media (max-width: 420px) {
    #feedGrid:not(.feed-vertical) { grid-template-columns: 1fr; }

    #feedGrid.feed-vertical {
        height: calc(100dvh - 124px);
    }
}

/* ===== COMMENT DRAWER ===== */
.sf-comments-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.55);
    z-index: 1200;
    opacity: 0;
    pointer-events: none;
    transition: opacity .28s ease;
}
.sf-comments-backdrop.open {
    opacity: 1;
    pointer-events: auto;
}

.sf-comments-drawer {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    max-height: 75vh;
    background: #141414;
    border-radius: 20px 20px 0 0;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 1300;
    transform: translateY(100%);
    transition: transform .32s cubic-bezier(.4,0,.2,1);
}
.sf-comments-drawer.open {
    transform: translateY(0);
}

/* drag handle */
.sf-drawer-handle {
    width: 40px; height: 4px;
    background: var(--border);
    border-radius: 2px;
    margin: 10px auto 0;
    flex-shrink: 0;
}

.sf-drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px 10px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.sf-drawer-title {
    font-size: .95rem;
    font-weight: 700;
    color: var(--text);
}
.sf-drawer-close {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 30px; height: 30px;
    display: grid; place-items: center;
    cursor: pointer;
    color: var(--text-muted);
    font-size: .85rem;
    transition: background .2s;
}
.sf-drawer-close:hover { background: var(--border); color: var(--text); }

/* comments list */
.sf-comments-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}
.sf-comments-list::-webkit-scrollbar { width: 4px; }
.sf-comments-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.sf-comment-item {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}
.sf-comment-avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    display: grid; place-items: center;
    font-size: .8rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}
.sf-comment-body { flex: 1; min-width: 0; }
.sf-comment-name {
    font-size: .78rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 2px;
}
.sf-comment-name.mine { color: #4ab3ff; }
.sf-comment-text {
    font-size: .85rem;
    color: var(--text);
    line-height: 1.45;
    word-break: break-word;
}
.sf-comment-time {
    font-size: .7rem;
    color: var(--text-muted);
    margin-top: 3px;
}

.sf-comments-empty {
    text-align: center;
    padding: 32px 0;
    color: var(--text-muted);
    font-size: .88rem;
}
.sf-comments-loading {
    text-align: center;
    padding: 24px 0;
    color: var(--text-muted);
    font-size: .85rem;
}

/* comment input bar */
.sf-comment-input-bar {
    padding: 10px 14px 14px;
    border-top: 1px solid var(--border);
    background: #141414;
    flex-shrink: 0;
}
.sf-comment-name-row {
    margin-bottom: 8px;
}
.sf-comment-name-input {
    width: 100%;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 12px;
    color: var(--text);
    font-size: .82rem;
    outline: none;
    transition: border-color .2s;
}
.sf-comment-name-input::placeholder { color: var(--text-muted); }
.sf-comment-name-input:focus { border-color: var(--accent); }

.sf-comment-msg-row {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}
.sf-comment-textarea {
    flex: 1;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px 14px;
    color: var(--text);
    font-size: .88rem;
    font-family: inherit;
    resize: none;
    min-height: 42px;
    max-height: 110px;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
    line-height: 1.4;
    overflow-y: auto;
}
.sf-comment-textarea::placeholder { color: var(--text-muted); }
.sf-comment-textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(255,59,107,.1);
}
.sf-comment-send {
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    border: none;
    border-radius: 50%;
    width: 42px; height: 42px;
    display: grid; place-items: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: opacity .2s, transform .15s;
}
.sf-comment-send:hover  { opacity: .9; transform: scale(1.06); }
.sf-comment-send:disabled { opacity: .4; cursor: not-allowed; transform: none; }
.sf-comment-send svg { width: 18px; height: 18px; fill: #fff; }

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* reel comment btn — make it clickable */
.reel-btn-icon { cursor: pointer; }

/* card comment meta — make it clickable */
.meta-item.comment-btn { cursor: pointer; transition: color .2s; }
.meta-item.comment-btn:hover { color: var(--text); }

/* ===== PAYMENT MODAL ===== */
.sf-pay-box {
    background: #12151a;
    border: 1px solid rgba(255,255,255,.15);
    border-radius: 14px;
    padding: 24px;
    width: clamp(300px, 90vw, 480px);
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,.6);
    color: #fff;
}
.sf-pay-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 6px;
}
.sf-pay-close {
    background: none;
    border: none;
    color: rgba(255,255,255,.5);
    font-size: 1rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background .2s;
}
.sf-pay-close:hover { background: rgba(255,255,255,.1); color: #fff; }
.sf-pay-sub {
    font-size: .82rem;
    color: rgba(255,255,255,.5);
    margin: 0 0 16px;
}
.sf-pay-methods {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
.sf-pay-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 16px;
    border-radius: 8px;
    font-size: .88rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: opacity .2s, transform .1s;
    min-width: 130px;
}
.sf-pay-btn:disabled { opacity: .45; cursor: not-allowed; }
.sf-pay-btn:not(:disabled):active { transform: scale(.97); }
.sf-pay-stripe {
    background: linear-gradient(135deg, #635bff, #4438ff);
    color: #fff;
}
.sf-pay-paypal {
    background: linear-gradient(135deg, #FFC439, #F5A623);
    color: #000;
}
.sf-card-el {
    background: #1a1e27;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 8px;
    padding: 14px;
    margin-top: 4px;
}
.sf-pay-status {
    margin-top: 12px;
    font-size: .83rem;
    color: rgba(255,255,255,.7);
    min-height: 18px;
    text-align: center;
}
