/* ============================================================
   Base Reset & Variables
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --primary:   #2563eb;
    --primary-h: #1d4ed8;
    --danger:    #dc2626;
    --success:   #16a34a;
    --text:      #1f2937;
    --muted:     #6b7280;
    --border:    #e5e7eb;
    --bg:        #f9fafb;
    --white:     #ffffff;
    --radius:    8px;
    --shadow:    0 1px 3px rgba(0,0,0,.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}

/* ============================================================
   Header
   ============================================================ */
.site-header {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    padding: 12px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.logo {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
}

.main-nav { display: flex; gap: 12px; flex-wrap: wrap; }
.main-nav a {
    color: var(--text);
    font-size: .9rem;
    padding: 6px 10px;
    border-radius: var(--radius);
    transition: background .2s;
}
.main-nav a:hover { background: var(--bg); text-decoration: none; }

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
    background: var(--text);
    color: #d1d5db;
    padding: 40px 0 20px;
    margin-top: 60px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 32px;
    margin-bottom: 32px;
}

.footer-col h4 { color: var(--white); margin-bottom: 12px; font-size: .95rem; }
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 6px; }
.footer-col ul li a { color: #9ca3af; font-size: .85rem; }
.footer-col ul li a:hover { color: var(--white); }
.footer-copy { text-align: center; font-size: .8rem; color: #6b7280; }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: var(--radius);
    font-size: .95rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: background .2s, transform .1s;
    text-decoration: none;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary  { background: var(--primary); color: var(--white); }
.btn-primary:hover { background: var(--primary-h); }
.btn-block    { display: block; width: 100%; text-align: center; }

/* ============================================================
   Alerts
   ============================================================ */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-size: .9rem;
}
.alert p { margin-bottom: 4px; }
.alert-error   { background: #fef2f2; border: 1px solid #fecaca; color: var(--danger); }
.alert-success { background: #f0fdf4; border: 1px solid #bbf7d0; color: var(--success); }

/* ============================================================
   Auth Pages (login / register)
   ============================================================ */
.auth-section {
    min-height: 80vh;
    display: flex;
    align-items: center;
    padding: 40px 0;
}

.auth-box {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 36px;
    width: 100%;
    max-width: 460px;
    margin: 0 auto;
    box-shadow: var(--shadow);
}

.auth-box h1 { font-size: 1.5rem; margin-bottom: 24px; }

.form-group { margin-bottom: 18px; }
.form-group label {
    display: block;
    font-size: .85rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text);
}
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: .95rem;
    color: var(--text);
    background: var(--white);
    transition: border .2s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.auth-alt { margin-top: 16px; text-align: center; font-size: .875rem; color: var(--muted); }

/* ============================================================
   Hero Section (homepage)
   ============================================================ */
.hero {
    background: linear-gradient(135deg, var(--primary) 0%, #1d4ed8 100%);
    color: var(--white);
    padding: 60px 0;
    text-align: center;
}
.hero h1 { font-size: 2.2rem; margin-bottom: 12px; }
.hero p   { font-size: 1.1rem; margin-bottom: 28px; opacity: .9; }

/* ============================================================
   Craigslist Style Directory (Home Page)
   ============================================================ */
.directory { padding: 40px 0 60px; }

.country-section { margin-bottom: 50px; }
.country-title {
    font-size: 1.3rem;
    font-weight: 700;
    border-bottom: 2px solid var(--primary);
    padding-bottom: 10px;
    margin-bottom: 24px;
    color: var(--primary);
}

.states-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 24px;
}

.state-block { }
.state-title {
    font-size: .9rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
}

.city-list { list-style: none; }
.city-list li { margin-bottom: 3px; }
.city-list li a {
    font-size: .875rem;
    color: var(--primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2px 0;
}
.city-list li a:hover { text-decoration: underline; }
.city-ad-count {
    font-size: .72rem;
    color: var(--muted);
    background: var(--bg);
    padding: 1px 6px;
    border-radius: 10px;
}
.no-data { font-size: .8rem; color: var(--muted); font-style: italic; }


/* ============================================================
   City Directory (homepage)
   ============================================================ */
.directory { padding: 50px 0; }
.directory h2 { font-size: 1.4rem; margin-bottom: 28px; }

.country-block { margin-bottom: 36px; }
.country-block h3 {
    font-size: 1.1rem;
    color: var(--muted);
    border-bottom: 1px solid var(--border);
    padding-bottom: 8px;
    margin-bottom: 14px;
}

.city-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.city-link {
    background: var(--white);
    border: 1px solid var(--border);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: .875rem;
    color: var(--text);
    transition: background .2s, border-color .2s;
}
.city-link:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--white);
    text-decoration: none;
}

/* ============================================================
   Ad Cards (homepage recent ads + listing page)
   ============================================================ */
.recent-ads { padding: 0 0 50px; }
.recent-ads h2 { font-size: 1.4rem; margin-bottom: 20px; }

.ads-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}

