:root {
    --gold-500: #F5C518;
    --gold-600: #D4A90E;
    --gold-100: #FEF9E7;
    --black-900: #1A1A1A;
    --black-700: #333333;
    --gray-500: #6B7280;
    --gray-200: #E5E7EB;
    --gray-50: #F9FAFB;
    --white: #FFFFFF;
    --red-500: #EF4444;
    --green-500: #22C55E;
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--gray-50);
    color: var(--black-700);
    line-height: 1.5;
}

/* Top Banner */
.top-banner {
    background-color: #25D366;
    color: var(--white);
    text-align: center;
    padding: 0.6rem 1rem;
    font-size: 0.875rem;
    text-decoration: none;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    transition: background-color 0.2s;
}

.top-banner:hover {
    background-color: #128C7E;
}

/* Header */
.navbar {
    background-color: var(--black-900);
    color: var(--white);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: transform 0.3s ease;
}

.navbar.nav-hidden {
    transform: translateY(-100%);
}

.top-banner {
    transition: transform 0.3s ease, margin-top 0.3s ease;
}

.top-banner.banner-hidden {
    transform: translateY(-100%);
    margin-top: -42px;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--gold-500);
    font-weight: 700;
    font-size: 1.25rem;
}

.logo-img {
    height: 24px;
    width: auto;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
}

.nav-item {
    color: var(--gray-200);
    text-decoration: none;
    font-weight: 500;
    padding-bottom: 0.25rem;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.nav-item:hover, .nav-item.active {
    color: var(--gold-500);
    border-bottom-color: var(--gold-500);
}

/* Buttons */
.btn {
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    font-size: 0.875rem;
}

.btn-primary {
    background-color: var(--gold-500);
    color: var(--black-900);
}

.btn-primary:hover {
    background-color: var(--gold-600);
}

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--gray-200);
    color: var(--black-700);
}

.btn-outline:hover {
    border-color: var(--black-900);
}

/* Hero */
.hero-section {
    background-color: var(--white);
    padding: 2rem 1rem;
    border-bottom: 1px solid var(--gray-200);
}

.hero-content {
    max-width: 1400px;
    margin: 0 auto;
}

#hero-title {
    color: var(--black-900);
    margin-bottom: 1.5rem;
    display: none; /* Hide default title, rely on filter bar */
}

/* Filter Bar */
.filter-bar {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    background: var(--white);
    padding: 1.25rem 1.5rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.filter-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.filter-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--gray-500);
    min-width: 70px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-pill {
    padding: 0.5rem 1.15rem;
    border: 1px solid var(--gray-200);
    border-radius: 20px;
    font-family: inherit;
    font-size: 0.85rem;
    background-color: var(--white);
    color: var(--black-700);
    cursor: pointer;
    outline: none;
    transition: all 0.15s;
}

.filter-pill:hover {
    border-color: var(--gold-500);
    background-color: var(--gold-50, #fffdf0);
}

.filter-pill.active {
    background-color: var(--gold-500);
    border-color: var(--gold-500);
    color: var(--black-900);
    font-weight: 600;
}

.filter-select {
    padding: 0.5rem 1.15rem;
    border: 1px solid var(--gray-200);
    border-radius: 20px;
    font-family: inherit;
    font-size: 0.85rem;
    background-color: var(--white);
    color: var(--black-700);
    cursor: pointer;
    min-width: 140px;
    outline: none;
    transition: border-color 0.2s;
}

.filter-select:hover, .filter-select:focus {
    border-color: var(--gold-500);
}

.btn-clear-filters {
    padding: 0.5rem 1.15rem;
    border: 1px dashed var(--gray-200);
    border-radius: 20px;
    font-family: inherit;
    font-size: 0.8rem;
    background-color: var(--white);
    color: var(--gray-500);
    cursor: pointer;
    outline: none;
    transition: all 0.15s;
    margin-left: auto;
}

.btn-clear-filters:hover {
    border-color: var(--red-500);
    color: var(--red-500);
}

/* Main Content */
.main-content {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1.25rem;
}

.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 3rem;
    gap: 0.5rem;
}

