/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-purple: #31135D;
    --primary-purple-hover: #251047;
    --accent-blue: #4A90E2;
    --text-dark: #1a1a1a;
    --text-gray: #6b7280;
    --bg-light: #f9fafb;
    --bg-white: #ffffff;
    --border-color: #e5e7eb;
    --font-inter: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-dm: 'DM Sans', sans-serif;
}

body {
    font-family: var(--font-inter);
    font-size: 16px;
    line-height: 1.5;
    color: var(--text-dark);
    background-color: var(--bg-light);
}

/* Header */
.header {
    background: var(--primary-purple);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.header-content {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0.75rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
}

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

.logo-text {
    color: white;
    font-size: 1.25rem;
    font-weight: 600;
    font-family: var(--font-dm);
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-link {
    color: white;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: opacity 0.2s;
}

.nav-link:hover {
    opacity: 0.8;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.mobile-menu-btn span {
    display: block;
    width: 25px;
    height: 3px;
    background: #333;
    margin: 5px 0;
    transition: 0.3s;
}

.nav-items {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.explore-btn {
    padding: 0.6rem 1.5rem;
    background: white;
    color: var(--primary-purple);
    border: 2px solid white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s;
    font-family: var(--font-dm);
}

.explore-btn:hover {
    background: transparent;
    color: white;
}

.sign-in-btn {
    padding: 0.6rem 1.5rem;
    background: transparent;
    color: white;
    border: 2px solid white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s;
}

.sign-in-btn:hover {
    background: white;
    color: var(--primary-purple);
}

/* Mobile Filter Bar */
.mobile-filter-bar {
    display: none;
    background: white;
    padding: 1rem;
    border-bottom: 1px solid #e0e0e0;
    gap: 1rem;
}

.filter-toggle-btn,
.map-toggle-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.filter-toggle-btn:hover,
.map-toggle-btn:hover {
    background: #f5f5f5;
}

/* Filter Panel */
.filter-panel {
    background: white;
    border-bottom: 1px solid #e5e7eb;
    padding: 1.5rem 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.filter-container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    gap: 1rem;
    align-items: center;
    overflow-x: auto;
    scrollbar-width: thin;
}

.filter-group {
    flex-shrink: 0;
    min-width: fit-content;
}

/* Horizontal Filter Row */
.horizontal-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-top: 1rem;
    align-items: flex-start;
}

.horizontal-filters .filter-group.compact {
    flex: 1 1 220px;
    min-width: 220px;
    max-width: 220px;
}

.horizontal-filters .filter-group.compact .filter-select {
    width: 100%;
}

/* Top Filter Row Layout */
.top-filter-row {
    display: block;
    margin-bottom: 1.5rem;
}

.top-filter-row .calendar-group {
    width: 100%;
}

.neighborhoods-group {
    width: 220px;
    min-width: 220px;
    max-width: 220px;
}

.neighborhoods-group .neighborhood-search {
    width: 100%;
    box-sizing: border-box;
}


/* Mobile responsive for horizontal filters */
@media (max-width: 1024px) {
    .neighborhoods-group {
        width: 100%;
        max-width: none;
        min-width: 0;
    }

    .horizontal-filters .filter-group.compact {
        flex: 1 1 calc(50% - 0.75rem);
        min-width: 150px;
        max-width: none;
    }
}

@media (max-width: 768px) {
    .neighborhoods-group {
        width: 100%;
    }

    .horizontal-filters .filter-group.compact {
        flex: 1 1 100%;
        min-width: 100%;
        max-width: 100%;
    }
}

.filter-group label {
    display: block;
    font-size: 0.75rem;
    color: #6b7280;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.05em;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.filter-select {
    width: 100%;
    min-width: 140px;
    padding: 0.625rem 0.875rem;
    padding-right: 2.25rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.875rem;
    height: 42px;
    background: white url('data:image/svg+xml;utf8,<svg width="12" height="8" viewBox="0 0 12 8" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M1 1.5L6 6.5L11 1.5" stroke="%23666" stroke-width="1.5" stroke-linecap="round"/></svg>') no-repeat;
    background-position: calc(100% - 0.75rem) center;
    cursor: pointer;
    transition: all 0.2s;
    appearance: none;
    -webkit-appearance: none;
    color: var(--text-dark);
}

.filter-select:hover,
.filter-select:focus {
    border-color: var(--primary-purple);
    outline: none;
    box-shadow: 0 0 0 3px rgba(49, 19, 93, 0.05);
}

/* Calendar Group */
.calendar-group {
    width: 100%;
}

/* Day Selector */
.day-selector {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-start;
    align-items: center;
    margin: 0.75rem 0;
    width: 100%;
}

.calendar-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.75rem;
}

.day-badge {
    width: 40px !important;
    height: 40px !important;
    border-radius: 8px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: "Inter", Helvetica, Arial, sans-serif;
    font-weight: 600;
    font-size: 14px !important;
    line-height: 16px;
    cursor: pointer;
    transition: transform 0.2s ease-in-out, background 0.2s ease-in-out;
    background-color: #b2b2b2 !important;
    color: #ffffff !important;
    border: none;
    box-shadow: 0px 2px 6px rgba(0, 0, 0, 0.1);
}

.day-badge:hover {
    transform: translateY(-2px);
}

.day-badge.active {
    background-color: #4B47CE !important;
    color: #ffffff !important;
}

.day-badge.active:hover {
    background-color: #4B47CE !important;
    color: #ffffff !important;
}

/* Check-in/Check-out Display */
.checkin-checkout {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 1rem;
    margin: 0.75rem 0 0 0;
    padding: 0.6rem 1rem;
    background: #f3f4f6;
    border-radius: 8px;
    font-size: 14px;
    color: #333;
    border: 1px solid #e0e0e0;
    width: 100%;
}

.checkin-checkout .separator {
    color: #999;
    font-weight: normal;
}

.checkin-checkout strong {
    font-weight: 600;
}

#checkinDay, #checkoutDay {
    color: #31135D;
    font-weight: 600;
}

/* Neighborhood Multi-Select */
.neighborhood-search {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
    height: 42px;
}

.neighborhood-list {
    max-height: 180px;
    overflow-y: auto;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 0.75rem;
    display: none;
    background: white;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.neighborhood-search:focus + .neighborhood-list,
.neighborhood-list:hover {
    display: block;
}

.neighborhood-list label {
    display: block;
    padding: 0.4rem 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
    text-transform: none;
    letter-spacing: normal;
    border-radius: 4px;
    transition: background 0.15s ease;
}

.neighborhood-list label:hover {
    background: #f3f4f6;
}

.neighborhood-list input[type="checkbox"] {
    margin-right: 0.5rem;
}

/* Filter Results */
.filter-results {
    display: flex;
    align-items: center;
    font-size: 14px;
    color: #666;
    padding: 0.5rem 1rem;
    background: #f5f5f5;
    border-radius: 4px;
}

/* Main Content */
.main-content {
    max-width: 1440px;
    margin: 0 auto;
    padding: 2rem;
    display: grid;
    grid-template-columns: 1fr 0.67fr;
    gap: 2rem;
    min-height: calc(100vh - 200px);
}

/* Listings Section */
.listings-section {
    overflow-y: auto;
    max-height: calc(100vh - 250px);
}

/* Listings Header */
.listings-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

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

.search-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-dark);
    font-family: var(--font-dm);
}