.ad-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    display: block;
    color: var(--text);
    position: relative;
    transition: box-shadow .2s, transform .2s;
}
.ad-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,.1);
    transform: translateY(-2px);
    text-decoration: none;
}
.ad-card.featured { border-color: #f59e0b; background: #fffbeb; }
.ad-card h4 { font-size: .95rem; margin-bottom: 8px; line-height: 1.4; }
.ad-meta { font-size: .8rem; color: var(--muted); }
.badge-featured {
    display: inline-block;
    background: #f59e0b;
    color: var(--white);
    font-size: .7rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    margin-bottom: 8px;
    text-transform: uppercase;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 640px) {
    .hero h1 { font-size: 1.5rem; }
    .auth-box { padding: 24px 16px; }
    .main-nav { display: none; } /* TODO: add hamburger menu */
}

/* ============================================================
   Post Ad Page
   ============================================================ */
.post-ad-section { padding: 40px 0; }
.post-ad-section h1 { font-size: 1.6rem; margin-bottom: 24px; }

.post-ad-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 24px;
    align-items: start;
}
@media (max-width: 900px) {
    .post-ad-layout { grid-template-columns: 1fr; }
}

.form-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 16px;
}
.form-card h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--primary);
    border-bottom: 1px solid var(--border);
    padding-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* List selection UI */
.select-list { display: flex; flex-direction: column; gap: 4px; }
.select-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 11px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    font-size: .9rem;
    transition: background .15s, border-color .15s;
}
.select-item:hover {
    background: #eff6ff;
    border-color: var(--primary);
    color: var(--primary);
}
.select-item.active {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--white);
}
.select-arrow { font-size: 1rem; opacity: .5; }
.credit-badge {
    background: #fef3c7;
    color: #92400e;
    font-size: .72rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 20px;
    margin-left: auto;
    margin-right: 8px;
}
.back-btn {
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 3px 10px;
    font-size: .78rem;
    cursor: pointer;
    color: var(--muted);
    transition: color .15s;
}
.back-btn:hover { color: var(--primary); }

/* Selected breadcrumb bar */
.selected-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: var(--radius);
    padding: 8px 12px;
    font-size: .82rem;
    color: #166534;
    margin-bottom: 4px;
}
.bar-sep { opacity: .5; }

.credit-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: var(--radius);
    padding: 10px 14px;
    font-size: .875rem;
}
.user-balance { color: var(--muted); }
.req { color: var(--danger); }
.char-count { font-size: .78rem; color: var(--muted); }

.image-preview-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.preview-thumb img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

/* Live preview panel */
.post-ad-preview { position: sticky; top: 80px; }
.preview-sticky h4 {
    font-size: .85rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--muted);
    margin-bottom: 10px;
}
.live-ad-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}
.lp-images { display: flex; flex-wrap: wrap; gap: 4px; padding: 10px; }
.lp-img {
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: 4px;
}
.lp-body { padding: 14px; }
.lp-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text);
    line-height: 1.4;
}
.lp-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: .78rem;
    color: var(--muted);
    margin-bottom: 10px;
}
.lp-desc {
    font-size: .85rem;
    color: #374151;
    line-height: 1.6;
    white-space: pre-wrap;
    max-height: 180px;
    overflow-y: auto;
}

/* ============================================================
   Preview Ad Page
   ============================================================ */
