:root {
    --bg-primary: #0f1117;
    --bg-secondary: #1a1d2e;
    --bg-card: #1e2235;
    --bg-input: #252a3a;
    --border: #2d3348;
    --text-primary: #e8eaed;
    --text-secondary: #9aa0b2;
    --primary: #f0b90b;
    --primary-hover: #d4a50a;
    --success: #00c853;
    --danger: #ff1744;
    --info: #2196f3;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body { background: var(--bg-primary); color: var(--text-primary); font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; line-height: 1.6; min-height: 100vh; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); }
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* Header */
.header { background: var(--bg-secondary); border-bottom: 1px solid var(--border); padding: 12px 0; position: sticky; top: 0; z-index: 100; }
.header .container { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.logo { font-size: 1.4em; font-weight: bold; color: var(--primary); white-space: nowrap; }
.logo a { color: var(--primary); }
.nav-links { display: flex; list-style: none; gap: 15px; flex-wrap: wrap; align-items: center; }
.nav-links a { color: var(--text-secondary); font-size: 0.9em; padding: 5px 8px; border-radius: 6px; transition: all 0.2s; }
.nav-links a:hover, .nav-links a.active { color: var(--primary); background: rgba(240,185,11,0.1); }

/* Search Bar */
.search-bar { background: var(--bg-secondary); border-bottom: 1px solid var(--border); padding: 20px 0; }
.search-form { display: flex; gap: 10px; max-width: 800px; margin: 0 auto; }
.search-form input, .search-form select { background: var(--bg-input); border: 1px solid var(--border); color: var(--text-primary); padding: 12px 16px; border-radius: 8px; font-size: 1em; }
.search-form input { flex: 1; }
.search-form select { min-width: 160px; }

/* Buttons */
.btn { display: inline-block; padding: 10px 20px; border-radius: 8px; font-weight: 600; font-size: 0.95em; cursor: pointer; border: none; transition: all 0.2s; text-align: center; }
.btn-primary { background: var(--primary); color: #000; }
.btn-primary:hover { background: var(--primary-hover); color: #000; }
.btn-secondary { background: var(--bg-input); color: var(--text-primary); border: 1px solid var(--border); }
.btn-secondary:hover { border-color: var(--primary); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-success { background: var(--success); color: #000; }
.btn-sm { padding: 6px 12px; font-size: 0.85em; }
.btn-block { display: block; width: 100%; }

/* Forms */
.form-control { width: 100%; padding: 12px 16px; background: var(--bg-input); border: 1px solid var(--border); color: var(--text-primary); border-radius: 8px; font-size: 1em; transition: border-color 0.2s; }
.form-control:focus { outline: none; border-color: var(--primary); }
.form-group { margin-bottom: 15px; }
.form-group label { display: block; margin-bottom: 6px; color: var(--text-secondary); font-size: 0.9em; font-weight: 500; }
select.form-control { appearance: auto; }
textarea.form-control { resize: vertical; min-height: 120px; }

/* Cards */
.card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; transition: transform 0.2s, box-shadow 0.2s; }
.card:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(0,0,0,0.3); }
.card-body { padding: 15px; }

/* Category Grid */
.category-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 15px; margin: 30px 0; }
.category-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 25px 15px; text-align: center; transition: all 0.2s; cursor: pointer; }
.category-card:hover { border-color: var(--primary); background: rgba(240,185,11,0.05); transform: translateY(-2px); }
.category-card .icon { font-size: 2.5em; margin-bottom: 10px; }
.category-card .name { font-weight: 600; color: var(--text-primary); }
.category-card .count { color: var(--text-secondary); font-size: 0.85em; margin-top: 4px; }

/* Listing Grid */
.listing-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; margin: 20px 0; }
.listing-card .image { width: 100%; height: 200px; object-fit: cover; background: var(--bg-input); }
.listing-card .card-body { padding: 12px; }
.listing-card .title { font-weight: 600; color: var(--text-primary); margin-bottom: 5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 0.95em; }
.listing-card .price { color: var(--primary); font-weight: bold; font-size: 1.1em; margin-bottom: 5px; }
.listing-card .meta { color: var(--text-secondary); font-size: 0.8em; display: flex; justify-content: space-between; }
.listing-card .category-tag { display: inline-block; background: rgba(240,185,11,0.1); color: var(--primary); padding: 2px 8px; border-radius: 4px; font-size: 0.75em; margin-bottom: 5px; }
.listing-card .no-image { width: 100%; height: 200px; background: var(--bg-input); display: flex; align-items: center; justify-content: center; color: var(--text-secondary); font-size: 0.9em; }

/* Listing Detail */
.listing-detail { display: grid; grid-template-columns: 1fr 350px; gap: 30px; margin: 30px 0; }
.listing-gallery img { width: 100%; border-radius: 12px; margin-bottom: 10px; max-height: 500px; object-fit: contain; background: var(--bg-input); }
.gallery-thumbs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 15px; }
.gallery-thumbs img { width: 80px; height: 80px; object-fit: cover; border-radius: 8px; border: 2px solid var(--border); cursor: pointer; }
.gallery-thumbs img:hover, .gallery-thumbs img.active { border-color: var(--primary); }
.listing-sidebar { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 25px; height: fit-content; position: sticky; top: 80px; }
.listing-sidebar .price { font-size: 1.8em; color: var(--primary); font-weight: bold; margin-bottom: 15px; }
.listing-info-row { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 0.9em; }
.listing-info-row .label { color: var(--text-secondary); }

