/* ============================================================
   style.css  —  ppickings.com
   Warm, clean, trustworthy local marketplace
   ============================================================ */

/* ── Reset & base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    /* Primary */
    --blue:        #2563eb;
    --blue-dark:   #1d4ed8;
    --blue-light:  #eff6ff;

    /* Warm accent */
    --accent:      #f97316;
    --accent-dark: #ea580c;

    /* Greens & reds */
    --green:       #16a34a;
    --green-light: #f0fdf4;
    --red:         #dc2626;

    /* Warm neutrals — light theme (default) */
    --gray-50:     #fafaf9;
    --gray-100:    #f5f5f4;
    --gray-200:    #e7e5e4;
    --gray-300:    #d6d3d1;
    --gray-400:    #a8a29e;
    --gray-500:    #78716c;
    --gray-600:    #57534e;
    --gray-700:    #44403c;
    --gray-800:    #292524;
    --white:       #ffffff;

    /* Layout */
    --radius:      10px;
    --radius-lg:   14px;
    --shadow:      0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
    --shadow-md:   0 4px 12px rgba(0,0,0,.08);
    --shadow-lg:   0 8px 24px rgba(0,0,0,.1);
    --transition:  .18s ease;
}

/* ── Dark theme ──────────────────────────────────────────── */
[data-theme="dark"] {
    --blue:        #3b82f6;
    --blue-dark:   #2563eb;
    --blue-light:  #1e293b;

    --accent:      #fb923c;
    --accent-dark: #f97316;

    --green:       #22c55e;
    --green-light: #14532d;
    --red:         #ef4444;

    --gray-50:     #0c0a09;
    --gray-100:    #1c1917;
    --gray-200:    #292524;
    --gray-300:    #44403c;
    --gray-400:    #78716c;
    --gray-500:    #a8a29e;
    --gray-600:    #d6d3d1;
    --gray-700:    #e7e5e4;
    --gray-800:    #fafaf9;
    --white:       #1c1917;

    --shadow:      0 1px 3px rgba(0,0,0,.3), 0 1px 2px rgba(0,0,0,.2);
    --shadow-md:   0 4px 12px rgba(0,0,0,.35);
    --shadow-lg:   0 8px 24px rgba(0,0,0,.4);

    color-scheme: dark;
}

/* System auto: apply dark when OS is dark AND user hasn't picked light */
@media (prefers-color-scheme: dark) {
    [data-theme="auto"] {
        --blue:        #3b82f6;
        --blue-dark:   #2563eb;
        --blue-light:  #1e293b;

        --accent:      #fb923c;
        --accent-dark: #f97316;

        --green:       #22c55e;
        --green-light: #14532d;
        --red:         #ef4444;

        --gray-50:     #0c0a09;
        --gray-100:    #1c1917;
        --gray-200:    #292524;
        --gray-300:    #44403c;
        --gray-400:    #78716c;
        --gray-500:    #a8a29e;
        --gray-600:    #d6d3d1;
        --gray-700:    #e7e5e4;
        --gray-800:    #fafaf9;
        --white:       #1c1917;

        --shadow:      0 1px 3px rgba(0,0,0,.3), 0 1px 2px rgba(0,0,0,.2);
        --shadow-md:   0 4px 12px rgba(0,0,0,.35);
        --shadow-lg:   0 8px 24px rgba(0,0,0,.4);

        color-scheme: dark;
    }
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
                 'Helvetica Neue', Arial, sans-serif;
    color: var(--gray-800);
    background: var(--gray-50);
    line-height: 1.6;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}

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

img { max-width: 100%; display: block; }