.preview-section { padding: 40px 0; }
.preview-header { margin-bottom: 24px; }
.preview-header h1 { font-size: 1.6rem; }
.preview-header p  { color: var(--muted); }

.ad-preview-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 20px;
}
.safety-warning {
    background: #fffbeb;
    border-bottom: 1px solid #fde68a;
    padding: 10px 16px;
    font-size: .85rem;
    color: #92400e;
}
.preview-images { display: flex; gap: 8px; padding: 16px; flex-wrap: wrap; }
.preview-images img {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: var(--radius);
}
.preview-body { padding: 20px; }
.preview-body h2 { font-size: 1.4rem; margin-bottom: 12px; }
.preview-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 16px;
    font-size: .875rem;
    color: var(--muted);
}
.preview-description { font-size: .95rem; line-height: 1.8; color: var(--text); }
.credit-summary {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: var(--radius);
    padding: 12px 16px;
    font-size: .9rem;
    margin-bottom: 20px;
}
.preview-actions { display: flex; gap: 12px; justify-content: flex-end; }
.btn-outline {
    background: transparent;
    border: 2px solid var(--border);
    color: var(--text);
    padding: 10px 20px;
    border-radius: var(--radius);
    font-size: .95rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color .2s;
    text-decoration: none;
    display: inline-block;
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); text-decoration: none; }

/* ============================================================
   Boost Page
   ============================================================ */
.boost-section { padding: 40px 0; }
.boost-header { margin-bottom: 24px; }
.boost-header h1 { font-size: 1.6rem; }
.boost-header p  { color: var(--muted); margin-top: 6px; }

.boost-ad-summary {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-bottom: 24px;
}
.bas-title { font-size: 1rem; font-weight: 700; margin-bottom: 6px; }
.bas-meta  { font-size: .85rem; color: var(--muted); }

.status-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: .75rem;
    font-weight: 700;
}
.status-badge.pending  { background: #fef3c7; color: #92400e; }
.status-badge.active   { background: #d1fae5; color: #065f46; }
.status-badge.rejected { background: #fee2e2; color: #991b1b; }
.status-badge.expired  { background: #f3f4f6; color: #6b7280; }

.boost-options { display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px; }

.boost-card { cursor: pointer; display: block; }
.boost-card input[type="radio"] { display: none; }
.boost-card-inner {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--white);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 20px;
    transition: border-color .2s, background .2s;
}
.boost-card input[type="radio"]:checked + .boost-card-inner {
    border-color: var(--primary);
    background: #eff6ff;
}
.boost-card:hover .boost-card-inner { border-color: #93c5fd; }

.boost-icon { font-size: 1.8rem; flex-shrink: 0; }
.boost-info { flex: 1; }
.boost-info h3 { font-size: 1rem; margin-bottom: 4px; }
.boost-info p  { font-size: .85rem; color: var(--muted); line-height: 1.5; }

.boost-price { text-align: right; flex-shrink: 0; }
.boost-price .price      { font-size: 1.1rem; font-weight: 700; color: var(--primary); }
.boost-price .price.free { color: var(--success); }

.boost-balance {
    font-size: .875rem;
    color: var(--muted);
    margin-bottom: 20px;
}

.boost-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}
@media (max-width: 640px) {
    .boost-card-inner { flex-wrap: wrap; }
    .boost-actions    { flex-direction: column; }
    .boost-actions .btn { width: 100%; text-align: center; }
}

/* ============================================================
   Ad Detail Page
   ============================================================ */
.ad-detail-section { padding: 30px 0 60px; }

.breadcrumb {
    font-size: .82rem;
    color: var(--muted);
    margin-bottom: 20px;
}
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--primary); }

.ad-detail-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 24px;
    align-items: start;
}
@media (max-width: 860px) {
    .ad-detail-layout { grid-template-columns: 1fr; }
}

.badge-featured-bar {
    background: #fef3c7;
    border: 1px solid #fde68a;
    border-radius: var(--radius);
    padding: 8px 14px;
    font-size: .85rem;
    font-weight: 700;
    color: #92400e;
    margin-bottom: 14px;
}

