/* =========================================================
 * AdSphere – Frontend Styles
 * Basic layout & components for listings, cards, storefronts
 * ======================================================= */

/* ----- General container ----- */

.adsphere-archive-container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 15px;
}

.adsphere-archive-header {
    margin-bottom: 20px;
    text-align: left;
}

.adsphere-archive-header h1 {
    font-size: 2rem;
    margin: 0 0 5px;
}

.adsphere-archive-header p {
    margin: 0;
    color: #666;
    font-size: 0.95rem;
}

/* ----- Grid layout ----- */

.adsphere-archive-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 20px;
}

.adsphere-pagination {
    margin: 30px 0;
    text-align: center;
}

/* ----- Listing card ----- */

.adsphere-card {
    border: 1px solid #e4e4e4;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.adsphere-card:hover {
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.adsphere-card-image {
    display: block;
    background: #f5f5f5;
}

/* SMART ZOOM: slightly taller, cover */
.adsphere-card-image img {
    display: block;
    width: 100%;
    height: 220px;
    object-fit: cover;
}

.adsphere-placeholder-img {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 220px;
    font-size: 0.9rem;
    color: #999;
}

.adsphere-card-body {
    padding: 12px 14px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.adsphere-card-title {
    font-size: 1rem;
    margin: 0;
    line-height: 1.3;
}

.adsphere-card-title a {
    text-decoration: none;
    color: #222;
}

.adsphere-card-title a:hover {
    text-decoration: underline;
}

/* Meta line: price + condition + community */

.adsphere-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    font-size: 0.85rem;
}

.adsphere-price {
    font-weight: 600;
    color: #1f7a3a;
    padding: 2px 6px;
    border-radius: 4px;
    background: #eaf7ee;
}

.adsphere-price-free {
    font-weight: 600;
    color: #c21807;
    padding: 2px 6px;
    border-radius: 4px;
    background: #ffe9e6;
}

.adsphere-condition {
    padding: 2px 6px;
    border-radius: 4px;
    background: #f3f3f3;
    color: #555;
}

.adsphere-community {
    padding: 2px 6px;
    border-radius: 4px;
    background: #eef3ff;
    color: #2f4fb0;
}

/* Badges: featured / boosted */

.adsphere-card-badges {
    margin-top: 2px;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.adsphere-badge-featured,
.adsphere-badge-boosted {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 3px 6px;
    border-radius: 999px;
    display: inline-block;
}

.adsphere-badge-featured {
    background: #ffe9b5;
    color: #a97200;
}

.adsphere-badge-boosted {
    background: #e1f3ff;
    color: #005c99;
}

/* Suspicious warning */

.adsphere-card-warning {
    margin-top: 6px;
    font-size: 0.75rem;
    color: #b00020;
    background: #ffecec;
    border-radius: 4px;
    padding: 4px 6px;
}

/* ----- Storefront shortcode ----- */

.adsphere-storefront {
    max-width: 900px;
    margin: 40px auto;
    padding: 0 15px 20px;
    border: 1px solid #e4e4e4;
    border-radius: 10px;
    background: #fff;
}

.adsphere-storefront h2 {
    font-size: 1.6rem;
    margin: 16px 0 4px;
}

.adsphere-storefront-image {
    width: 100%;
    max-height: 260px;
    object-fit: cover;
    border-radius: 8px 8px 0 0;
}

.adsphere-storefront-tagline {
    margin: 0;
    color: #555;
    font-size: 0.95rem;
}

.adsphere-storefront-badges {
    margin: 10px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.adsphere-badge {
    display: inline-block;
    font-size: 0.75rem;
    padding: 4px 8px;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.adsphere-badge-verified {
    background: #e4f5ff;
    color: #00639b;
}

.adsphere-badge-community {
    background: #f2f0ff;
    color: #4834d4;
}

.adsphere-storefront-description {
    margin: 10px 0 20px;
    font-size: 0.95rem;
    color: #444;
}

.adsphere-storefront-listings {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 14px;
}

.adsphere-storefront-listing-card {
    border: 1px solid #ececec;
    border-radius: 8px;
    overflow: hidden;
    background: #fafafa;
    text-align: center;
    padding-bottom: 10px;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.adsphere-storefront-listing-card:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
    transform: translateY(-2px);
}

.adsphere-storefront-listing-card img {
    width: 100%;
    height: 140px;
    object-fit: cover;
}

.adsphere-storefront-listing-card h4 {
    font-size: 0.9rem;
    margin: 8px 8px 0;
}

/* ----- Verification form ----- */

.adsphere-verification-form {
    max-width: 500px;
    margin: 20px auto;
    padding: 15px 18px;
    border-radius: 8px;
    border: 1px solid #e4e4e4;
    background: #fff;
}

.adsphere-verification-form h3 {
    margin-top: 0;
    margin-bottom: 10px;
}

.adsphere-verification-form p {
    margin-bottom: 10px;
}

.adsphere-verification-form input[type="file"] {
    margin-top: 4px;
}

/* ----- Buttons (generic tweaks) ----- */

.adsphere-btn-featured,
.adsphere-btn-boost,
.adsphere-btn-storefront {
    display: inline-block;
    margin: 4px 0;
}

.adsphere-btn-featured {
    background: #ffb347 !important;
    border-color: #ffb347 !important;
    color: #222 !important;
}

.adsphere-btn-boost {
    background: #79a6ff !important;
    border-color: #79a6ff !important;
    color: #fff !important;
}

.adsphere-btn-storefront {
    background: #2ecc71 !important;
    border-color: #2ecc71 !important;
    color: #fff !important;
}

/* Responsive adjustments (cards & archive) */

@media (max-width: 768px) {
    .adsphere-archive-container {
        margin: 20px auto;
    }

    .adsphere-archive-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 14px;
    }

    .adsphere-storefront {
        margin: 20px auto;
    }

    .adsphere-card-image img,
    .adsphere-placeholder-img {
        height: 180px;
    }
}

/* =========================================================
 * HOMEPAGE STYLES (Hero + Rows)
 * ======================================================= */

.adsphere-home {
    background: #0f1115;
}

/* HERO */

.adsphere-home-hero {
    background: linear-gradient(135deg, #0060c9 0%, #3b8ff3 50%, #4da9ff 100%);
    color: #fff;
    padding: 60px 0 70px;
}

.adsphere-hero-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
}

.adsphere-hero-text {
    flex: 1.1;
}

.adsphere-hero-kicker {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    margin: 0 0 8px;
    opacity: 0.85;
}

.adsphere-hero-text h1 {
    font-size: 2.4rem;
    line-height: 1.2;
    margin: 0 0 10px;
}

.adsphere-hero-subtitle {
    font-size: 1rem;
    margin: 0 0 20px;
    max-width: 420px;
    opacity: 0.95;
}

.adsphere-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.adsphere-btn-primary,
.adsphere-btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 22px;
    border-radius: 999px;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}

.adsphere-btn-primary {
    background: #ffffff;
    color: #0051a8;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}

.adsphere-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.22);
}

.adsphere-btn-ghost {
    background: transparent;
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.7);
}

