/* ====================================================================
   discover.css — Discover feed, composer, follow button, Shop/Discover
   toggle, profile stats row, and admin posts-approval styling.

   Uses CSS variables with sane fallbacks so it drops in cleanly even
   before you wire real brand tokens from style.css. Swap the
   --hera-* values below for your actual palette any time.
==================================================================== */

:root {
    --hera-green: #2f6b1f;
    --hera-green-dark: #1f4a14;
    --hera-orange: #d4770a;
    --hera-border: #e5e7eb;
    --hera-text-muted: #6b7280;
    --hera-bg-soft: #f6f7f5;
    --hera-radius: 16px;
}

/* -------------------- SHOP / DISCOVER TOGGLE -------------------- */
.view-toggle {
    display: flex;
    width: fit-content;
    margin: 32px auto;
    background: #eee;
    border-radius: 999px;
    padding: 4px;
    gap: 4px;
}

.view-toggle-btn {
    border: none;
    background: transparent;
    padding: 10px 26px;
    border-radius: 999px;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    color: #333;
    transition: background 0.2s ease, color 0.2s ease;
    display: flex;
    align-items: center;
    gap: 4px;
}

.view-toggle-btn.active {
    background: linear-gradient(135deg, var(--hera-green), var(--hera-green-dark));
    color: #fff;
}

.view-toggle-plus {
    font-size: 12px;
    vertical-align: super;
}

#sellerViewToggle {
    margin-top: 32px;
}

/* -------------------- PROFILE STATS + FOLLOW BUTTON -------------------- */
.profile-stats-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 20px;
    margin-top: 12px;
}

.profile-stat {
    font-size: 14px;
    color: #333;
    font-family: 'Poppins', sans-serif;
}

.profile-stat strong {
    font-weight: 700;
}

.follow-btn {
    padding: 8px 22px;
    border-radius: 999px;
    border: none;
    background: var(--hera-green);
    color: #fff;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border 0.2s ease;
}

.follow-btn:hover {
    background: var(--hera-green-dark);
}

.follow-btn.is-following {
    background: #fff;
    color: #111;
    border: 1px solid var(--hera-border);
}

.follow-btn.is-following:hover {
    background: #f3f4f6;
}

.follow-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* -------------------- DISCOVER LAYOUT -------------------- */
.discover-page-title {
    text-align: left;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

.discover-layout {
    display: grid;
    grid-template-columns: 200px minmax(0, 620px) 260px;
    gap: 32px;
    max-width: 1100px;
    margin: 20px auto 80px;
    padding: 0 20px;
    align-items: start;
}

.discover-layout--profile {
    grid-template-columns: 200px minmax(0, 620px);
    max-width: 900px;
}

.discover-side-nav {
    position: sticky;
    top: 90px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.discover-side-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 10px;
    border: none;
    background: transparent;
    font-family: 'Poppins', sans-serif;
    font-size: 15px;
    font-weight: 500;
    color: #333;
    text-decoration: none;
    cursor: pointer;
    text-align: left;
}

.discover-side-nav-item .material-symbols-outlined {
    font-size: 20px;
}

.discover-side-nav-item.active,
.discover-side-nav-item:hover {
    background: var(--hera-bg-soft);
    font-weight: 700;
}

.discover-side-panel h1 {
    font-size: 20px;
    margin-bottom: 4px;
}

.discover-feed-col {
    display: flex;
    flex-direction: column;
    gap: 0;
    border-left: 1px solid var(--hera-border);
    border-right: 1px solid var(--hera-border);
}

.discover-feed-list {
    display: flex;
    flex-direction: column;
}

/* -------------------- COMPOSER -------------------- */
.discover-composer {
    display: flex;
    gap: 14px;
    padding: 20px;
    border-bottom: 1px solid var(--hera-border);
}

.discover-composer--locked {
    color: var(--hera-text-muted);
    justify-content: center;
    padding: 30px 20px;
}

.composer-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.composer-body {
    flex: 1;
    min-width: 0;
}

.composer-textarea {
    width: 100%;
    border: none;
    outline: none;
    resize: none;
    font-family: 'Poppins', sans-serif;
    font-size: 15px;
    line-height: 1.4;
    min-height: 24px;
    max-height: 220px;
}

.composer-image-previews {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.composer-preview-thumb {
    position: relative;
    width: 84px;
    height: 84px;
    border-radius: 10px;
    overflow: hidden;
}

.composer-preview-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.composer-preview-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(0, 0, 0, 0.65);
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    cursor: pointer;
    padding: 0;
}

.composer-preview-remove .material-symbols-outlined {
    font-size: 14px;
}

.composer-product-picker {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    padding: 8px 12px;
    background: var(--hera-bg-soft);
    border-radius: 10px;
    font-size: 13px;
}

.composer-product-picker select {
    flex: 1;
    border: none;
    background: transparent;
    font-family: 'Poppins', sans-serif;
    font-size: 13px;
    outline: none;
}

.composer-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 12px;
}