/* Gallery */
.ad-gallery { margin-bottom: 16px; }
.gallery-main img {
    width: 100%;
    max-height: 420px;
    object-fit: contain;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: #f3f4f6;
}
.gallery-thumbs {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
}
.gallery-thumbs .thumb {
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: 6px;
    border: 2px solid var(--border);
    cursor: pointer;
    transition: border-color .2s;
}
.gallery-thumbs .thumb.active,
.gallery-thumbs .thumb:hover { border-color: var(--primary); }

/* Ad card */
.ad-detail-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 16px;
}
.ad-detail-title {
    font-size: 1.5rem;
    line-height: 1.4;
    margin-bottom: 14px;
}
.ad-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: .82rem;
    color: var(--muted);
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}
.ad-price { font-size: 1.1rem; font-weight: 700; color: var(--primary); }
.ad-detail-body {
    font-size: .95rem;
    line-height: 1.9;
    color: var(--text);
    margin-bottom: 20px;
    word-break: break-word;
}

/* Share */
.share-section {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    font-size: .85rem;
    color: var(--muted);
}
.share-btn {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: .78rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    text-decoration: none;
    display: inline-block;
    transition: opacity .2s;
}
.share-btn:hover { opacity: .85; text-decoration: none; }
.share-btn.facebook  { background: #1877f2; color: #fff; }
.share-btn.twitter   { background: #1da1f2; color: #fff; }
.share-btn.whatsapp  { background: #25d366; color: #fff; }
.share-btn.copy      { background: var(--bg); border: 1px solid var(--border); color: var(--text); }

/* Report */
.report-section {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 18px;
}
.report-section summary {
    cursor: pointer;
    font-size: .85rem;
    color: var(--muted);
    user-select: none;
}
.report-form {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 12px;
}
.report-form select {
    flex: 1;
    min-width: 180px;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: .85rem;
}
.report-thanks { font-size: .85rem; color: var(--success); }

/* Sidebar */
.ad-detail-sidebar { display: flex; flex-direction: column; gap: 16px; }

.sidebar-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
}
.sidebar-card h4 {
    font-size: .9rem;
    margin-bottom: 14px;
    color: var(--muted);
    text-transform: uppercase;
    font-size: .75rem;
    letter-spacing: .05em;
}

.poster-info   { display: flex; align-items: center; gap: 12px; }
.poster-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 700;
    flex-shrink: 0;
}
.poster-name  { font-weight: 700; font-size: .95rem; }
.poster-since { font-size: .78rem; color: var(--muted); }
.ad-id-card   { text-align: center; color: var(--muted); }

/* Related ads */
.related-list { display: flex; flex-direction: column; gap: 10px; }
.related-item {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: background .15s;
}
.related-item:hover { background: var(--bg); text-decoration: none; }
.related-title { font-size: .875rem; font-weight: 600; color: var(--text); line-height: 1.4; }
.related-meta  { font-size: .75rem; color: var(--muted); }

/* 404 */
.error-section { min-height: 70vh; display: flex; align-items: center; text-align: center; }
.error-box h1  { font-size: 5rem; color: var(--border); margin-bottom: 10px; }
.error-box p   { color: var(--muted); margin-bottom: 24px; }


/* ============================================================
   Category Page
   ============================================================ */
.category-section { padding: 30px 0 60px; }
.category-header  { margin-bottom: 28px; }
.category-header h1 { font-size: 1.6rem; }
.category-header p  { color: var(--muted); margin-top: 4px; }

.cat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}
.cat-block {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.cat-main-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    background: #f8fafc;
    border-bottom: 1px solid var(--border);
    font-weight: 700;
    font-size: .95rem;
    color: var(--text);
    transition: background .15s;
}
.cat-main-link:hover { background: #eff6ff; text-decoration: none; color: var(--primary); }
.cat-count {
    background: var(--primary);
    color: #fff;
    font-size: .72rem;
    padding: 2px 8px;
    border-radius: 20px;
    font-weight: 600;
}
.subcat-list { padding: 8px 0; }
.subcat-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 7px 16px;
    font-size: .85rem;
    color: var(--text);
    transition: background .15s;
}
.subcat-link:hover { background: var(--bg); text-decoration: none; color: var(--primary); }
.subcat-count { font-size: .75rem; color: var(--muted); }

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--muted);
}
.empty-state p { margin-bottom: 16px; font-size: 1rem; }