.view-options {
    display: flex;
    gap: 0.5rem;
    background: #f3f4f6;
    padding: 0.25rem;
    border-radius: 8px;
}

.view-btn {
    padding: 0.5rem;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    color: #9ca3af;
    transition: all 0.2s;
}

.view-btn.active {
    background: white;
    color: var(--primary-purple);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.view-btn:hover:not(.active) {
    color: #6b7280;
}

.header-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.95rem;
    color: #6b7280;
}

.results-count strong,
.location-tag strong {
    color: var(--text-dark);
    font-weight: 600;
}

.location-tag {
    padding-left: 1rem;
    border-left: 1px solid #e5e7eb;
}

.listings-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Listing Card */
.listing-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    cursor: pointer;
    border: 1px solid #f3f4f6;
    display: flex;
    flex-direction: row;
    height: 260px;
    position: relative;
}

.listing-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    border-color: #e5e7eb;
}

/* Listing card without images - full width content */
.listing-card:not(:has(.listing-images)) {
    flex-direction: column;
    height: auto;
    min-height: 200px;
}

.listing-card:not(:has(.listing-images)) .listing-content {
    width: 100%;
    padding: 1.5rem;
}

.listing-images {
    position: relative;
    width: 40%;
    min-width: 280px;
    height: 100%;
    overflow: hidden;
    background: linear-gradient(to bottom, #f9fafb, #f3f4f6);
    flex-shrink: 0;
}

.listing-images img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.listing-card:hover .listing-images img {
    transform: scale(1.05);
}

.image-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.9);
    border: 1px solid rgba(0,0,0,0.1);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    opacity: 0.8;
    font-size: 18px;
    font-weight: bold;
    color: #333;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    z-index: 2;
}

.listing-card:hover .image-nav {
    opacity: 1;
    background: white;
}

.image-nav:hover {
    background: white;
    transform: translateY(-50%) scale(1.15);
    box-shadow: 0 4px 8px rgba(0,0,0,0.25);
}

.prev-btn {
    left: 8px;
}

.next-btn {
    right: 8px;
}

/* Image counter for carousel */
.image-counter {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    backdrop-filter: blur(4px);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.listing-card:hover .image-counter {
    opacity: 1;
}

.favorite-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(8px);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.favorite-btn:hover {
    background: rgba(0,0,0,0.8);
    transform: scale(1.1);
}

.favorite-btn svg {
    stroke: white;
    stroke-width: 2;
}

.new-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: #22C55E;
    color: white;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.listing-content {
    padding: 1.25rem 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-width: 0;
}

.listing-info {
    flex: 1;
}

.listing-location {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    color: #6b7280;
    font-weight: 500;
}

.location-text {
    font-size: 13px;
    color: #666;
}

.listing-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
    line-height: 1.4;
    font-family: var(--font-dm);
    transition: color 0.2s;
}