.adsphere-btn-ghost:hover {
    background: rgba(255, 255, 255, 0.12);
}

.adsphere-hero-image {
    flex: 0.9;
    display: flex;
    justify-content: center;
}

.adsphere-hero-image img {
    max-width: 430px;
    width: 100%;
    height: auto;
    display: block;
    filter: drop-shadow(0 24px 40px rgba(0, 0, 0, 0.35));
    border-radius: 18px;
}

/* Main homepage sections */

.adsphere-home .adsphere-archive-container {
    margin-top: 0;
    padding-top: 40px;
    padding-bottom: 60px;
}

/* Section headers */

.adsphere-home-section {
    margin-bottom: 40px;
}

.adsphere-home-section-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 16px;
    color: #f5f7fb;
}

.adsphere-home-section-header h2 {
    font-size: 1.5rem;
    margin: 0;
}

/* Horizontal card row */

.adsphere-card-row {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 6px;
    scroll-snap-type: x mandatory;
}

.adsphere-card-row::-webkit-scrollbar {
    height: 6px;
}

.adsphere-card-row::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 999px;
}

.adsphere-card-row-item {
    min-width: 240px;
    max-width: 260px;
    scroll-snap-align: start;
}

/* Three-column band: From your community / Across Hyderabad / Browse by community */

.adsphere-home-section-threecol {
    background: #151921;
    border-radius: 16px;
    padding: 22px 20px 10px;
}