.page-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--gray-200);
    background-color: var(--white);
    color: var(--black-700);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.page-btn:hover:not(:disabled) {
    background-color: var(--gray-50);
    border-color: var(--black-900);
}

.page-btn.active {
    background-color: var(--gold-500);
    border-color: var(--gold-500);
    color: var(--black-900);
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Cards */
.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--gray-200);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    border-color: var(--gold-500);
}

.card-img-wrapper {
    position: relative;
    width: 100%;
}

.card-img-placeholder {
    height: 160px;
    background-color: var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-500);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.card-img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.card-price-badge {
    position: absolute;
    bottom: 12px;
    left: 12px;
    background-color: var(--white);
    color: var(--black-900);
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.85rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.card-body {
    padding: 0.75rem;
    flex: 1;
}

.card-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--black-900);
    margin-bottom: 0.25rem;
}

.card-title {
    font-weight: 700;
    font-size: 1rem;
    color: var(--black-900);
    margin-bottom: 0.15rem;
    line-height: 1.2;
}

.card-location {
    font-size: 0.85rem;
    color: var(--gray-500);
    margin-bottom: 0.4rem;
    line-height: 1.3;
}

.card-meta {
    color: var(--gray-500);
    font-size: 0.8rem;
    display: flex;
    gap: 0.75rem;
}

/* Wanted Cards */
.wanted-card-body {
    display: flex; flex-direction: column; height: 100%; padding: 1.5rem;
}
.wanted-header {
    display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 0.75rem;
}
.wanted-title {
    margin-bottom: 0; font-size: 1.1rem; line-height: 1.3;
}
.wanted-badges {
    display: flex; gap: 0.35rem; flex-shrink: 0; margin-left: 0.5rem;
}
.wanted-location {
    margin-bottom: 1.25rem;
}
.wanted-location .lucide-icon-pin {
    width: 14px; height: 14px; margin-right: 4px; vertical-align: text-bottom;
}
.wanted-budget-box {
    background: var(--gray-50); padding: 0.75rem; border-radius: var(--radius-md); margin-bottom: 1rem;
}
.wanted-budget-label {
    font-size: 0.75rem; color: var(--gray-500); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 0.25rem;
}
.wanted-budget-amount {
    font-weight: 700; color: var(--black-900); font-size: 1.05rem;
}
.wanted-needs {
    font-size: 0.85rem; color: var(--gray-500); margin-bottom: 1.5rem; display: flex; align-items: center; gap: 0.5rem; flex-grow: 1;
}
.wanted-needs .lucide-icon-clock {
    width: 16px; height: 16px; flex-shrink: 0;
}
.wanted-urgency {
    font-weight: 500; color: var(--black-700);
}
.wanted-posted {
    font-size: 0.75rem; color: var(--gray-500); margin-bottom: 1.25rem; border-top: 1px solid var(--gray-200); padding-top: 0.75rem; text-transform: uppercase; letter-spacing: 0.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.wanted-btn {
    margin-top: auto; padding: 0.75rem; font-weight: 600;
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.modal-content {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.modal-lg { max-width: 800px; }
.modal-sm { max-width: 400px; }

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--gray-500);
}

/* Forms */
.form-group { margin-bottom: 1rem; }
.form-group label {
    display: block;
    margin-bottom: 0.25rem;
    font-size: 0.875rem;
    font-weight: 500;
}
.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-family: inherit;
}

.text-error { color: var(--red-500); font-size: 0.875rem; }
.w-100 { width: 100%; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1.5rem; }
.mb-4 { margin-bottom: 1.5rem; }

