/* Base Styles */
:root {
    --primary-color: #4a154b;
    --primary-light: #7b2cbf;
    --secondary-color: #ff5a5f;
    --text-color: #333333;
    --text-light: #666666;
    --bg-color: #f8f9fa;
    --white: #ffffff;
    --gray-light: #e9ecef;
    --gray: #dee2e6;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --border-radius: 8px;
    --transition: all 0.3s ease;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: var(--border-radius);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
}

.btn-primary:hover {
    background-color: var(--primary-light);
}

.btn-outline {
    background-color: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.btn-outline:hover {
    background-color: var(--primary-color);
    color: var(--white);
}

.btn-large {
    padding: 12px 30px;
    font-size: 1.1rem;
}

.section-title {
    font-size: 2rem;
    margin-bottom: 30px;
    text-align: center;
    color: var(--text-color);
}

/* Navbar */
.navbar {
    background-color: var(--white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
}

.logo {
    display: flex;
    align-items: center;
}

.logo-image {
    height: 80px; /* Increased significantly */
    transition: var(--transition);
}

.logo a {
    display: flex;
    align-items: center;
    text-decoration: none;
}

/* Remove any text styling that might be applied to the logo */
.logo h1, .logo span {
    display: none;
}

.nav-links {
    display: flex;
    gap: 25px;
}

.nav-link {
    color: var(--text-color);
    font-weight: 500;
    transition: var(--transition);
}

.nav-link:hover {
    color: var(--primary-color);
}

.nav-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-color);
    cursor: pointer;
}

.mobile-menu {
    display: none;
    flex-direction: column;
    padding: 20px 0;
    background-color: var(--white);
}

.mobile-link {
    padding: 12px 0;
    border-bottom: 1px solid var(--gray-light);
    font-weight: 500;
}

.mobile-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 15px;
}

/* Hero Section */
.hero {
    background: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)), url('https://images.unsplash.com/photo-1556745757-8d76bdb6984b?ixlib=rb-4.0.3&auto=format&fit=crop&w=2070&q=80');
    background-size: cover;
    background-position: center;
    color: var(--white);
    padding: 80px 0;
    text-align: center;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 20px;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 30px;
}

.search-container {
    display: flex;
    max-width: 700px;
    margin: 0 auto;
    background-color: var(--white);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.search-input {
    flex: 1;
    padding: 15px;
    border: none;
    font-size: 1rem;
}

.category-select {
    padding: 15px;
    border: none;
    border-left: 1px solid var(--gray);
    font-size: 1rem;
    background-color: var(--white);
}

.search-btn {
    padding: 0 25px;
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.search-btn:hover {
    background-color: var(--primary-light);
}

/* Categories Section */
.categories-section {
    padding: 60px 0 30px; /* Increased top padding significantly */
    margin-top: 30px; /* Added positive margin */
    position: relative; /* Add position relative */
    z-index: 1; /* Ensure proper stacking */
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 20px;
}

.category-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 25px 15px;
    background-color: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    transition: var(--transition);
    text-align: center;
}

.category-tile:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.category-icon {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.category-tile h3 {
    font-size: 1rem;
    font-weight: 600;
}

/* Listings Section */
.listings-section {
    padding: 60px 0;
    background-color: var(--white);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.view-all {
    color: var(--primary-color);
    font-weight: 600;
    transition: var(--transition);
}

.view-all:hover {
    color: var(--primary-light);
}

.listings-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
}

.listing-card {
    background-color: var(--white);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.listing-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.listing-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.listing-details {
    padding: 20px;
}

.listing-title {
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: var(--text-color);
}

.listing-price {
    font-size: 1.3rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.listing-location {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
}

.listing-location::before {
    content: '\f3c5';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    margin-right: 5px
}

.listing-category {
    display: inline-block;
    background-color: var(--gray-light);
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--text-light);
}

.loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
}

.loading::after {
    content: "Loading...";
    font-size: 18px;
    color: var(--text-light);
}

/* Footer */
.footer {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 60px 0 20px;
    margin-top: 80px; /* Increased from 60px to 80px */
    clear: both; /* Ensure it clears any floated elements */
    position: relative; /* Ensure proper stacking context */
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.footer-column h3 {
    font-size: 1.5rem;
    margin-bottom: 20px;
}

.footer-column h4 {
    font-size: 1.2rem;
    margin-bottom: 20px;
}

/* Adjust the sidebar and content area positioning with more space */
.sidebar {
    width: 280px;
    flex-shrink: 0;
    margin-top: 50px; /* Increased from 20px to 50px */
}

.content-area {
    flex: 1;
    margin-top: 50px; /* Increased from 20px to 50px */
}

/* Add significant spacing to the categories section */
.categories-section {
    padding: 60px 0 30px; /* Increased top padding significantly */
    margin-top: 30px; /* Added positive margin */
    position: relative; /* Add position relative */
    z-index: 1; /* Ensure proper stacking */
}

/* Ensure proper spacing for the search section */
.search-section {
    background-color: var(--primary-color);
    padding: 30px 0 60px;
    text-align: center;
    margin-bottom: 40px; /* Increased bottom margin */
    position: relative; /* Add position relative */
    z-index: 2; /* Higher z-index than categories section */
}

/* Reset any negative margins in the index.html inline styles */
.categories-container {
    margin-top: 0 !important; /* Override any inline styles */
}

/* Force the main content to clear any floats and start below headers */
.main-content {
    display: flex;
    max-width: 1200px;
    margin: 0 auto;
    gap: 20px;
    padding: 0 20px;
    clear: both; /* Clear any floats */
    position: relative; /* Add position */
    top: 20px; /* Move down slightly */
}

/* Make sure widgets have proper spacing */
.categories-widget {
    background-color: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 20px;
    margin-bottom: 20px;
}

/* Ensure the featured listings container has proper spacing */
.featured-listings-container {
    background-color: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 20px;
}

/* Add additional spacing after the listings section */
.listings-section, .featured-listings-container {
    margin-bottom: 60px; /* Add bottom margin to create space before footer */
}

/* Ensure the main content has proper spacing at the bottom */
.main-content {
    padding-bottom: 40px; /* Add padding at the bottom of main content */
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .sidebar {
        margin-top: 0;
    }
    
    .content-area {
        margin-top: 20px;
    }
    
    .categories-section {
        padding: 20px 0;
    }
}
