:root {
    /* Modern Color Palette (Indigo & Slate) */
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --secondary: #64748b;
    --bg-body: #f8fafc;
    --surface: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    
    /* Effects */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --radius: 12px;
}

* { box-sizing: border-box; }

body {
    font-family: 'Inter', system-ui, sans-serif;
    background: var(--bg-body);
    color: var(--text-main);
    margin: 0;
    padding: 0;
    line-height: 1.5;
}

/* --- Header --- */
header {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    padding: 1rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--border);
}

.logo {
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    letter-spacing: -0.5px;
}

.cta-button {
    background: var(--primary);
    color: white;
    padding: 0.6rem 1.25rem;
    text-decoration: none;
    border-radius: 50px; /* Pill shape */
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.cta-button:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

/* --- Hero & Filters --- */
main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem 4rem;
}

.hero-section {
    padding: 3rem 0;
    text-align: center;
}

.hero-content h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-main);
    letter-spacing: -1px;
}

.hero-content p {
    color: var(--text-muted);
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

/* Modern Filter Card */
.filters-card {
    background: var(--surface);
    padding: 1.5rem;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
    border: 1px solid var(--border);
    max-width: 1000px;
    margin: 0 auto;
}

.filter-group {
    flex: 1;
    min-width: 180px;
    display: flex;
    flex-direction: column;
    text-align: left;
}

.filter-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

/* Custom Select Styling */
.select-wrapper {
    position: relative;
}

/* Arrow icon for select */
.select-wrapper::after {
    content: '\ea4e'; /* Remix Icon chevron-down */
    font-family: 'remixicon';
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: var(--text-muted);
    font-size: 1.1rem;
}

select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--text-main);
    appearance: none; /* Hide default arrow */
    background: #fff;
    cursor: pointer;
    transition: all 0.2s;
}

select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

select:disabled {
    background-color: #f1f5f9;
    cursor: not-allowed;
    color: #94a3b8;
}

#resetBtn {
    background: #f1f5f9;
    color: var(--text-muted);
    border: 1px solid var(--border);
    padding: 0.75rem;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

#resetBtn:hover {
    background: #e2e8f0;
    color: var(--text-main);
}

/* --- Listings Grid --- */
.listings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
    padding-top: 2rem;
}

/* --- Card Design --- */
.card {
    background: var(--surface);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.card-content {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 0.75rem;
}

.badge {
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}
.badge.room { background: #e0e7ff; color: #4338ca; }
.badge.house { background: #dcfce7; color: #15803d; }

.price {
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--text-main);
}

.location {
    font-weight: 600;
    color: var(--text-main);
    margin: 0;
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.area-detail {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: 0 0 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.contact-btn {
    width: 100%;
    background: var(--text-main);
    color: white;
    border: none;
    padding: 0.9rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    margin-top: auto; /* Pushes button to bottom */
    transition: background 0.2s;
}

.contact-btn:hover {
    background: var(--primary);
}

/* --- Carousel --- */
.carousel-container {
    position: relative;
    height: 220px;
    background: #e2e8f0;
}

.carousel-slides, .carousel-slides img.slide {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(4px);
    color: var(--text-main);
    border: none;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 50%; /* Circle shape */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    z-index: 10;
    transition: all 0.2s;
    opacity: 0; /* Hidden by default */
}

.carousel-container:hover .carousel-btn {
    opacity: 1; /* Show on hover */
}

.carousel-btn:hover {
    background: white;
    transform: translateY(-50%) scale(1.1);
}

.carousel-btn.prev { left: 10px; }
.carousel-btn.next { right: 10px; }

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .filters-card {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-group {
        width: 100%;
    }
    
    header {
        padding: 1rem;
    }
    
    .hero-content h1 {
        font-size: 1.75rem;
    }
}

/* --- Carousel Fix --- */

/* 1. Hide all slides by default */
.carousel-slides img.slide {
    display: none; 
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 2. Only display the slide that has the 'active' class */
.carousel-slides img.slide.active {
    display: block;
    animation: fadeEffect 0.5s;
}

/* Optional: Add a smooth fade animation */
@keyframes fadeEffect {
    from { opacity: 0.8; }
    to { opacity: 1; }
}

/* --- Submit Page Styles --- */

/* Secondary Button Style (Gray) for "Back" button */
.cta-button.secondary {
    background: white;
    color: var(--text-main);
    border: 1px solid var(--border);
}

.cta-button.secondary:hover {
    background: #f1f5f9;
    color: var(--primary);
    border-color: var(--primary);
    transform: translateY(-1px);
}

/* Container for the form page */
.submit-container {
    max-width: 800px;
    margin: 3rem auto;
    padding: 0 1rem;
}

/* Header Text */
.submit-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.submit-header h1 {
    font-size: 2.5rem;
    color: var(--text-main);
    margin-bottom: 0.5rem;
    letter-spacing: -1px;
}

.submit-header p {
    color: var(--text-muted);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* The White Card around the Form */
.form-wrapper {
    background: var(--surface);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    overflow: hidden; /* Clips the iframe corners */
    padding: 0;
}

/* Make iframe responsive */
iframe {
    display: block; /* Removes bottom gap */
    width: 100%;
    /* Note: Height is handled in HTML attribute, 
       but you can override here if needed */
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .submit-header h1 {
        font-size: 2rem;
    }
    
    .submit-container {
        margin-top: 2rem;
    }
}