/* ── Layout helpers ───────────────────────────────────────── */
.container { max-width: 1100px; margin: 0 auto; padding: 2rem 1.25rem; }
.narrow    { max-width: 480px; }

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    padding: .6rem 1.25rem;
    border-radius: var(--radius);
    font-size: .95rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all var(--transition);
    text-decoration: none;
    line-height: 1.4;
}
.btn:hover { text-decoration: none; }
.btn-primary       { background: var(--blue); color: var(--white); }
.btn-primary:hover { background: var(--blue-dark); color: var(--white); box-shadow: var(--shadow-md); }
.btn-accent        { background: var(--accent); color: var(--white); }
.btn-accent:hover  { background: var(--accent-dark); color: var(--white); box-shadow: var(--shadow-md); }
.btn-outline       { background: transparent; color: var(--gray-700); border: 1.5px solid var(--gray-300); }
.btn-outline:hover { border-color: var(--blue); color: var(--blue); background: var(--blue-light); }
.btn-small         { padding: .4rem .9rem; font-size: .85rem; }
.btn-lg            { padding: .8rem 1.8rem; font-size: 1.05rem; border-radius: var(--radius-lg); }

/* ── Site header ──────────────────────────────────────────── */
.site-header {
    background: var(--white);
    color: var(--gray-800);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    height: 60px;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--gray-200);
    transition: background var(--transition), border-color var(--transition);
}
.site-header .logo {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--gray-800);
    text-decoration: none;
    letter-spacing: -.02em;
}
.logo-dot { color: var(--blue); }
.site-header nav { display: flex; align-items: center; gap: 1rem; }
.site-header nav a {
    color: var(--gray-600);
    font-size: .9rem;
    font-weight: 500;
    transition: color var(--transition);
    white-space: nowrap;
}
.site-header nav a:hover { color: var(--gray-800); text-decoration: none; }
.site-header nav a.active { color: var(--blue); font-weight: 600; }
.site-header nav a.btn { color: var(--white); }
.site-header nav a.btn:hover { color: var(--white); }
.nav-greeting { color: var(--gray-400); font-size: .9rem; }

/* ── Alerts ───────────────────────────────────────────────── */
.alert { border-radius: var(--radius); padding: 1rem 1.25rem; margin-bottom: 1.25rem; }
.alert p { margin-bottom: .25rem; }
.alert p:last-child { margin-bottom: 0; }
.alert-error   { background: #fef2f2; border: 1px solid #fecaca; color: var(--red); }
.alert-success { background: #f0fdf4; border: 1px solid #bbf7d0; color: var(--green); }

/* ── Forms ────────────────────────────────────────────────── */
.form-group { margin-bottom: 1.25rem; }
.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: .4rem;
    font-size: .95rem;
}
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: .65rem 1rem;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 1rem;
    background: var(--white);
    transition: border-color var(--transition), box-shadow var(--transition);
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
.form-group small { display: block; color: var(--gray-400); margin-top: .3rem; font-size: .85rem; }
.req      { color: var(--red); }
.optional { color: var(--gray-400); font-weight: 400; font-size: .85em; }
.form-footer { margin-top: 1.25rem; text-align: center; color: var(--gray-600); font-size: .9rem; }

/* ── Cards ────────────────────────────────────────────────── */
.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}
.card h2 { margin-bottom: 1rem; font-size: 1.15rem; }

/* ── Profile page ─────────────────────────────────────────── */
.profile-hero {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 1.75rem;
    margin-bottom: 1.5rem;
}
.avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--blue);
    color: var(--white);
    font-size: 2rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.profile-info h1 { font-size: 1.5rem; margin-bottom: .2rem; }
.profile-info .location { color: var(--gray-600); font-size: .95rem; margin-bottom: .15rem; }
.profile-info .member-since { color: var(--gray-400); font-size: .85rem; }

.stats-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.stat-box {
    flex: 1;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 1rem;
    text-align: center;
}
.stat-number { display: block; font-size: 2rem; font-weight: 700; color: var(--blue); }
.stat-label  { font-size: .85rem; color: var(--gray-600); }

