/* ── Home Page Styles ── */

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 28px;
    border-bottom: 1px solid var(--border-subtle);
    background: color-mix(in srgb, var(--bg-dark) 90%, transparent);
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 50;
}

.topbar-title {
    font-size: 20px;
    font-weight: 700;
}

.topbar-sub {
    font-size: 12px;
    color: var(--text-muted);
}

.topbar-left {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.search-topbar {
    width: 280px;
    position: relative;
}

.search-results-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-mild);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    z-index: 1000;
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: authFadeIn 0.2s ease;
}

.search-results-dropdown.open {
    display: flex;
}

.search-category {
    padding: 10px 14px 4px;
    font-size: 10px;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: var(--bg-card-2);
}

.search-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    cursor: pointer;
    transition: var(--transition);
}

.search-item:hover {
    background: var(--bg-hover);
}

.search-item-icon {
    width: 32px;
    height: 32px;
    background: var(--bg-elevated);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.search-item-avatar {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    object-fit: cover;
    flex-shrink: 0;
}

.search-item-info {
    flex: 1;
    overflow: hidden;
}

.search-item-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-item-sub {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-item-arrow {
    font-size: 14px;
    color: var(--text-muted);
    transform: rotate(0deg);
}

.search-no-results {
    padding: 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}

.home-grid {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 24px;
    padding: 24px 28px;
    max-width: 1100px;
}

/* ── Feed Tabs ── */
/* Minimal centred text tabs; the active one gets a short gradient underline (direction-proof). */
.feed-tabs {
    display: flex;
    justify-content: center;
    gap: 36px;
    margin: 0 0 18px;
    border-bottom: 1px solid var(--border-subtle);
}

.feed-tab {
    position: relative;
    padding: 12px 2px 14px;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: .2px;
    color: var(--text-secondary);
    background: none;
    border: 0;
    cursor: pointer;
    white-space: nowrap;
    transition: color .25s ease;
}

.feed-tab::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -1px;
    width: 28px;
    height: 3px;
    border-radius: 3px;
    background: var(--gradient-brand);
    transform: translateX(-50%) scaleX(0);
    transition: transform .3s cubic-bezier(.4, 0, .2, 1);
}

.feed-tab:hover { color: var(--text-primary); }
.feed-tab.active { color: var(--text-primary); font-weight: 800; }
.feed-tab.active::after { transform: translateX(-50%) scaleX(1); }
.feed-tab:focus-visible { outline: 2px solid var(--brand-primary); outline-offset: 2px; border-radius: 6px; }

/* ── Feed Posts ── */
.feed {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.post-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--transition);
    animation: fadeIn 0.4s ease both;
}

.post-card:hover {
    border-color: var(--border-mild);
}

.post-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
}

.post-user-info {
    flex: 1;
}

.post-username {
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.post-meta {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 1px;
}

.verified-badge {
    color: var(--brand-primary);
    font-size: 12px;
}

.recom-reason-badge {
    background: rgba(255, 107, 53, 0.12);
    color: var(--brand-primary);
    padding: 3px 10px;
    border-radius: var(--radius-sm);
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border: 1px solid rgba(255, 107, 53, 0.2);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}


.post-more-btn {
    background: none;
    color: var(--text-muted);
    font-size: 18px;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.post-more-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.post-image-wrap {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16/9;
    /*aspect-ratio: 21/9;
     aspect-ratio: 4/3;*/
    cursor: pointer;
}

.post-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.post-image-wrap:hover .post-image {
    transform: scale(1.04);
}

.post-rating-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    border-radius: var(--radius-md);
    padding: 6px 10px;
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: 700;
    font-size: 14px;
}

.post-restaurant-tag {
    position: absolute;
    bottom: 12px;
    left: 12px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    border-radius: var(--radius-full);
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
}

.dish-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: var(--gradient-brand);
    border-radius: var(--radius-full);
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
}

.post-body {
    padding: 14px 16px;
}

.post-caption {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary);
}

.post-caption .post-handle {
    color: var(--brand-primary);
    font-weight: 600;
}

.post-caption .show-more {
    color: var(--text-muted);
    cursor: pointer;
    font-size: 12px;
}

.post-caption .show-more:hover {
    color: var(--text-primary);
}

.post-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 16px 14px;
    border-top: 1px solid var(--border-subtle);
    margin-top: 8px;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: none;
    color: var(--text-secondary);
    padding: 7px 12px;
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 500;
    transition: var(--transition);
}