.adsphere-threecol {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
    color: #f5f7fb;
}

.adsphere-threecol-block h3 {
    font-size: 1.1rem;
    margin: 0 0 12px;
}

.adsphere-mini-row {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.adsphere-mini-card {
    background: #1b202a;
    border-radius: 10px;
    padding: 8px;
    border: 1px solid #262b36;
}

/* Reuse listing card but make it denser */
.adsphere-mini-card .adsphere-card {
    border: none;
    box-shadow: none;
}

.adsphere-mini-card .adsphere-card-image img {
    height: 120px;
}

/* Community pills in third column */

.adsphere-community-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.adsphere-community-pill {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 999px;
    background: #1b202a;
    border: 1px solid #262b36;
    color: #f5f7fb;
    font-size: 0.85rem;
    text-decoration: none;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.adsphere-community-pill:hover {
    background: #232936;
    border-color: #3b4a65;
}

/* Storefront row (pills) */

.adsphere-storefront-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.adsphere-storefront-pill {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 12px;
    background: #151921;
    border: 1px solid #262b36;
    color: #f5f7fb;
    text-decoration: none;
    min-width: 220px;
    gap: 10px;
}

.adsphere-storefront-pill:hover {
    background: #1f2632;
    border-color: #3b4a65;
}

.adsphere-storefront-pill-logo {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    overflow: hidden;
    background: #222837;
    flex-shrink: 0;
}

.adsphere-storefront-pill-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.adsphere-storefront-pill-text small {
    display: block;
    font-size: 0.8rem;
    color: #c1c7d8;
}

/* Dark background typography tweaks */

.adsphere-home-section,
.adsphere-home-section p {
    color: #e0e4f0;
}

/* Responsive (homepage) */

@media (max-width: 900px) {
    .adsphere-hero-inner {
        flex-direction: column;
        text-align: left;
    }

    .adsphere-hero-text h1 {
        font-size: 2rem;
    }

    .adsphere-threecol {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .adsphere-hero-inner {
        padding: 0 16px;
    }

    .adsphere-btn-primary,
    .adsphere-btn-ghost {
        width: 100%;
        justify-content: center;
    }

    .adsphere-card-row-item {
        min-width: 210px;
    }
}

/* =========================================================
 * BROWSE LISTINGS PAGE (light theme)
 * ======================================================= */

.adsphere-browse-page {
    background: #f3f4f6;
    padding: 40px 0 60px;
    width: 100%;
    display: block;
}

.adsphere-browse-inner {
    max-width: 1200px;
    width: 100%;        /* <<< keeps grey band wide even with no results */
    margin: 0 auto;
    padding: 0 24px;
}

/* Header: title + description */

.adsphere-browse-header {
    margin-bottom: 20px;
}

.adsphere-browse-header h1 {
    font-size: 2.2rem;
    margin: 0 0 6px;
    color: #111827;
}

.adsphere-browse-header p {
    margin: 0;
    color: #6b7280;
    font-size: 0.95rem;
}

/* Top bar: search + sort on one row */

.adsphere-browse-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
}

/* Search takes most of the width */

.adsphere-browse-search {
    flex: 1 1 auto;
}

.adsphere-browse-search input,
.adsphere-browse-search input[type="text"] {
    width: 100%;
    padding: 12px 14px;
    font-size: 1rem;
    border: 1px solid #ccd4e0;
    border-radius: 8px;
    background: #fff;
}

/* Sort compact on the right – KEEP "Sort by" on one line */

.adsphere-browse-sort {
    flex: 0 0 190px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    color: #6b7280;
}

.adsphere-browse-sort span,
.adsphere-browse-sort label {
    display: inline-block;
    white-space: nowrap;
}

/* Hide any line break the template might output (Sort<br>by) */
.adsphere-browse-sort br {
    display: none;
}

.adsphere-browse-sort select {
    width: 100%;
    padding: 10px 14px;
    font-size: 0.95rem;
    border: 1px solid #ccd4e0;
    border-radius: 8px;
    background: #fff;
}

/* Layout: sidebar + main */

.adsphere-browse-layout {
    display: flex;
    gap: 24px;
    margin-top: 8px;
}

/* Sidebar – compact card, STICKY on desktop */

.adsphere-browse-sidebar {
    flex: 0 0 260px;
    background: #ffffff;
    border-radius: 18px;
    padding: 18px 16px 18px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
    border: 1px solid #e5e7eb;

    position: sticky;
    top: 100px; /* adjust if your header height changes */
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    align-self: flex-start;
}

.adsphere-browse-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.adsphere-filter-block h3 {
    margin: 0 0 8px;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #374151;
}

.adsphere-filter-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.adsphere-filter-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: #111827;
}

.adsphere-filter-checkbox input[type="checkbox"] {
    width: 14px;
    height: 14px;
    border-radius: 4px;
}

.adsphere-filter-seeall {
    margin-top: 6px;
    padding: 4px 8px;
    border-radius: 999px;
    border: none;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 0.8rem;
    cursor: pointer;
}

/* Communities & price */

.adsphere-filter-select {
    width: 100%;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid #d1d5db;
    background: #ffffff;
    color: #111827;
    font-size: 0.9rem;
}

.adsphere-price-row {
    display: flex;
    gap: 8px;
}

.adsphere-price-row input[type="number"] {
    flex: 1;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid #d1d5db;
    background: #ffffff;
    color: #111827;
    font-size: 0.9rem;
}

.adsphere-filter-actions {
    display: flex;
    gap: 8px;
    margin-top: 6px;
}

.adsphere-filter-submit {
    flex: 1;
    border-radius: 999px;
    border: none;
    padding: 8px 14px;
    background: #2563eb;
    color: #f9fafb;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
}

.adsphere-filter-reset {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid #d1d5db;
    color: #6b7280;
    font-size: 0.85rem;
    text-decoration: none;
}

/* Main content */

.adsphere-browse-main {
    flex: 1;
    background: transparent;
    width: 100%;
}

/* 3-column grid for browse rows (desktop), 2 on tablet, 1 on mobile */

.adsphere-browse-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
    width: 100%;
}

