/* Custom Styles for Enhanced Design */

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
    overflow: hidden;
    padding: 100px 0;
}

.hero-section .wave {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 150px;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 120" preserveAspectRatio="none"><path d="M321.39,56.44c58-10.79,114.16-30.13,172-41.86,82.39-16.72,168.19-17.73,250.45-.39C823.78,31,906.67,72,985.66,92.83c70.05,18.48,146.53,26.09,214.34,3V0H0V27.35A600.21,600.21,0,0,0,321.39,56.44Z" fill="%23ffffff"/></svg>');
    background-size: 1200px 150px;
}

.hero-section .wave-1 {
    animation: wave 25s linear infinite;
}

.hero-section .wave-2 {
    opacity: 0.5;
    animation: wave 20s linear infinite;
    animation-delay: -5s;
}

.hero-section .wave-3 {
    opacity: 0.2;
    animation: wave 15s linear infinite;
    animation-delay: -2s;
}

@keyframes wave {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.search-box {
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95) !important;
}

.stat-card {
    background: rgba(255, 255, 255, 0.2);
    padding: 15px;
    border-radius: 10px;
    text-align: center;
}

.stat-card h3 {
    color: white;
    font-weight: bold;
}

.stat-card p {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 0;
}

/* Listing Cards */
.listing-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
}

.listing-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.15);
}

.listing-image {
    position: relative;
    height: 250px;
    overflow: hidden;
}

.listing-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.listing-card:hover .listing-image img {
    transform: scale(1.05);
}

.listing-badges {
    position: absolute;
    top: 15px;
    left: 15px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.listing-badges .badge {
    padding: 8px 12px;
    font-size: 0.8rem;
    border-radius: 20px;
}

.listing-price {
    position: absolute;
    bottom: 15px;
    right: 15px;
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 1.2rem;
}

.listing-price small {
    font-size: 0.8rem;
    opacity: 0.8;
}

.listing-content {
    padding: 20px;
}

.listing-title {
    font-weight: 600;
    margin-bottom: 10px;
}

.listing-title a {
    color: #333;
    text-decoration: none;
}

.listing-title a:hover {
    color: #667eea;
}

.listing-location {
    color: #6c757d;
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.listing-description {
    color: #666;
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 15px;
}

.listing-meta {
    font-size: 0.85rem;
    color: #6c757d;
}

/* Small Listing Cards */
.listing-card-sm {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
}

.listing-card-sm:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.12);
}

.listing-image-sm {
    position: relative;
    height: 180px;
    overflow: hidden;
}

.listing-image-sm img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.listing-card-sm:hover .listing-image-sm img {
    transform: scale(1.05);
}

.verified-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #28a745;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

.listing-content-sm {
    padding: 15px;
}

.listing-title-sm {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 5px;
}

.listing-title-sm a {
    color: #333;
    text-decoration: none;
}

.listing-title-sm a:hover {
    color: #667eea;
}

.price-sm {
    font-weight: bold;
    color: #667eea;
    font-size: 1.1rem;
}

.btn-view-sm {
    width: 35px;
    height: 35px;
    background: #667eea;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.3s ease;
}

.btn-view-sm:hover {
    background: #5a67d8;
    color: white;
    transform: rotate(45deg);
}

/* How It Works */
.step-card {
    background: white;
    border-radius: 15px;
    padding: 30px !important;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
    transition: transform 0.3s ease;
}

.step-card:hover {
    transform: translateY(-10px);
}

.step-number {
    position: absolute;
    top: -15px;
    right: 20px;
    font-size: 3rem;
    font-weight: 900;
    color: rgba(102, 126, 234, 0.1);
}

.step-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
    margin: 0 auto 20px;
}

/* City Cards */
.city-card {
    display: block;
    background: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    text-decoration: none;
    color: #333;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
}

.city-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.15);
    color: #667eea;
}

.city-card i {
    font-size: 2rem;
    color: #667eea;
    margin-bottom: 10px;
}

.city-card h5 {
    margin-bottom: 5px;
    font-weight: 600;
}

.city-card small {
    color: #6c757d;
}

/* Filters Card */
.filters-card {
    position: sticky;
    top: 20px;
}

.category-list {
    max-height: 300px;
    overflow-y: auto;
    padding-right: 10px;
}

.category-list::-webkit-scrollbar {
    width: 5px;
}

.category-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.category-list::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 10px;
}

/* Page Header */
.page-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

/* Active Filters */
.active-filters .badge {
    padding: 8px 12px;
    border-radius: 20px;
}

.active-filters .badge a {
    text-decoration: none;
}

/* Empty State */
.empty-state {
    padding: 60px 20px;
}

.empty-icon {
    color: #dee2e6;
}

/* Pagination */
.pagination .page-link {
    color: #667eea;
    border: none;
    margin: 0 5px;
    border-radius: 8px !important;
}

.pagination .page-item.active .page-link {
    background: #667eea;
    border-color: #667eea;
}

.pagination .page-link:hover {
    background: rgba(102, 126, 234, 0.1);
}

/* CTA Section */
.cta-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
    overflow: hidden;
}

.cta-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320"><path fill="%23ffffff" fill-opacity="0.1" d="M0,224L48,213.3C96,203,192,181,288,181.3C384,181,480,203,576,192C672,181,768,139,864,128C960,117,1056,139,1152,149.3C1248,160,1344,160,1392,160L1440,160L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z"></path></svg>');
    background-size: cover;
    background-position: center;
}

/* Section Titles */
.section-title {
    position: relative;
    padding-bottom: 15px;
    margin-bottom: 30px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 3px;
    background: linear-gradient(to right, #667eea, #764ba2);
    border-radius: 2px;
}

.section-title.text-center::after {
    left: 50%;
    transform: translateX(-50%);
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-section {
        padding: 60px 0;
    }
    
    .hero-section h1 {
        font-size: 2.5rem;
    }
    
    .search-box .col-md-1 {
        width: 100%;
        margin-top: 10px;
    }
    
    .view-options .btn-group {
        flex-wrap: wrap;
    }
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
/* FIX FOR IMAGE DISPLAY ISSUES */

/* Ensure images are visible */
.listing-image img {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Override any Bootstrap classes that might hide images */
.img-fluid {
    max-width: 100% !important;
    height: auto !important;
    display: block !important;
}

/* Fix for broken images */
img[src*="default-listing.jpg"] {
    background: linear-gradient(45deg, #667eea, #764ba2);
    padding: 20px;
    color: white;
    font-family: Arial, sans-serif;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Make sure the image container has proper dimensions */
.listing-image {
    position: relative;
    overflow: hidden;
    background-color: #f8f9fa; /* Fallback background */
    min-height: 250px;
}

/* Add loading animation */
.listing-image img:not([src*="default-listing.jpg"]) {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Image hover effects */
.listing-card:hover .listing-image img {
    transform: scale(1.05);
    transition: transform 0.5s ease;
}

.listing-image img {
    transition: transform 0.5s ease;
}

/* Ensure parent elements don't hide images */
.listing-card {
    overflow: visible !important;
}

/* Fix for any z-index issues */
.listing-image {
    z-index: 1;
}

/* Make sure images load properly */
img {
    content-visibility: auto;
}

/* Remove any max-height constraints that might crop images */
.listing-image img {
    max-height: none !important;
}