.action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
}
.action-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .4rem;
    padding: 1.25rem .75rem;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: var(--gray-800);
    font-weight: 600;
    font-size: .9rem;
    transition: all var(--transition);
    text-align: center;
}
.action-card:hover:not(.disabled) { border-color: var(--blue); background: var(--blue-light); text-decoration: none; }
.action-card.disabled { opacity: .5; cursor: not-allowed; }
.action-card small { font-weight: 400; color: var(--gray-400); font-size: .8rem; }
.action-icon { font-size: 1.75rem; }

.detail-table { width: 100%; border-collapse: collapse; }
.detail-table th, .detail-table td { padding: .6rem .75rem; text-align: left; border-bottom: 1px solid var(--gray-100); font-size: .95rem; }
.detail-table th { color: var(--gray-600); font-weight: 600; width: 35%; }

/* ── Hero section ─────────────────────────────────────────── */
.hero {
    background: var(--white);
    text-align: center;
    padding: 3.5rem 1.25rem 2.5rem;
    border-bottom: 1px solid var(--gray-200);
}
.hero h1 {
    font-size: 2.6rem;
    font-weight: 800;
    letter-spacing: -.03em;
    color: var(--gray-800);
    margin-bottom: .5rem;
    line-height: 1.15;
}
.hero-sub {
    font-size: 1.1rem;
    color: var(--gray-500);
    margin-bottom: 1.75rem;
    max-width: 520px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}
.hero-search {
    max-width: 580px;
    margin: 0 auto 1.5rem;
    position: relative;
}
.hero-search form {
    display: flex;
    gap: 0;
    box-shadow: var(--shadow-md);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1.5px solid var(--gray-200);
    transition: border-color var(--transition);
}
.hero-search form:focus-within {
    border-color: var(--blue);
    box-shadow: var(--shadow-md), 0 0 0 3px rgba(37,99,235,.1);
}
.hero-search input {
    flex: 1;
    padding: .85rem 1.15rem;
    border: none;
    font-size: 1rem;
    outline: none;
    background: var(--white);
}
.hero-search button {
    padding: .85rem 1.5rem;
    background: var(--blue);
    color: var(--white);
    border: none;
    font-weight: 600;
    font-size: .95rem;
    cursor: pointer;
    transition: background var(--transition);
}
.hero-search button:hover { background: var(--blue-dark); }
.hero-cta { margin-top: .5rem; }
.hero-login-link { color: var(--gray-500); font-size: .9rem; }
.hero-login-link:hover { color: var(--blue); }

/* Hero trust strip — single subtle line */
.hero-trust {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 1.25rem;
    font-size: .85rem;
    color: var(--gray-400);
}
.hero-trust span { display: inline-flex; align-items: center; gap: .3rem; }

/* ── Compact listing row (homepage) ───────────────────────── */
.listing-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: .65rem;
}
.listing-thumb-card {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: box-shadow var(--transition), transform var(--transition);
    display: flex;
    flex-direction: column;
}
.listing-thumb-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    text-decoration: none;
}
.listing-thumb-card img {
    width: 100%;
    height: 110px;
    object-fit: cover;
    background: var(--gray-100);
}
.listing-thumb-info {
    padding: .5rem .6rem;
    display: flex;
    flex-direction: column;
    gap: .1rem;
}
.listing-thumb-price {
    font-size: .95rem;
    font-weight: 800;
    color: var(--gray-800);
}
.listing-thumb-title {
    font-size: .78rem;
    font-weight: 500;
    color: var(--gray-600);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.listing-thumb-loc {
    font-size: .7rem;
    color: var(--gray-400);
}

@media (max-width: 600px) {
    .listing-row { grid-template-columns: repeat(3, 1fr); gap: .5rem; }
    .listing-thumb-card img { height: 85px; }
    .listing-thumb-info { padding: .4rem .5rem; }
    .listing-thumb-price { font-size: .82rem; }
    .listing-thumb-title { font-size: .72rem; }
}

/* ── Listing grid (home + browse) ────────────────────────── */
.listing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
}
.listing-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: box-shadow var(--transition), transform var(--transition);
    display: flex;
    flex-direction: column;
}
.listing-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
    text-decoration: none;
}
.listing-card-img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    background: var(--gray-100);
}
.listing-card-body {
    padding: .9rem 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.listing-card-title {
    font-weight: 700;
    font-size: .95rem;
    color: var(--gray-800);
    margin-bottom: .3rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.listing-card-price {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--blue);
    margin-bottom: .25rem;
}
.listing-card-meta {
    font-size: .8rem;
    color: var(--gray-400);
    margin-top: auto;
}

/* ── Category grid ────────────────────────────────────────── */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: .75rem;
    margin-bottom: 1rem;
}
.category-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .4rem;
    padding: 1.1rem .5rem;
    background: var(--white);
    border-radius: var(--radius-lg);
    border: 1.5px solid var(--gray-200);
    text-decoration: none;
    color: var(--gray-700);
    font-weight: 600;
    font-size: .85rem;
    transition: all var(--transition);
}
.category-card:hover {
    border-color: var(--blue);
    background: var(--blue-light);
    color: var(--blue);
    text-decoration: none;
}
.cat-icon { font-size: 1.75rem; }
.coming-soon-note { color: var(--gray-400); font-size: .9rem; margin-top: .5rem; }

