/* OLX Pakistan - Professional Dark Theme */

:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: #181820;
    --bg-hover: #1e1e2a;
    --bg-input: #14141e;
    --text: #f0f0f5;
    --text-secondary: #9090a8;
    --text-muted: #5a5a72;
    --accent: #00c9a7;
    --accent-hover: #00b396;
    --accent-glow: rgba(0, 201, 167, 0.15);
    --border: #252530;
    --border-light: #2e2e3a;
    --border-focus: #00c9a7;
    --danger: #ff4757;
    --success: #2ed573;
    --warning: #ffa502;
    --price: #ffd700;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.5);
    --shadow-glow: 0 0 20px rgba(0,201,167,0.1);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --transition: 0.2s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

.container { max-width: 1280px; margin: 0 auto; padding: 0 24px; }
a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-hover); }

/* ===== HEADER ===== */
.header {
    background: rgba(18,18,26,0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 100;
}
.header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}
.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 22px;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.5px;
}
.logo:hover { color: var(--text); }
.logo-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #006847, #00c9a7);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}
.accent { color: var(--accent); }
.nav { display: flex; gap: 4px; }
.nav-link {
    padding: 8px 18px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    transition: all var(--transition);
}
.nav-link:hover { background: var(--bg-hover); color: var(--text); }
.nav-link.active { background: var(--accent-glow); color: var(--accent); }

/* ===== HERO ===== */
.hero {
    padding: 80px 0 50px;
    text-align: center;
    background: radial-gradient(ellipse at 50% 0%, rgba(0,201,167,0.06) 0%, transparent 60%);
}
.hero-title {
    font-size: 48px;
    font-weight: 800;
    margin-bottom: 12px;
    letter-spacing: -1px;
    line-height: 1.15;
}
.hero-subtitle {
    color: var(--text-secondary);
    font-size: 18px;
    margin-bottom: 40px;
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
}

/* ===== SEARCH BOX ===== */
.search-box { max-width: 760px; margin: 0 auto; }
.search-input-wrap {
    display: flex;
    align-items: center;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 6px;
    transition: all var(--transition);
    box-shadow: var(--shadow-md);
}
.search-input-wrap:focus-within {
    border-color: var(--accent);
    box-shadow: var(--shadow-glow);
}
.search-icon {
    margin: 0 10px 0 16px;
    color: var(--text-muted);
    flex-shrink: 0;
}
.search-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text);
    font-size: 16px;
    padding: 14px 10px;
}
.search-input::placeholder { color: var(--text-muted); }
.search-btn {
    background: linear-gradient(135deg, #00c9a7, #00b396);
    color: #000;
    border: none;
    padding: 14px 32px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
    letter-spacing: 0.3px;
}
.search-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,201,167,0.3); }

/* ===== FILTERS ===== */
.filters {
    display: flex;
    gap: 10px;
    margin-top: 16px;
    justify-content: center;
    flex-wrap: wrap;
}
.filter-select, .filter-input {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    outline: none;
    cursor: pointer;
    transition: border-color var(--transition);
}
.filter-select:focus, .filter-input:focus { border-color: var(--accent); }
.filter-input { width: 110px; }

/* ===== QUICK TAGS ===== */
.quick-tags {
    margin-top: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}
.tag-label { color: var(--text-muted); font-size: 13px; font-weight: 500; }
.tag {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 7px 16px;
    border-radius: 24px;
    font-size: 13px;
    color: var(--text-secondary);
    transition: all var(--transition);
    font-weight: 500;
}
.tag:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-glow);
    transform: translateY(-1px);
}
.city-tags {
    margin-top: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}