.composer-icon-btn {
    display: flex;
    align-items: center;
    cursor: pointer;
    color: var(--hera-text-muted);
}

.composer-char-count {
    margin-left: auto;
    font-size: 12px;
    color: var(--hera-text-muted);
}

.composer-post-btn {
    padding: 7px 20px;
    border-radius: 999px;
    border: none;
    background: #111;
    color: #fff;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
}

.composer-post-btn:disabled {
    background: #d1d5db;
    cursor: not-allowed;
}

.composer-hint {
    font-size: 12px;
    color: var(--hera-text-muted);
    margin-top: 8px;
}

/* -------------------- POST CARD -------------------- */
.discover-post {
    display: flex;
    gap: 12px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--hera-border);
}

.discover-post-avatar img {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
}

.discover-post-main {
    flex: 1;
    min-width: 0;
}

.discover-post-head {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.discover-post-username {
    font-weight: 700;
    font-size: 14.5px;
    color: #111;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.discover-founder-icon {
    font-size: 15px !important;
    color: var(--hera-orange);
}

.discover-post-time {
    font-size: 13px;
    color: var(--hera-text-muted);
}

.discover-post-follow-btn {
    padding: 4px 14px;
    font-size: 12.5px;
    line-height: 1.4;
}

.discover-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11.5px;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 999px;
    margin-left: auto;
}

.discover-status-badge .material-symbols-outlined {
    font-size: 14px;
}

.discover-status-badge.pending {
    background: #fff4e0;
    color: #a6620a;
}

.discover-status-badge.rejected {
    background: #fde2e2;
    color: #9e0202;
}

.discover-post-caption {
    font-size: 14.5px;
    line-height: 1.45;
    margin: 6px 0 0;
    white-space: pre-wrap;
    word-break: break-word;
}

.discover-post-images {
    display: grid;
    gap: 4px;
    margin-top: 10px;
    border-radius: 14px;
    overflow: hidden;
}

.discover-post-images img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.discover-post-images--1 { grid-template-columns: 1fr; max-height: 420px; }
.discover-post-images--1 img { max-height: 420px; }
.discover-post-images--2 { grid-template-columns: 1fr 1fr; aspect-ratio: 2 / 1.2; }
.discover-post-images--3 { grid-template-columns: 1fr 1fr 1fr; aspect-ratio: 3 / 1.2; }
.discover-post-images--4 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; aspect-ratio: 1 / 1; }

.discover-product-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #111;
    color: #fff;
    border-radius: 999px;
    padding: 6px;
    margin-top: 10px;
    text-decoration: none;
    width: fit-content;
    max-width: 100%;
}

.discover-product-chip img {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
}

.discover-product-chip-info {
    display: flex;
    flex-direction: column;
    padding-right: 12px;
}

.discover-product-chip-title {
    font-size: 12.5px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
}