/* tablet */
@media (max-width: 1024px) {
    .adsphere-browse-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* mobile */
@media (max-width: 640px) {
    .adsphere-browse-grid {
        grid-template-columns: 1fr;
    }
}

/* Reuse home sections but dark text */

.adsphere-browse-main .adsphere-home-section-header h2 {
    color: #111827;
}

.adsphere-browse-main .adsphere-home-section {
    color: #374151;
}

/* Modal styles (for See all) */

.adsphere-modal-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.adsphere-modal-backdrop.adsphere-modal-open {
    display: flex;
}

.adsphere-modal {
    background: #ffffff;
    max-width: 640px;
    width: 100%;
    border-radius: 18px;
    padding: 20px 22px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.35);
    max-height: 80vh;
    overflow: auto;
}

.adsphere-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.adsphere-modal-header h2 {
    font-size: 1.2rem;
    margin: 0;
}

.adsphere-modal-close {
    border: none;
    background: transparent;
    font-size: 1rem;
    cursor: pointer;
}

.adsphere-modal-body {
    margin-bottom: 12px;
}

.adsphere-modal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 8px 16px;
}

.adsphere-modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

.adsphere-modal-close-text {
    border: none;
    background: transparent;
    color: #6b7280;
    font-size: 0.9rem;
    cursor: pointer;
}

/* Responsive layout for browse page */

@media (max-width: 900px) {
    .adsphere-browse-layout {
        flex-direction: column;
    }

    .adsphere-browse-sidebar {
        position: static;
        max-height: none;
        overflow: visible;
        flex: 1 1 auto;
        order: 2;
    }

    .adsphere-browse-main {
        order: 1;
    }
}

@media (max-width: 640px) {
    .adsphere-browse-topbar {
        flex-direction: column;
        align-items: stretch;
    }

    .adsphere-browse-search,
    .adsphere-browse-sort {
        width: 100%;
        max-width: 100%;
    }

    .adsphere-browse-sort {
        justify-content: flex-end;
    }
}

/* =========================================================
   FIX: Prevent width shrink when no search results appear
   ========================================================= */

.adsphere-browse-main p {
    width: 100%;
}

/* Optional clean no-result style */
.adsphere-browse-no-results {
    width: 100%;
    text-align: center;
    padding: 60px 0;
    background: #ffffff;
    border-radius: 12px;
    font-size: 1rem;
    color: #64748b;
    border: 1px dashed #d1d5db;
}