.city-tag {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    border: 1px solid #2a2a4a;
    padding: 8px 18px;
    border-radius: 24px;
    font-size: 13px;
    color: #b8b8d0;
    transition: all var(--transition);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.city-tag:hover {
    border-color: var(--accent);
    color: #fff;
    background: linear-gradient(135deg, rgba(255,107,53,0.15), rgba(255,107,53,0.05));
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255,107,53,0.2);
}
.city-tag-map {
    background: linear-gradient(135deg, var(--accent), #e85d2a);
    color: #fff;
    border-color: var(--accent);
}
.city-tag-map:hover {
    background: linear-gradient(135deg, #ff7e4d, var(--accent));
    box-shadow: 0 4px 16px rgba(255,107,53,0.4);
}

/* ===== FEATURES ===== */
.features { padding: 56px 0; }
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
}
.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px 24px;
    text-align: center;
    transition: all var(--transition);
}
.feature-card:hover {
    border-color: var(--accent);
    transform: translateY(-3px);
    box-shadow: var(--shadow-glow);
}
.feature-icon {
    font-size: 36px;
    margin-bottom: 16px;
    display: block;
}
.feature-card h3 { font-size: 17px; margin-bottom: 8px; font-weight: 600; }
.feature-card p { font-size: 14px; color: var(--text-secondary); line-height: 1.5; }

/* ===== SEARCH COMPACT (Results Page) ===== */
.search-compact {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    padding: 16px 0;
}
.search-box-sm {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.search-input-sm {
    flex: 1;
    min-width: 200px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 11px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    outline: none;
    transition: border-color var(--transition);
}
.search-input-sm:focus { border-color: var(--accent); }
.filter-select-sm, .filter-input-sm {
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 11px 12px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    outline: none;
    transition: border-color var(--transition);
}
.filter-select-sm:focus, .filter-input-sm:focus { border-color: var(--accent); }
.filter-input-sm { width: 100px; }
.search-btn-sm {
    background: linear-gradient(135deg, #00c9a7, #00b396);
    color: #000;
    border: none;
    padding: 11px 24px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    cursor: pointer;
    font-size: 14px;
    transition: all var(--transition);
}
.search-btn-sm:hover { transform: translateY(-1px); }

/* ===== RESULTS ===== */
.results-section { padding: 32px 0 64px; }
.results-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 24px;
}
.results-header h2 { font-size: 22px; font-weight: 700; }
.results-count { color: var(--text-secondary); font-size: 14px; }

/* Results Grid */
.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

/* ===== LISTING CARD ===== */
.listing-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    transition: all var(--transition);
}
.listing-card:hover {
    border-color: var(--accent);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
}
.listing-image {
    position: relative;
    aspect-ratio: 4/3;
    overflow: hidden;
    background: var(--bg-hover);
}
.listing-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}
.listing-card:hover .listing-image img { transform: scale(1.08); }
.no-image {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    font-size: 28px;
    color: var(--text-muted);
}
.no-image.large { height: 300px; font-size: 48px; }

.listing-info { padding: 16px; }
.listing-title {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: var(--text);
}
.listing-price {
    font-size: 20px;
    font-weight: 800;
    color: var(--accent);
    margin-bottom: 8px;
}
.listing-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}
.listing-location {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}
.listing-location::before {
    content: '';
    width: 4px;
    height: 4px;
    background: var(--accent);
    border-radius: 50%;
    display: inline-block;
}
.listing-link {
    font-size: 13px;
    font-weight: 600;
    color: var(--accent);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.listing-link:hover { text-decoration: underline; }

/* ===== DETAIL PAGE ===== */
.detail-section { padding: 32px 0 64px; }
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 24px;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    border: 1px solid var(--border);
    transition: all var(--transition);
}
.back-link:hover { border-color: var(--accent); color: var(--accent); }

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

.detail-images {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.detail-image-wrap {
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--bg-hover);
}
.detail-image-wrap img {
    width: 100%;
    display: block;
    object-fit: cover;
}

.detail-info { position: sticky; top: 88px; }
.detail-title {
    font-size: 28px;
    font-weight: 800;
    line-height: 1.25;
    margin-bottom: 16px;
    letter-spacing: -0.3px;
}
.detail-price {
    font-size: 32px;
    font-weight: 800;
    color: var(--accent);
    margin-bottom: 12px;
}
.detail-location {
    color: var(--text-secondary);
    font-size: 15px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.detail-location::before {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--accent);
    border-radius: 50%;
    display: inline-block;
}

