/* =====================================================
   Mobile-first stylesheet
   Works well on ~360px phones up to desktop.
   No external resources – everything inlined for speed.
   ===================================================== */

:root {
    --primary:   #c2185b;
    --primary-d: #8c0032;
    --accent:    #ff9800;
    --bg:        #faf6f2;
    --card:      #ffffff;
    --text:      #1b1b1b;
    --muted:     #6b6b6b;
    --border:    #e6e1da;
    --success:   #2e7d32;
    --danger:    #c62828;
    --radius:    10px;
    --shadow:    0 1px 3px rgba(0, 0, 0, .06), 0 4px 12px rgba(0, 0, 0, .04);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                 "Helvetica Neue", Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
    line-height: 1.5;
    -webkit-text-size-adjust: 100%;
}

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

/* ---- Top bar ---- */
.topbar {
    background: var(--primary);
    color: #fff;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .08);
}
.topbar .brand {
    color: #fff;
    font-weight: 700;
    font-size: 18px;
    letter-spacing: .3px;
}
.topbar a.btn-sm { color: #fff; }
.topbar .menu-toggle {
    background: transparent;
    border: 0;
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    padding: 4px 8px;
}

/* ---- Side/mobile menu ---- */
.menu {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, .5);
    z-index: 20;
}
.menu.open { display: block; }
.menu-inner {
    background: #fff;
    width: 80%;
    max-width: 300px;
    height: 100%;
    padding: 20px;
    box-shadow: 2px 0 10px rgba(0, 0, 0, .2);
    overflow-y: auto;
}
.menu-inner a {
    display: block;
    padding: 12px 6px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    font-weight: 500;
}
.menu-inner a:hover { background: var(--bg); text-decoration: none; }
.menu-inner .wallet-pill {
    background: var(--primary);
    color: #fff;
    padding: 8px 12px;
    border-radius: 20px;
    display: inline-block;
    margin-bottom: 10px;
}

/* ---- Container ---- */
.container {
    max-width: 720px;
    margin: 0 auto;
    padding: 14px;
}
.container-wide { max-width: 1100px; }

/* ---- Cards ---- */
.card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 14px;
    margin-bottom: 14px;
}

/* ---- Post card ---- */
.post-card .post-image {
    width: 100%;
    max-height: 320px;
    object-fit: cover;
    border-radius: var(--radius);
    margin-bottom: 10px;
    background: #eee;
}
.post-card h3 {
    margin: 4px 0 6px;
    font-size: 17px;
}
.post-meta {
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 8px;
}
.post-price {
    font-weight: 700;
    color: var(--primary);
    font-size: 17px;
}
.post-card p {
    margin: 10px 0;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* ---- Forms ---- */
.form-group { margin-bottom: 14px; }
label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
    font-size: 14px;
}
input[type=text], input[type=tel], input[type=password],
input[type=number], input[type=email], textarea, select {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    background: #fff;
    color: var(--text);
}
input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(194, 24, 91, .12);
}
textarea { resize: vertical; min-height: 90px; }

/* ---- Buttons ---- */
.btn, button {
    display: inline-block;
    padding: 11px 18px;
    background: var(--primary);
    color: #fff;
    border: 0;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: background .15s ease;
}
.btn:hover, button:hover { background: var(--primary-d); text-decoration: none; color: #fff; }
.btn-block { display: block; width: 100%; }
.btn-secondary { background: #555; }
.btn-secondary:hover { background: #333; }
.btn-accent { background: var(--accent); color: #222; }
.btn-danger { background: var(--danger); }
.btn-sm { padding: 7px 12px; font-size: 13px; }
.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
}
.btn-outline:hover { background: var(--primary); color: #fff; }

/* ---- Alerts ---- */
.alert {
    padding: 11px 14px;
    border-radius: 8px;
    margin-bottom: 14px;
    font-size: 14px;
}
.alert-error   { background: #fdecea; color: var(--danger); border-left: 3px solid var(--danger); }
.alert-success { background: #e8f5e9; color: var(--success); border-left: 3px solid var(--success); }
.alert-info    { background: #e3f2fd; color: #1565c0; border-left: 3px solid #1565c0; }

/* ---- Comments ---- */
.comment {
    border-top: 1px solid var(--border);
    padding: 10px 0;
}
.comment:first-child { border-top: 0; }
.comment-author {
    font-weight: 600;
    font-size: 13px;
    color: var(--primary);
}
.comment-time {
    font-size: 12px;
    color: var(--muted);
    margin-left: 6px;
}
.comment-body {
    margin: 4px 0 0;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* ---- Tables (admin) ---- */
.table-wrap { overflow-x: auto; }
table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    font-size: 14px;
}
th, td {
    padding: 9px 10px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: top;
}
th { background: #f4efe9; font-weight: 600; }
tr:hover td { background: #fafafa; }

/* ---- Badges ---- */
.badge {
    display: inline-block;
    padding: 2px 8px;
    font-size: 11px;
    border-radius: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .3px;
}
.badge-pending  { background: #fff3cd; color: #8a6d3b; }
.badge-paid     { background: #d4edda; color: #155724; }
.badge-complete { background: #cce5ff; color: #004085; }
.badge-rejected { background: #f8d7da; color: #721c24; }

/* ---- Misc utilities ---- */
.text-muted { color: var(--muted); }
.text-center { text-align: center; }
.text-right  { text-align: right; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 6px; }
.mt-2 { margin-top: 12px; }
.mt-3 { margin-top: 18px; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 6px; }
.mb-2 { margin-bottom: 12px; }
.hr {
    border: 0;
    border-top: 1px solid var(--border);
    margin: 14px 0;
}
.flex-between { display: flex; justify-content: space-between; align-items: center; gap: 10px; }

/* ---- Empty states ---- */
.empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--muted);
}
.empty h3 { margin: 0 0 8px; color: var(--text); }

/* ---- Bottom spacing so sticky elements don't overlap last content ---- */
footer.site-footer {
    text-align: center;
    color: var(--muted);
    font-size: 12px;
    padding: 20px 14px 40px;
}

/* ---- Small adjustments for narrow phones ---- */
@media (max-width: 380px) {
    body { font-size: 14px; }
    .container { padding: 10px; }
    .card { padding: 12px; }
    .btn, button { padding: 10px 14px; font-size: 14px; }
}