.action-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.action-btn.liked {
    color: var(--brand-accent);
}

.action-btn.liked:hover {
    color: var(--brand-accent);
}

.action-btn .action-icon {
    font-size: 16px;
    transition: var(--transition);
}

.action-btn .action-icon { display: inline-flex; }
.action-btn:active .action-icon { transform: scale(0.85); }

.save-btn {
    margin-inline-start: auto;
    padding: 7px;
}

.save-btn.saved {
    color: var(--text-primary);
}

.inline-comments {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease;
    padding: 0 16px;
}
.inline-comments.open { max-height: 420px; padding-bottom: 14px; }
.ic-list { max-height: 300px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 6px 0 10px; }
.ic-item { display: flex; gap: 8px; font-size: 13px; color: var(--text-secondary); line-height: 1.5; }
.ic-item strong { color: var(--text-primary); }
.ic-item .avatar { width: 28px; height: 28px; flex-shrink: 0; }
.ic-empty { font-size: 13px; color: var(--text-muted); text-align: center; padding: 8px; }
.ic-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; border-top: 1px solid var(--border-subtle); padding-top: 10px; }
.ic-input { flex: 1; min-width: 0; background: var(--bg-hover); border: 1px solid var(--border-subtle); color: var(--text-primary); border-radius: var(--radius-full); padding: 8px 14px; font-size: 13px; }
.ic-send { background: none; color: var(--brand-primary); font-weight: 700; font-size: 13px; padding: 0 6px; }

/* ── Right Panel Widgets ── */
.right-panel {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.widget {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 16px;
}

.widget-title {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Trending Restaurant items */
.trend-resto {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-subtle);
    cursor: pointer;
    transition: var(--transition);
}

.trend-resto:last-child {
    border-bottom: none;
}

.trend-resto:hover .trend-resto-name {
    color: var(--brand-primary);
}

.trend-resto-img {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    flex-shrink: 0;
}

.trend-resto-info {
    flex: 1;
    overflow: hidden;
}

.trend-resto-name {
    font-size: 13px;
    font-weight: 600;
}

.trend-resto-meta {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

.trend-resto-rating {
    font-size: 12px;
    color: var(--brand-gold);
    font-weight: 700;
}

/* Suggested Users */
.suggested-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
}

.suggested-user-info {
    flex: 1;
    overflow: hidden;
}

.suggested-name {
    font-size: 13px;
    font-weight: 600;
}

.suggested-handle {
    font-size: 11px;
    color: var(--text-muted);
}

.follow-btn {
    background: rgba(255, 107, 53, 0.1);
    color: var(--brand-primary);
    border: 1px solid rgba(255, 107, 53, 0.25);
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    padding: 5px 12px;
    cursor: pointer;
    transition: var(--transition);
}

.follow-btn:hover {
    background: var(--brand-primary);
    color: white;
}

.follow-btn.following {
    background: var(--bg-elevated);
    color: var(--text-secondary);
    border-color: var(--border-subtle);
}

/* Top Dishes */
.top-dish {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-subtle);
}

.top-dish:last-child {
    border-bottom: none;
}

.dish-rank {
    width: 22px;
    font-size: 14px;
    font-weight: 800;
    color: var(--text-muted);
    flex-shrink: 0;
}

.dish-rank.gold {
    color: var(--brand-gold);
}

.dish-rank.silver {
    color: #C0C0C0;
}

.dish-rank.bronze {
    color: #CD7F32;
}

.top-dish-name {
    flex: 1;
    font-size: 13px;
    font-weight: 500;
}

.top-dish-score {
    font-size: 12px;
    color: var(--brand-primary);
    font-weight: 700;
}

/* ── Comment box ── */
.comments-section {
    padding: 0 16px 14px;
    border-top: 1px solid var(--border-subtle);
    margin-top: 4px;
}

.comment-input-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
}

.comment-input {
    flex: 1;
    background: var(--bg-card-2);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-full);
    padding: 8px 14px;
    font-size: 13px;
    color: var(--text-primary);
}

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

.comment-submit {
    background: none;
    color: var(--brand-primary);
    font-size: 18px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
}

.comment-submit:hover {
    background: rgba(255, 107, 53, 0.1);
}

.comment-item {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    font-size: 13px;
}

.comment-text {
    flex: 1;
}