/* ── How it works ─────────────────────────────────────────── */
.how-it-works {
    background: var(--white);
    padding: 3rem 1.25rem;
    border-top: 1px solid var(--gray-200);
    border-bottom: 1px solid var(--gray-200);
}
.how-it-works h2 { text-align: center; margin-bottom: 2rem; font-size: 1.5rem; font-weight: 700; }
.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 2rem;
    max-width: 860px;
    margin: 0 auto;
    text-align: center;
}
.step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--blue-light);
    color: var(--blue);
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: .75rem;
    border: 2px solid var(--blue);
}
.step h3 { margin-bottom: .4rem; font-size: 1rem; color: var(--gray-800); }
.step p  { color: var(--gray-500); font-size: .9rem; line-height: 1.6; }

/* ── Section headings ─────────────────────────────────────── */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}
.section-header h2 {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--gray-800);
}
.section-header a {
    font-size: .9rem;
    font-weight: 600;
    color: var(--blue);
}

/* ── Footer ───────────────────────────────────────────────── */
.site-footer {
    background: #292524;
    color: #a8a29e;
    text-align: center;
    padding: 2rem 1.25rem;
    font-size: .88rem;
}
[data-theme="dark"] .site-footer,
[data-theme="auto"] .site-footer { background: #0c0a09; }
.footer-inner { display: flex; flex-direction: column; align-items: center; gap: .35rem; }
.footer-logo { font-size: 1.1rem; font-weight: 700; color: #fafaf9; }
.footer-tagline { color: #a8a29e; font-size: .88rem; }
.footer-copy { color: #78716c; font-size: .78rem; margin-top: .15rem; }

/* ── Badges ───────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    background: var(--gray-100);
    color: var(--gray-600);
    border: 1px solid var(--gray-200);
    border-radius: 999px;
    padding: .25rem .75rem;
    font-size: .82rem;
    font-weight: 600;
}
.hero-badges {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    justify-content: center;
    margin-bottom: 1.75rem;
}
.badge-verified-pickings {
    display: inline-flex;
    align-items: center;
    gap: .28rem;
    background: #05966922;
    border: 1px solid #059669;
    border-radius: 999px;
    padding: .18rem .65rem;
    font-size: .75rem;
    font-weight: 700;
    color: #34d399;
    text-decoration: none;
    white-space: nowrap;
}
.badge-verified-pickings:hover { background: #05966940; }
.badge-vp-inline {
    display: inline-flex;
    align-items: center;
    gap: .22rem;
    background: #05966922;
    border: 1px solid #059669;
    border-radius: 999px;
    padding: .1rem .45rem;
    font-size: .7rem;
    font-weight: 700;
    color: #34d399;
    vertical-align: middle;
    margin-left: .25rem;
}
.free-badge {
    background: var(--green-light);
    color: var(--green);
    font-size: .72rem;
    font-weight: 700;
    padding: .2rem .55rem;
    border-radius: 999px;
    letter-spacing: .02em;
    text-transform: uppercase;
}

/* ── Why bar (kept for compatibility) ────────────────────── */
.why-bar {
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    padding: 1.25rem 0;
}
.why-grid {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}
.why-item { text-align: center; }
.why-item strong { display: block; font-size: .9rem; color: var(--gray-600); }
.why-fee { display: block; font-size: 1.1rem; font-weight: 700; margin-top: .15rem; }
.why-fee.free { color: var(--green); }
.why-fee.paid { color: var(--red); }
.why-divider { color: var(--gray-300); font-size: .8rem; font-weight: 600; }

/* ── Manifesto (kept for compatibility) ───────────────────── */
.manifesto {
    background: var(--gray-800);
    color: var(--gray-300);
    padding: 3rem 1.25rem;
}
.manifesto h2 { color: var(--white); margin-bottom: 1rem; font-size: 1.5rem; }
.manifesto p  { max-width: 600px; margin: 0 auto; line-height: 1.8; }

/* ── Page heading ─────────────────────────────────────────── */
.page-sub { color: var(--green); font-weight: 600; margin-bottom: 1.5rem; font-size: .95rem; }

/* ── Theme toggle button ──────────────────────────────────── */
.theme-toggle {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0;
    background: var(--gray-100);
    border: 1.5px solid var(--gray-200);
    border-radius: 999px;
    padding: 2px;
    cursor: pointer;
    flex-shrink: 0;
}
.theme-toggle button {
    background: none;
    border: none;
    cursor: pointer;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .85rem;
    line-height: 1;
    transition: all var(--transition);
    color: var(--gray-400);
    position: relative;
    z-index: 1;
}
.theme-toggle button.active {
    background: var(--white);
    color: var(--gray-800);
    box-shadow: 0 1px 3px rgba(0,0,0,.1);
}
[data-theme="dark"] .theme-toggle button.active,
[data-theme="auto"] .theme-toggle button.active {
    background: var(--gray-300);
}

/* Smooth body transition */
body, .site-header, .hero, .how-it-works, .card, .chat-panel {
    transition: background var(--transition), color var(--transition), border-color var(--transition);
}

/* Dark mode: fix btn-primary text not flipping */
[data-theme="dark"] .btn-primary,
[data-theme="dark"] .btn-accent { color: #fff; }
@media (prefers-color-scheme: dark) {
    [data-theme="auto"] .btn-primary,
    [data-theme="auto"] .btn-accent { color: #fff; }
}

/* Dark mode: fix hero search input */
[data-theme="dark"] .hero-search input,
[data-theme="dark"] .hero-search form { background: var(--gray-100); color: var(--gray-800); border-color: var(--gray-300); }
@media (prefers-color-scheme: dark) {
    [data-theme="auto"] .hero-search input,
    [data-theme="auto"] .hero-search form { background: var(--gray-100); color: var(--gray-800); border-color: var(--gray-300); }
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 768px) {
    .site-header nav { gap: .7rem; }
    .site-header nav a { font-size: .82rem; }
    .hero h1 { font-size: 1.9rem; }
    .listing-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
}
@media (max-width: 600px) {
    .hero h1       { font-size: 1.65rem; }
    .hero-search form { flex-direction: column; border-radius: var(--radius); }
    .hero-search button { border-radius: 0 0 var(--radius) var(--radius); }
    .profile-hero  { flex-direction: column; text-align: center; }
    .stats-row     { flex-direction: column; }
    .narrow        { padding-left: 1rem; padding-right: 1rem; }
    .hero-trust    { flex-direction: column; gap: .35rem; }
    .listing-grid  { grid-template-columns: 1fr 1fr; gap: .6rem; }
    .listing-card-img { height: 140px; }
    .theme-toggle button { width: 24px; height: 24px; font-size: .75rem; }
}