.discover-product-chip-cta {
    font-size: 10.5px;
    color: #cbd5c9;
}

.discover-post-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 12px;
}

.discover-action-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #333;
    display: flex;
    align-items: center;
}

.discover-action-btn:disabled {
    opacity: 0.35;
    cursor: default;
}

.discover-action-btn .material-symbols-outlined {
    font-size: 21px;
    transition: color 0.15s ease;
}

.discover-like-btn.liked .material-symbols-outlined {
    color: #e0245e;
    font-variation-settings: 'FILL' 1;
}

/* -------------------- LIKE / COUNT ANIMATIONS --------------------
   Shared "pop" animation for the heart icon on both post likes and
   reply likes, plus a small "bump" flash on any count label whenever
   its number changes, so likes/replies feel responsive instead of
   just snapping to a new value. */
@keyframes discoverLikePop {
    0% { transform: scale(1); }
    30% { transform: scale(1.35); }
    55% { transform: scale(0.9); }
    100% { transform: scale(1); }
}

.discover-action-btn.like-animate .material-symbols-outlined,
.discover-reply-like-btn.like-animate .material-symbols-outlined {
    animation: discoverLikePop 0.36s ease;
}

.discover-like-count,
.discover-reply-count,
.discover-reply-like-count {
    display: inline-block;
    transition: transform 0.18s ease, color 0.18s ease;
}

.count-bump {
    transform: scale(1.2);
    color: #e0245e;
}

.discover-post-meta {
    display: flex;
    gap: 14px;
    margin-top: 4px;
    font-size: 12.5px;
    color: var(--hera-text-muted);
}

/* -------------------- THREAD / REPLIES -------------------- */
.discover-thread {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--hera-border);
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.discover-thread.open {
    opacity: 1;
    transform: translateY(0);
}

.discover-replies-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 10px;
}

.discover-reply {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    font-size: 13.5px;
    line-height: 1.4;
}

.discover-reply-main {
    flex: 1;
    min-width: 0;
}

.discover-reply-username {
    font-weight: 700;
    margin-right: 6px;
}

.discover-reply-like-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    background: none;
    border: none;
    cursor: pointer;
    color: #333;
    flex-shrink: 0;
    padding: 2px;
}

.discover-reply-like-btn .material-symbols-outlined {
    font-size: 16px;
    transition: color 0.15s ease;
}

.discover-reply-like-btn.liked .material-symbols-outlined {
    color: #e0245e;
    font-variation-settings: 'FILL' 1;
}

.discover-reply-like-count {
    font-size: 11px;
    color: var(--hera-text-muted);
    min-width: 8px;
    text-align: center;
}

.discover-reply-form {
    display: flex;
    gap: 8px;
}

.discover-reply-form input {
    flex: 1;
    border: 1px solid var(--hera-border);
    border-radius: 999px;
    padding: 8px 14px;
    font-family: 'Poppins', sans-serif;
    font-size: 13px;
    outline: none;
}

.discover-reply-form button {
    border: none;
    background: var(--hera-green);
    color: #fff;
    border-radius: 50%;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
}

.discover-reply-form button .material-symbols-outlined {
    font-size: 17px;
}

/* -------------------- EMPTY / LOADING STATES -------------------- */
.discover-loading,
.discover-empty {
    text-align: center;
    color: var(--hera-text-muted);
    padding: 40px 20px;
    font-size: 14px;
}

.discover-empty--small {
    padding: 8px 0;
    text-align: left;
}

/* -------------------- GALLERY GRID --------------------
   Seamless Instagram-style grid: equal square cells with a 1px hairline
   between them (no visible outer gap/padding). No composer/post box is
   ever placed above this grid — it's image cells only. */
.discover-gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    background: var(--hera-border);
}

.discover-gallery-cell {
    display: block;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    padding: 0;
    border: none;
    background: #fff;
}

.discover-gallery-cell img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.2s ease;
}