.listing-card:hover .listing-title {
    color: var(--primary-purple);
}

.listing-type {
    font-size: 14px;
    color: #666;
    margin-bottom: 0.5rem;
}

.listing-details {
    font-size: 14px;
    color: #666;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.listing-footer {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding-top: 1rem;
    border-top: 1px solid #f0f0f0;
}

.host-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.host-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e0e0e0;
    object-fit: cover;
}

.host-details {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.host-name {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.verified-badge {
    display: inline-block;
    width: 12px;
    height: 12px;
    background: #4A90E2;
    border-radius: 50%;
    margin-left: 4px;
}

.message-btn {
    padding: 6px 12px;
    background: #4A90E2;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.3s;
}

.message-btn:hover {
    background: #357ABD;
}

.pricing-info {
    text-align: right;
}

.starting-price {
    font-size: 13px;
    color: #666;
    margin-bottom: 0.25rem;
}

/* Hover effect when starting-price is clickable */
.starting-price.info-trigger {
    transition: all 0.2s ease;
    padding: 4px 8px;
    margin: -4px -8px 0.25rem -8px;
    border-radius: 6px;
}

.starting-price.info-trigger:hover {
    background-color: #f0f7ff;
    color: #3b82f6;
}

.starting-price.info-trigger:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

.full-price {
    font-size: 20px;
    font-weight: 600;
    color: #222;
    margin-bottom: 0.25rem;
}

.availability-text {
    font-size: 12px;
    color: #999;
}

/* AI Research Card */
.ai-research-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    padding: 2rem;
    color: white;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    width: 100%;
}

.ai-icon {
    width: 60px;
    height: 60px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-title {
    font-size: 20px;
    font-weight: 600;
}

.ai-subtitle {
    font-size: 14px;
    opacity: 0.9;
}

.ai-btn {
    padding: 0.75rem 1.5rem;
    background: white;
    color: #667eea;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.3s;
}

.ai-btn:hover {
    transform: scale(1.05);
}

/* Loading Skeleton */
.loading-skeleton {
    display: none;
}

.loading-skeleton.active {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.skeleton-card {
    display: flex;
    background: white;
    border-radius: 16px;
    overflow: hidden;
    height: 260px;
    border: 1px solid #f3f4f6;
}

.skeleton-image {
    width: 40%;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

.skeleton-content {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.skeleton-line {
    height: 16px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 4px;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Map Section */
.map-section {
    position: sticky;
    top: 100px;
    height: calc(100vh - 250px);
}

.map-wrapper {
    height: 100%;
    display: flex;
    flex-direction: column;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.map-controls {
    background: white;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
}

.map-search {
    flex: 1;
    max-width: 300px;
}

.map-search-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.map-search-input:focus {
    outline: none;
    border-color: var(--primary-purple);
    box-shadow: 0 0 0 3px rgba(49, 19, 93, 0.05);
}

.map-filters {
    display: flex;
    gap: 0.5rem;
}

.map-filter-btn {
    padding: 0.5rem 1rem;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    color: #6b7280;
}

.map-filter-btn.active {
    background: var(--primary-purple);
    color: white;
    border-color: var(--primary-purple);
}

.map-filter-btn:hover:not(.active) {
    border-color: var(--primary-purple);
    color: var(--primary-purple);
}

.map-view-controls {
    display: flex;
    gap: 0.5rem;
}

.map-view-btn {
    padding: 0.5rem;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    color: #6b7280;
}

.map-view-btn:hover {
    border-color: var(--primary-purple);
    color: var(--primary-purple);
}

.map-container {
    width: 100%;
    flex: 1;
    position: relative;
    min-height: 400px;
    background: #f3f4f6;
}

.map-legend {
    position: absolute;
    bottom: 20px;
    left: 20px;
    background: white;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    display: flex;
    gap: 1.5rem;
    z-index: 100;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: #6b7280;
}

.legend-marker {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.legend-marker.available {
    background: var(--primary-purple);
}

.legend-marker.selected {
    background: #10B981;
}

/* Chat Widget */
.chat-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: #4A90E2;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: transform 0.3s;
    z-index: 999;
}

.chat-widget:hover {
    transform: scale(1.1);
}

.chat-label {
    display: none;
}

/* Scrollbar Styles */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Lazy Loading Styles */
.lazy-load-sentinel {
    display: flex;
    justify-content: center;
    padding: 2rem 1rem;
    margin: 1rem 0;
    opacity: 0.8;
}

.loading-more {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-gray);
    font-size: 14px;
    font-weight: 500;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--primary-purple);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Smooth scroll behavior for better UX */
html {
    scroll-behavior: smooth;
}