@media (max-width: 1200px) {
    .card-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 992px) {
    .card-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .nav-container { flex-direction: column; text-align: center; gap: 0.75rem; padding: 0.75rem 1rem; }
    .brand { justify-content: center; margin-bottom: 0; }
    
    /* Fit links across the screen width */
    .nav-links { 
        order: 2; width: 100%; justify-content: space-between; flex-wrap: nowrap; gap: 0.25rem; 
        margin-top: 0; padding-bottom: 0.25rem;
    }
    .nav-links .nav-item { white-space: nowrap; font-size: 0.85rem; padding: 0.25rem 0; }

    /* Action buttons — fit within screen width */
    .nav-actions { 
        order: 3; width: 100%; flex-wrap: wrap; justify-content: center; 
        gap: 0.4rem !important;
    }
    .nav-actions button { flex: 1 1 0; min-width: 0; white-space: nowrap; padding: 0.5rem 0.5rem !important; font-size: 0.75rem !important; }
    
    .card-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .filter-label {
        min-width: 100%;
        margin-bottom: 0.25rem;
    }
    
    .btn-clear-filters {
        margin-left: 0;
        margin-top: 0.5rem;
    }
}

@media (max-width: 480px) {
    /* Keep 2 columns but make text slightly smaller to fit */
    .card-title { font-size: 0.85rem; }
    .card-location { font-size: 0.75rem; }
    .card-price-badge { font-size: 0.75rem; padding: 3px 8px; }
    .card-price { font-size: 0.95rem; }
    .card-meta { font-size: 0.7rem; }
    .card-body { padding: 0.5rem; }
    .badge-manager { font-size: 0.6rem !important; padding: 1px 4px !important; }
    
    /* Wanted Card Mobile Compression */
    .wanted-card-body { padding: 0.5rem; }
    .wanted-header { margin-bottom: 0.35rem; }
    .wanted-title { font-size: 0.85rem; }
    .wanted-location { font-size: 0.75rem; margin-bottom: 0.5rem; }
    .wanted-budget-box { padding: 0.4rem; margin-bottom: 0.5rem; }
    .wanted-budget-label { font-size: 0.65rem; margin-bottom: 0.1rem; }
    .wanted-budget-amount { font-size: 0.8rem; }
    .wanted-needs { font-size: 0.7rem; margin-bottom: 0.5rem; gap: 0.25rem; flex-wrap: wrap; }
    .wanted-needs span:first-of-type { display: none; } /* Hide the word "Needs it:" on very small screens to save space */
    .wanted-urgency { font-size: 0.75rem; }
    .wanted-posted { font-size: 0.65rem; margin-bottom: 0.5rem; padding-top: 0.4rem; }
    .wanted-btn { padding: 0.4rem; font-size: 0.7rem; line-height: 1.1; white-space: normal; }
    .wanted-badges span { font-size: 0.55rem !important; padding: 1px 3px !important; }
}

/* Autocomplete Dropdown */
.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    z-index: 10;
    max-height: 200px;
    overflow-y: auto;
}
.autocomplete-item {
    padding: 0.75rem;
    cursor: pointer;
    border-bottom: 1px solid var(--gray-100);
}
.autocomplete-item:last-child { border-bottom: none; }
.autocomplete-item:hover { background: var(--gray-100); }

/* Image Upload UI */
.image-preview-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 10px;
}
.image-preview-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--gray-100);
    border: 1px solid var(--gray-200);
}
.image-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.image-preview-item .remove-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(0,0,0,0.6);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.image-preview-item .upload-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 4px;
    background: var(--primary-600);
    width: 0%;
    transition: width 0.3s;
}


/* Footer */
.footer {
    background-color: var(--black-900);
    color: var(--white);
    padding: 3rem 1rem;
    margin-top: 4rem;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.footer-links {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-links a {
    color: var(--white);
    text-decoration: none;
    opacity: 0.8;
    transition: opacity 0.2s;
    font-weight: 500;
}

.footer-links a:hover {
    opacity: 1;
    color: var(--gold-500);
}

.footer-info {
    color: var(--gray-500);
    font-size: 0.875rem;
    text-align: center;
}



/* Social Buttons */
.social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: #1e293b; /* footer background matching or slightly lighter */
    color: #94a3b8;
    transition: all 0.2s ease-in-out;
    text-decoration: none;
    border: 1px solid #334155;
}

.social-btn:hover {
    background-color: var(--primary-500);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    border-color: var(--primary-500);
}

.card-img-wrapper { aspect-ratio: 16/10; }