.discover-gallery-cell:hover img {
    transform: scale(1.04);
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 980px) {
    .discover-layout {
        grid-template-columns: 170px minmax(0, 1fr);
    }
    .discover-side-panel {
        display: none;
    }
}

@media (max-width: 700px) {
    .discover-layout,
    .discover-layout--profile {
        grid-template-columns: 1fr;
        padding: 0 12px;
    }

    .discover-side-nav {
        position: static;
        flex-direction: row;
        justify-content: space-around;
        border-bottom: 1px solid var(--hera-border);
        padding-bottom: 8px;
        margin-bottom: 8px;
    }

    .discover-side-nav-item {
        flex-direction: column;
        gap: 2px;
        font-size: 12px;
        padding: 6px 8px;
    }

    .discover-feed-col {
        border-left: none;
        border-right: none;
    }

    .discover-post {
        padding: 14px 12px;
    }

    .discover-composer {
        padding: 14px 12px;
    }

    .composer-product-picker select {
        max-width: 100%;
    }

    .profile-stats-row {
        gap: 12px;
        row-gap: 10px;
    }

    .discover-gallery-grid {
        gap: 1px;
    }

    .view-toggle-btn {
        padding: 9px 18px;
        font-size: 14px;
    }
}

@media (max-width: 420px) {
    .discover-post-images--3,
    .discover-post-images--4 {
        aspect-ratio: 1 / 1;
    }

    .discover-product-chip-title {
        max-width: 120px;
    }
}

/* ==================== ADMIN: POSTS APPROVAL PAGE ==================== */
.admin-posts-filter {
    border: 1px solid var(--hera-border);
    background: #fff;
    padding: 8px 18px;
    border-radius: 999px;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    margin: 0 4px;
}

.admin-posts-filter.active {
    background: #111;
    color: #fff;
    border-color: #111;
}

.admin-posts-list {
    max-width: 720px;
    margin: 24px auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 0 16px;
}

.admin-post-card {
    border: 1px solid var(--hera-border);
    border-radius: var(--hera-radius);
    padding: 16px;
    background: #fff;
}

.admin-post-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.admin-post-caption {
    font-size: 14px;
    line-height: 1.4;
    margin: 6px 0;
}

.admin-post-images {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 10px 0;
}

.admin-post-images img {
    width: 110px;
    height: 110px;
    object-fit: cover;
    border-radius: 10px;
}

.admin-post-product {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--hera-bg-soft);
    padding: 6px 10px;
    border-radius: 10px;
    font-size: 13px;
    width: fit-content;
    margin: 8px 0;
}

.admin-post-product img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
}

.admin-post-rejection-reason {
    font-size: 13px;
    color: #9e0202;
    margin: 6px 0;
}

.admin-post-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

/* ==================== GALLERY LIGHTBOX ====================
   Simple, distraction-free view: just the photo, an (x) close button,
   and like / reply / share + counts underneath. Fades and scales in/out
   smoothly instead of popping instantly. */
.discover-lightbox-overlay {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    padding: 24px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.discover-lightbox-overlay.open {
    display: flex;
}

.discover-lightbox-overlay.show {
    opacity: 1;
}

.discover-lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
}

.discover-lightbox-card {
    position: relative;
    z-index: 1;
    display: flex;
    background: #fff;
    border-radius: var(--hera-radius);
    overflow: hidden;
    max-width: 920px;
    width: 100%;
    max-height: 88vh;
    transform: scale(0.96);
    transition: transform 0.2s ease;
}

.discover-lightbox-overlay.show .discover-lightbox-card {
    transform: scale(1);
}

.discover-lightbox-image {
    flex: 1 1 60%;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
}

.discover-lightbox-image img {
    width: 100%;
    height: 100%;
    max-height: 88vh;
    object-fit: contain;
    display: block;
}