.comment-author {
    font-weight: 600;
    color: var(--text-primary);
}

@media (max-width: 1000px) {
    .home-grid {
        grid-template-columns: 1fr;
    }

    .right-panel {
        display: none;
    }
}

@media (max-width: 768px) {
    .topbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding: 14px 16px;
    }

    .topbar-right {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }

    .search-topbar {
        width: 100%;
    }

    .home-grid {
        padding: 16px;
    }
}

/* ── Post Detail Viewer Modal ── */
.post-viewer {
    display: flex;
    width: 90%;
    max-width: 1000px;
    height: 80vh;
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    overflow: hidden;
    position: relative;
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border-mild);
    animation: authFadeIn 0.3s ease;
}

.modal-close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 100;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    backdrop-filter: blur(4px);
    transition: var(--transition);
    border: none;
    cursor: pointer;
}

.modal-close-btn:hover {
    background: var(--brand-primary);
    transform: rotate(90deg);
}

.post-detail-content {
    display: flex;
    width: 100%;
    height: 100%;
}

.post-detail-image-side {
    flex: 1.4;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.post-detail-image-side img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-detail-info-side {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border-left: 1px solid var(--border-subtle);
}

.detail-header {
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border-subtle);
}

.detail-body {
    padding: 20px;
}

.detail-caption-box {
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 16px;
}