/* ============================================================
   Listing Page
   ============================================================ */
.listing-section { padding: 30px 0 60px; }
.listing-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}
.listing-header h1 { font-size: 1.5rem; }
.listing-header p  { color: var(--muted); font-size: .875rem; margin-top: 4px; }

.filter-bar {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 20px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 16px;
}
.filter-bar input {
    padding: 7px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: .875rem;
    width: 130px;
}

.listing-layout {
    display: grid;
    grid-template-columns: 1fr 220px;
    gap: 20px;
    align-items: start;
}
@media (max-width: 768px) {
    .listing-layout { grid-template-columns: 1fr; }
}

/* Ad row */
.ad-row {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 14px;
    margin-bottom: 8px;
    transition: box-shadow .15s, border-color .15s;
    color: var(--text);
}
.ad-row:hover { box-shadow: 0 2px 8px rgba(0,0,0,.08); border-color: #93c5fd; text-decoration: none; }
.ad-row.featured { border-color: #f59e0b; background: #fffdf5; }
.ad-row.group-boosted { border-color: #a78bfa; background: #faf5ff; }

.ad-row-img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}
.ad-row-img.no-img {
    width: 80px;
    height: 80px;
    border-radius: 6px;
    background: var(--bg);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .7rem;
    color: var(--muted);
    flex-shrink: 0;
}
.ad-row-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
}
.ad-row-title {
    font-size: .95rem;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ad-row-meta { font-size: .78rem; color: var(--muted); }
.ad-row-arrow { color: var(--muted); font-size: 1.2rem; flex-shrink: 0; }
.boost-tag {
    font-size: .7rem;
    background: #ede9fe;
    color: #5b21b6;
    padding: 2px 8px;
    border-radius: 20px;
    flex-shrink: 0;
}

/* Group boost section */
.group-boost-section { margin-bottom: 16px; }
.group-boost-label {
    font-size: .78rem;
    color: #5b21b6;
    font-weight: 700;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: .04em;
}

/* Pagination */
.pagination {
    display: flex;
    gap: 6px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 24px;
}
.page-btn {
    padding: 7px 13px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: .85rem;
    color: var(--text);
    background: var(--white);
    transition: background .15s, border-color .15s;
}
.page-btn:hover      { background: var(--bg); text-decoration: none; }
.page-btn.active     { background: var(--primary); border-color: var(--primary); color: #fff; }

/* Sidebar subcategory list */
.subcat-sidebar-list { list-style: none; }
.subcat-sidebar-list li a {
    display: flex;
    justify-content: space-between;
    padding: 8px 10px;
    border-radius: var(--radius);
    font-size: .85rem;
    color: var(--text);
    transition: background .15s;
}
.subcat-sidebar-list li a:hover  { background: var(--bg); text-decoration: none; }
.subcat-sidebar-list li a.active { background: #eff6ff; color: var(--primary); font-weight: 700; }
.subcat-sidebar-list li a span   { color: var(--muted); font-size: .78rem; }

.back-item {
    color: var(--primary);
    font-size: .85rem;
    border-style: dashed;
}

/* ============================================================
   Dashboard
   ============================================================ */
.dashboard-section  { padding: 30px 0 60px; }
.my-ads-section     { padding: 30px 0 60px; }
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}
.dashboard-header h1 { font-size: 1.6rem; }
.dashboard-header p  { color: var(--muted); font-size: .875rem; margin-top: 4px; }

.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}
.stat-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
}
.stat-value { font-size: 1.8rem; font-weight: 700; color: var(--primary); }
.stat-label { font-size: .8rem; color: var(--muted); margin-top: 4px; }

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 20px;
    align-items: start;
}
@media (max-width: 860px) {
    .dashboard-grid { grid-template-columns: 1fr; }
}

.dash-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
}
.dash-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}
.dash-card-header h3 { font-size: 1rem; }
.dash-card-header a  { font-size: .85rem; }