.discover-lightbox-info {
    flex: 0 0 220px;
    padding: 22px;
    overflow-y: auto;
    min-width: 200px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.discover-lightbox-info .discover-post-actions {
    margin-top: 0;
}

.discover-lightbox-close {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 2;
    background: rgba(0, 0, 0, 0.55);
    border: none;
    color: #fff;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.discover-lightbox-close:hover {
    background: rgba(0, 0, 0, 0.75);
}

@media (max-width: 700px) {
    .discover-lightbox-overlay {
        padding: 0;
    }
    .discover-lightbox-card {
        flex-direction: column;
        max-height: 100vh;
        border-radius: 0;
    }
    .discover-lightbox-image {
        max-height: 45vh;
    }
    .discover-lightbox-image img {
        max-height: 45vh;
    }
    .discover-lightbox-info {
        min-width: 0;
        flex: 1 1 auto;
    }
}

/* ==================== SELLER PROFILE HEADER LAYOUT ====================
   Matches the reference design: cover photo full-width, circular profile
   picture centered and overlapping the bottom edge of the cover photo,
   founding-artist badge + username + bio stacked on the left underneath,
   and the stats row (products/followers/following + share button) aligned
   to the right at the same vertical level.

   NOTE: seller-profile.css (loaded after this file) may already define
   cover/avatar sizing — if things look off, remove any conflicting
   .seller-cover-wrap / .profile-img-container / #seller-profile rules
   from seller-profile.css so these take effect cleanly.
======================================================================= */
.seller-cover-wrap {
    position: relative;
    width: 100%;
    max-width: 1400px;
    margin: 24px auto 0;
    height: 220px;
    border-radius: var(--hera-radius) var(--hera-radius) 0 0;
    overflow: hidden;
    background: var(--hera-bg-soft);
}

.seller-cover-wrap img#seller-cover-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.seller-cover-wrap .profile-img-container {
    position: absolute;
    left: 50%;
    bottom: -55px;
    transform: translateX(-50%);
    z-index: 2;
    width: 110px;
    height: 110px;
    border-radius: 50%;
    cursor: pointer;
}

.seller-cover-wrap .profile-img-container img#seller-pfp {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #fff;
    box-shadow: 0 0 0 2px var(--hera-orange);
    display: block;
}

.seller-cover-wrap .profile-img-container.has-featured img#seller-pfp {
    box-shadow: 0 0 0 3px var(--hera-orange);
}

#seller-profile {
    max-width: 1400px;
    margin: -100px auto 0px auto;
    padding: 0 30px;
}

.profile-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 16px;
    border-bottom: 1px solid var(--hera-border);
    padding-bottom: 20px;
}

.profile-header-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.profile-header-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
}

.founding-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--hera-orange);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
    padding: 4px 10px;
    border-radius: 999px;
    width: fit-content;
}

.founding-badge .badge-icon {
    font-size: 14px;
}

.username-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.username-row h1 {
    margin: 0;
    font-size: 24px;
}

.share-btn {
    border: none;
    background: var(--hera-bg-soft);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #333;
}

.share-btn:hover {
    background: #eceee9;
}

#seller-bio {
    margin: 2px 0 0;
    font-size: 14px;
    color: var(--hera-text-muted);
    max-width: 420px;
}

.profile-header-right .profile-stats-row {
    margin-top: 0;
    justify-content: flex-end;
}

.profile-header-right .share-btn {
    margin-left: 4px;
}

@media (max-width: 700px) {
    .seller-cover-wrap {
        height: 160px;
        border-radius: 0;
    }
    .seller-cover-wrap .profile-img-container {
        width: 90px;
        height: 90px;
        bottom: -45px;
    }
    #seller-profile {
        padding-top: 55px;
    }
    .profile-header-row {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .profile-header-left {
        align-items: center;
    }
    .profile-header-right {
        align-items: center;
        width: 100%;
    }
    .profile-header-right .profile-stats-row {
        justify-content: center;
    }
}