.detail-badges {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.detail-comments {
    flex: 1;
    overflow-y: auto;
    padding: 0 20px;
}

.detail-actions {
    padding: 20px;
    border-top: 1px solid var(--border-subtle);
    background: var(--bg-card-2);
}

.detail-actions .post-actions {
    padding: 0;
    border-top: none;
    margin-top: 0;
    margin-bottom: 16px;
}

@media (max-width: 900px) {
    .post-viewer {
        flex-direction: column;
        height: 90vh;
        width: 100%;
        max-width: none;
        border-radius: 0;
    }

    .post-detail-content {
        flex-direction: column;
        overflow-y: auto;
    }

    .post-detail-image-side {
        flex: none;
        height: 40%;
    }

    .post-detail-info-side {
        border-left: none;
    }
}
.ic-form .star-picker { flex-basis: 100%; }

/* ── Instagram-style action bar: ♡ 💬 ✈ on the start side, 🔖 on the far end ── */
.post-actions.ig-bar { gap: 2px; padding: 6px 10px 8px; border-top: 0; margin-top: 0; }
.ig-btn {
    display: inline-flex; align-items: center; gap: 5px; padding: 8px; border: 0; border-radius: var(--radius-full);
    background: none; color: var(--text-primary); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
}
.ig-btn .action-icon { display: inline-flex; transition: transform .15s ease; }
.ig-btn:hover .action-icon { opacity: .6; }
.ig-btn:active .action-icon { transform: scale(.85); }
.ig-btn:focus-visible { outline: 2px solid var(--brand-primary); outline-offset: 1px; }
.ig-btn.liked { color: #ff3040; }
.ig-btn.liked .action-icon { animation: igPop .35s ease; }
.ig-btn.save-btn { margin-inline-start: auto; }
[dir="rtl"] .ig-btn:not(.ig-like):not(.save-btn) .action-icon svg { transform: scaleX(-1); }
@keyframes igPop { 40% { transform: scale(1.25); } }
/* The post page already says "N likes" under the bar, like Instagram */
.post-v-actions-panel .ig-btn .like-count, .post-v-actions-panel .ig-btn .comment-count { display: none; }
#postReportLink { background: none; border: 0; padding: 4px 0; cursor: pointer; }

/* ── Activity heart: top-right of Home on phones (the bottom bar no longer has it) ── */
.topbar-heart { display: none; }
@media (max-width: 768px) {
    .topbar-heart {
        display: grid; place-items: center; position: absolute; top: 12px; right: 12px; width: 44px; height: 44px;
        border-radius: 50%; color: var(--text-primary); text-decoration: none; transition: transform .15s;
    }
    .topbar-heart:active { transform: scale(.88); }
    .topbar-heart:focus-visible { outline: 2px solid var(--brand-primary); outline-offset: 2px; }
    .topbar-heart-badge {
        position: absolute; top: 4px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
        display: grid; place-items: center; font-size: 11px; font-weight: 800; line-height: 1;
        background: #ff3040; color: #fff; border: 2px solid var(--bg-dark);
    }
    .topbar-heart-badge[hidden] { display: none; }
    /* keep the title clear of the heart on the right */
    .topbar-left { padding-right: 48px; }
    [dir="rtl"] .topbar-left { padding-right: 48px; padding-left: 0; }
}

/* ── Gold subscription on Home ── */
.plus-chip {
  display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px 0 12px; flex: none;
  border-radius: var(--radius-full); text-decoration: none; font-size: 13px; font-weight: 800; color: #1a1200;
  background: linear-gradient(135deg, #FFD54F, #FFB700 45%, #FF8A3D); position: relative; overflow: hidden;
  box-shadow: 0 4px 16px rgba(255, 183, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .5); transition: transform .2s, box-shadow .2s;
}
.plus-chip svg { width: 17px; height: 17px; fill: rgba(255, 255, 255, .45); animation: plusCrownFloat 3s ease-in-out infinite; }
.plus-chip::after { content: ""; position: absolute; inset: 0; transform: translateX(-120%);
  background: linear-gradient(100deg, transparent 30%, rgba(255,255,255,.7) 50%, transparent 70%); animation: plusShine 3.5s ease-in-out infinite; }
.plus-chip:hover { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(255, 183, 0, .5); }
.plus-chip:focus-visible { outline: 2px solid var(--brand-gold); outline-offset: 3px; }
.plus-chip.is-member { background: rgba(255, 183, 0, .1); color: var(--brand-gold); border: 1px solid rgba(255, 183, 0, .45); box-shadow: none; }
.plus-chip.is-member svg { fill: none; }
.plus-chip.is-member::after { display: none; }

.plus-promo {
  position: relative; display: flex; align-items: center; gap: 14px; margin-bottom: 18px; padding: 16px;
  border-radius: var(--radius-lg); overflow: hidden; isolation: isolate; border: 1px solid transparent; padding-inline-end: 44px;
  background: linear-gradient(135deg, #1f1600, #2a1500) padding-box, linear-gradient(135deg, #FFD54F, rgba(255, 107, 53, .35) 50%, #FFB700) border-box;
}
.light-theme .plus-promo { background: linear-gradient(135deg, #FFF8E1, #FFE9D6) padding-box, linear-gradient(135deg, #FFB700, rgba(255, 107, 53, .4) 50%, #FFB700) border-box; }
.plus-promo[hidden] { display: none; }
.plus-promo::before { content: ""; position: absolute; inset: -60% -10% auto auto; width: 220px; height: 220px; z-index: -1; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 183, 0, .35), transparent 70%); animation: plusGlow 5s ease-in-out infinite; }
.plus-promo-icon { flex: none; width: 48px; height: 48px; border-radius: 15px; display: grid; place-items: center; color: #1a1200;
  background: linear-gradient(135deg, #FFD54F, #FF8A3D); box-shadow: 0 6px 20px rgba(255, 183, 0, .4); }
.plus-promo-icon svg { width: 26px; height: 26px; fill: rgba(255, 255, 255, .45); animation: plusCrownFloat 3s ease-in-out infinite; }
.plus-promo-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.plus-promo-text b { font-size: 15px; background: linear-gradient(135deg, #FFD54F, #FF8A3D); -webkit-background-clip: text; background-clip: text; color: transparent; }
.plus-promo-text span { font-size: 12.5px; color: var(--text-secondary); line-height: 1.7; }
.plus-promo .plus-btn { flex: none; padding: 10px 18px; font-size: 13px; }
.plus-promo-close { position: absolute; top: 8px; inset-inline-end: 8px; width: 28px; height: 28px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(255, 255, 255, .08); color: var(--text-secondary); font-size: 16px; line-height: 1; }
.plus-promo-close:focus-visible { outline: 2px solid var(--brand-gold); }
@keyframes plusGlow { 50% { transform: translate(-30px, 20px) scale(1.15); opacity: .7; } }

@media (max-width: 768px) {
  .plus-chip { position: absolute; top: 16px; right: 62px; height: 34px; padding: 0 12px 0 10px; }
  [dir="rtl"] .plus-chip { right: auto; left: 12px; } /* RTL: the empty side, away from the title */
  .plus-promo { flex-wrap: wrap; padding: 14px; padding-inline-end: 40px; }
  .plus-promo .plus-btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { .plus-chip svg, .plus-chip::after, .plus-promo::before, .plus-promo-icon svg { animation: none; } }