.detail-seller {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
}
.seller-label { color: var(--text-muted); font-size: 13px; }
.seller-name { font-weight: 600; font-size: 14px; }

.detail-params {
    margin-bottom: 24px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}
.param-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}
.param-row:last-child { border-bottom: none; }
.param-key { color: var(--text-muted); }
.param-val { font-weight: 500; color: var(--text); }

.detail-desc {
    margin-bottom: 28px;
    padding: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}
.detail-desc h3 {
    font-size: 16px;
    margin-bottom: 12px;
    color: var(--text);
}
.detail-desc p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.7;
    white-space: pre-wrap;
}

.detail-actions { margin-top: 24px; }

/* ===== BUTTONS ===== */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(135deg, #00c9a7, #00b396);
    color: #000;
    border: none;
    padding: 14px 28px;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    letter-spacing: 0.3px;
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,201,167,0.3);
    color: #000;
}
.btn-lg { padding: 16px 36px; font-size: 16px; }

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--bg-card);
    color: var(--text);
    border: 1px solid var(--border);
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }

/* ===== IMAGE SEARCH ===== */
.upload-zone {
    max-width: 600px;
    margin: 0 auto;
    background: var(--bg-card);
    border: 2px dashed var(--border-light);
    border-radius: var(--radius-lg);
    padding: 48px 32px;
    text-align: center;
    transition: all var(--transition);
    cursor: pointer;
}
.upload-zone:hover, .upload-zone.dragover {
    border-color: var(--accent);
    background: var(--accent-glow);
}
.upload-content h3 { font-size: 18px; margin: 16px 0 8px; }
.upload-content p { color: var(--text-muted); font-size: 13px; margin-bottom: 20px; }
.upload-icon { font-size: 48px; }

.upload-preview {
    text-align: center;
}
.upload-preview img {
    max-width: 100%;
    max-height: 300px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    border: 1px solid var(--border);
}
.preview-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.upload-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 24px;
    color: var(--text-secondary);
    font-size: 15px;
}
.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.upload-result {
    max-width: 500px;
    margin: 24px auto 0;
    text-align: center;
}
.upload-result h3 { font-size: 16px; margin-bottom: 16px; }
.keyword-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-bottom: 24px;
}
.keyword-tag {
    background: var(--accent-glow);
    border: 1px solid rgba(0,201,167,0.3);
    color: var(--accent);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
}

/* Steps */
.steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
    max-width: 800px;
    margin: 60px auto 0;
}
@media (max-width: 640px) { .steps { grid-template-columns: 1fr; } }
.step { text-align: center; }
.step-num {
    width: 40px;
    height: 40px;
    background: var(--accent-glow);
    border: 1px solid rgba(0,201,167,0.3);
    color: var(--accent);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 12px;
}
.step h4 { font-size: 15px; margin-bottom: 6px; }
.step p { font-size: 13px; color: var(--text-secondary); line-height: 1.5; }

/* ===== ERROR / NO RESULTS ===== */
.error-box {
    background: rgba(255,71,87,0.08);
    border: 1px solid rgba(255,71,87,0.25);
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
    margin-bottom: 24px;
}
.error-box p { font-size: 15px; color: var(--danger); }
.error-hint { font-size: 13px; color: var(--text-muted); margin-top: 8px; }

.no-results {
    text-align: center;
    padding: 64px 0;
}
.no-results-icon { font-size: 56px; margin-bottom: 16px; }
.no-results h3 { font-size: 22px; margin-bottom: 8px; }
.no-results p { color: var(--text-secondary); margin-bottom: 24px; }

/* ===== FOOTER ===== */
.footer {
    border-top: 1px solid var(--border);
    padding: 24px 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .hero-title { font-size: 32px; }
    .hero-subtitle { font-size: 15px; }
    .results-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
    .search-box-sm { flex-direction: column; }
    .filter-input-sm { width: 100%; }
}