.dash-table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.dash-table th {
    text-align: left;
    padding: 8px 10px;
    border-bottom: 2px solid var(--border);
    font-size: .78rem;
    text-transform: uppercase;
    color: var(--muted);
}
.dash-table td { padding: 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.dash-table tr:last-child td { border-bottom: none; }
.ad-title-link { color: var(--text); font-weight: 600; }
.ad-title-link:hover { color: var(--primary); }

.action-btns { display: flex; gap: 6px; }

.btn-sm {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: .75rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid var(--border);
    background: var(--white);
    color: var(--text);
    text-decoration: none;
    transition: background .15s;
}
.btn-sm:hover  { background: var(--bg); text-decoration: none; }
.btn-sm.boost  { border-color: #f59e0b; color: #92400e; background: #fffbeb; }
.btn-sm.danger { border-color: #fecaca; color: var(--danger); background: #fef2f2; }

.package-name {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 12px;
}
.package-features { list-style: none; }
.package-features li { padding: 5px 0; font-size: .875rem; border-bottom: 1px solid var(--border); }
.package-features li:last-child { border-bottom: none; }

.account-info-list { list-style: none; }
.account-info-list li {
    display: flex;
    justify-content: space-between;
    padding: 7px 0;
    font-size: .875rem;
    border-bottom: 1px solid var(--border);
}
.account-info-list li:last-child { border-bottom: none; }
.account-info-list li span { color: var(--muted); }

/* Status Tabs */
.status-tabs {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border);
    padding-bottom: 0;
}
.status-tab {
    padding: 8px 16px;
    font-size: .875rem;
    color: var(--muted);
    border-radius: var(--radius) var(--radius) 0 0;
    transition: background .15s;
    display: flex;
    align-items: center;
    gap: 6px;
}
.status-tab:hover { background: var(--bg); text-decoration: none; color: var(--text); }
.status-tab.active { background: var(--white); border: 2px solid var(--border); border-bottom: 2px solid var(--white); color: var(--primary); font-weight: 700; margin-bottom: -2px; }
.tab-count {
    background: var(--bg);
    border-radius: 20px;
    padding: 1px 7px;
    font-size: .72rem;
    color: var(--muted);
}

/* My Ads List */
.my-ads-list { display: flex; flex-direction: column; gap: 10px; }
.my-ad-row {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 14px;
}
.my-ad-thumb img,
.my-ad-thumb .no-img-sm {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}
.no-img-sm {
    background: var(--bg);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .7rem;
    color: var(--muted);
}
.my-ad-info    { flex: 1; min-width: 0; }
.my-ad-title {
    font-weight: 700;
    font-size: .95rem;
    color: var(--text);
    display: block;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.my-ad-title:hover { color: var(--primary); }
.my-ad-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: .78rem;
    color: var(--muted);
}
.my-ad-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-shrink: 0;
}

/* Edit Ad */
.edit-meta-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 16px;
    font-size: .85rem;
    margin-bottom: 20px;
}

.existing-images-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}
.existing-img-item {
    position: relative;
    text-align: center;
}
.existing-img-item img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: var(--radius);
    border: 2px solid var(--border);
    display: block;
}
.primary-badge {
    display: block;
    font-size: .68rem;
    background: var(--primary);
    color: #fff;
    padding: 2px 6px;
    border-radius: 4px;
    margin-top: 4px;
}
.delete-img-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: .75rem;
    color: var(--danger);
    cursor: pointer;
    margin-top: 4px;
}

/* ============================================================
   2FA Setup & Admin Login
   ============================================================ */
.twofa-status {
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: .9rem;
    margin-bottom: 8px;
}
.twofa-status.enabled  { background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; }
.twofa-status.disabled { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }

.qr-section { margin-top: 8px; }

.setup-step {
    font-size: .875rem;
    margin: 12px 0 6px;
    color: var(--text);
}
.step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: var(--primary);
    color: #fff;
    border-radius: 50%;
    font-size: .75rem;
    font-weight: 700;
    margin-right: 8px;
}

.secret-box {
    font-family: monospace;
    font-size: .85rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 14px;
    word-break: break-all;
    letter-spacing: .08em;
    color: var(--text);
    user-select: all;
}




