/* ads.css - Styles for classified ads browsing */
:root {
    --primary-blue: #0055A5;
    --primary-blue-alt: #1E90FF;
    --growth-green: #2ECC71;
    --growth-green-alt: #008000;
    --premium-gold: #DAA520;
    --premium-gold-alt: #FFD700;
    --energy-orange: #FF6200;
    --energy-orange-alt: #FFA500;
    --pure-white: #FFFFFF;
    --dark-text: #333333;
    --light-gray: #f5f7fa;
    --medium-gray: #e2e8f0;
    --transition-base: all 0.3s ease;
}

/* Browse Header */
.browse-header {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    padding: 3rem 0;
    text-align: center;
    margin-bottom: 2rem;
}

.browse-header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.browse-header p {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* Browse Controls */
.browse-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.search-box {
    position: relative;
    flex-grow: 1;
    max-width: 400px;
}

.search-box i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
}

.search-box input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 1rem;
}

.filter-controls {
    display: flex;
    gap: 1rem;
}

.filter-controls select {
    padding: 0.75rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 1rem;
    background-color: white;
}

.view-toggle {
    display: flex;
    gap: 0.5rem;
}

.view-toggle button {
    padding: 0.75rem 1rem;
    background: white;
    border: 1px solid #ced4da;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.view-toggle button.active {
    background: #e9ecef;
    border-color: #adb5bd;
}

/* Ads Grid */
.ads-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* List View Variation */
.ads-grid.list-view {
    grid-template-columns: 1fr;
}

.ads-grid.list-view .ad-card {
    flex-direction: row;
}

.ads-grid.list-view .ad-image-container {
    width: 200px;
    height: 150px;
    flex-shrink: 0;
}

.ads-grid.list-view .ad-details {
    padding: 1rem;
}

/* Ad Card */
.ad-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}

.ad-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.ad-image-container {
    width: 100%;
    height: 200px;
    overflow: hidden;
    position: relative;
}

.ad-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.ad-card:hover .ad-thumbnail {
    transform: scale(1.05);
}

.ad-thumbnail.placeholder {
    background: #f1f3f5;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #adb5bd;
    font-size: 3rem;
}

.ad-details {
    padding: 1.25rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.ad-details h2 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    color: #212529;
}

.ad-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
    color: #6c757d;
}

.ad-meta i {
    margin-right: 0.3rem;
}

.ad-description {
    color: #495057;
    margin-bottom: 1rem;
    line-height: 1.5;
    flex-grow: 1;
}

.ad-footer {
    margin-top: auto;
}

.btn-view {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: #1e3c72;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    transition: background 0.2s;
    text-align: center;
}

.btn-view:hover {
    background: #2a5298;
}

/* No Results */
.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem;
    color: #6c757d;
}

.no-results i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #adb5bd;
}

.no-results a {
    color: #1e3c72;
    text-decoration: none;
}

.no-results a:hover {
    text-decoration: underline;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

.pagination a {
    padding: 0.5rem 1rem;
    border: 1px solid #dee2e6;
    color: #1e3c72;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.2s;
}

.pagination a:hover {
    background: #e9ecef;
}

.pagination a.active {
    background: #1e3c72;
    color: white;
    border-color: #1e3c72;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .browse-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-box {
        max-width: 100%;
    }
    
    .filter-controls {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .view-toggle {
        justify-content: center;
    }
    
    .ads-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
    
    .ads-grid.list-view .ad-card {
        flex-direction: column;
    }
    
    .ads-grid.list-view .ad-image-container {
        width: 100%;
        height: 200px;
    }
}

@media (max-width: 480px) {
    .browse-header h1 {
        font-size: 2rem;
    }
    
    .browse-header p {
        font-size: 1rem;
    }
    
    .ads-grid {
        grid-template-columns: 1fr;
    }
}