/* Alerts */
.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 15px; font-size: 0.9em; }
.alert-success { background: rgba(0,200,83,0.1); border: 1px solid rgba(0,200,83,0.3); color: var(--success); }
.alert-danger { background: rgba(255,23,68,0.1); border: 1px solid rgba(255,23,68,0.3); color: var(--danger); }
.alert-info { background: rgba(33,150,243,0.1); border: 1px solid rgba(33,150,243,0.3); color: var(--info); }

/* Table */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 12px 15px; text-align: left; border-bottom: 1px solid var(--border); }
.table th { color: var(--text-secondary); font-size: 0.85em; font-weight: 600; text-transform: uppercase; }
.table tr:hover { background: rgba(240,185,11,0.03); }

/* Pagination */
.pagination { display: flex; gap: 5px; justify-content: center; margin: 30px 0; }
.pagination a, .pagination span { padding: 8px 14px; border-radius: 6px; color: var(--text-secondary); background: var(--bg-card); border: 1px solid var(--border); font-size: 0.9em; }
.pagination a:hover { border-color: var(--primary); color: var(--primary); }
.pagination .active { background: var(--primary); color: #000; border-color: var(--primary); }

/* Footer */
.footer { background: var(--bg-secondary); border-top: 1px solid var(--border); padding: 30px 0; margin-top: 50px; color: var(--text-secondary); font-size: 0.85em; }
.footer .container { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 20px; }

/* Price Badge */
.price-badge { display: inline-block; background: var(--primary); color: #000; padding: 3px 10px; border-radius: 6px; font-weight: bold; font-size: 0.9em; }
.price-free { background: var(--success); }

/* Auth Pages */
.auth-container { max-width: 420px; margin: 60px auto; }
.auth-box { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 35px; }
.auth-box h2 { text-align: center; margin-bottom: 25px; color: var(--primary); }
.auth-box .footer-link { text-align: center; margin-top: 20px; color: var(--text-secondary); }

/* Responsive */
@media (max-width: 768px) {
    .listing-detail { grid-template-columns: 1fr; }
    .listing-sidebar { position: static; }
    .header .container { flex-direction: column; }
    .search-form { flex-direction: column; }
    .search-form select { min-width: 100%; }
    .category-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}
