/**
 * Frontend Styles - v5.3.0
 * 
 * @package AiInvestorTool
 * @since 5.3.0
 * 
 * FIXES in v5.3.0:
 * - Analytics panel with fixed height and proper scrolling
 * - Chart container with stable dimensions
 * - Geocoding progress bar styling
 * - News section with clickable links
 * - Better responsive breakpoints
 */

/* ====================================
   CSS VARIABLES
   ==================================== */
:root {
    --ait-color-primary: #4299e1;
    --ait-color-secondary: #00aaee;
    --ait-color-heading: #1a365d;
    --ait-color-text: #2d3748;
    --ait-color-faded: #718096;
    --ait-color-background: #ffffff;
    --ait-color-alt-background: #f7fafc;
    --ait-color-border: #e2e8f0;
    --ait-color-success: #48bb78;
    --ait-color-error: #f56565;
    --ait-radius: 22px;
    --ait-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    --ait-shadow-hover: 0 8px 30px rgba(66, 153, 225, 0.2);
}

/* ====================================
   CONTAINER & LAYOUT
   ==================================== */
.home-search-container {
    max-width: 100%;
    width: 100%;
    margin: 0 auto;
    padding: 30px 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.home-search-container * {
    box-sizing: border-box;
}

/* ====================================
   SPLIT-SCREEN LAYOUT
   ==================================== */
.ait-split-screen {
    display: flex;
    gap: 24px;
    margin-top: 30px;
    min-height: 600px;
}

.ait-listings-sidebar {
    flex: 1;
    min-width: 0;
    overflow-y: auto;
    max-height: 90vh;
    padding-right: 10px;
}

.ait-map-sidebar {
    flex: 1;
    min-width: 0;
    position: sticky;
    top: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    height: fit-content;
    max-height: 90vh;
}

/* ====================================
   MAP CONTAINER - 550px WITH FULLSCREEN
   ==================================== */
.ait-map-wrapper {
    position: relative;
    width: 100%;
    height: 550px;
    min-height: 550px;
    border-radius: var(--ait-radius);
    overflow: hidden;
    border: 2px solid var(--ait-color-border);
    box-shadow: var(--ait-shadow);
    background: #f0f0f0;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.ait-map-wrapper.fullscreen {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 99999 !important;
    border-radius: 0 !important;
    border: none !important;
}

#ait-map {
    width: 100% !important;
    height: 100% !important;
    min-height: 550px !important;
    z-index: 1;
}

.leaflet-container {
    width: 100% !important;
    height: 100% !important;
}

/* Fullscreen Button */
.ait-fullscreen-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.95);
    color: var(--ait-color-heading);
    font-size: 16px;
    cursor: pointer;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ait-fullscreen-btn:hover {
    background: var(--ait-color-primary);
    color: white;
    transform: scale(1.05);
}

/* ====================================
   MAP STATS OVERLAY
   ==================================== */
.ait-map-stats {
    position: absolute;
    bottom: 16px;
    left: 16px;
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 10px 18px;
    border-radius: 24px;
    font-size: 13px;
    font-weight: 600;
    z-index: 1000;
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.ait-stat-icon {
    font-size: 16px;
    color: var(--ait-color-primary);
}

.ait-map-stats #markerCount {
    color: var(--ait-color-success);
    font-size: 18px;
    font-weight: 700;
}

.ait-geocoding-status {
    color: #ffd700;
    font-size: 12px;
}

.ait-geocoding-status.active {
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ====================================
   v5.3.0 GEOCODING PROGRESS BAR
   ==================================== */
.ait-geocoding-progress {
    position: absolute;
    bottom: 60px;
    left: 16px;
    right: 16px;
    background: rgba(0, 0, 0, 0.85);
    padding: 10px 16px;
    border-radius: 12px;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 12px;
    backdrop-filter: blur(8px);
}

.progress-bar {
    flex: 1;
    height: 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--ait-color-primary), var(--ait-color-success));
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-text {
    color: white;
    font-size: 12px;
    font-weight: 600;
    min-width: 40px;
    text-align: right;
}

/* ====================================
   THUMBNAIL MARKERS
   ==================================== */
.ait-thumbnail-marker {
    background: transparent !important;
    border: none !important;
}

.ait-marker-thumb {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 3px solid var(--ait-color-primary);
    background-size: cover;
    background-position: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: all 0.2s ease;
}

.ait-marker-thumb:hover {
    transform: scale(1.2);
    border-color: var(--ait-color-secondary);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.ait-custom-marker {
    background: var(--ait-color-primary) !important;
    border: 3px solid white !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
    cursor: pointer !important;
    transition: transform 0.2s !important;
    color: white !important;
    font-size: 18px !important;
}

.ait-custom-marker:hover {
    transform: scale(1.2) !important;
}

/* ====================================
   ENHANCED POPUP STYLES
   ==================================== */
.leaflet-popup-content-wrapper {
    border-radius: 16px !important;
    padding: 0 !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25) !important;
    overflow: hidden;
}

.leaflet-popup-content {
    margin: 0 !important;
    width: 280px !important;
}

.ait-map-popup {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.ait-map-popup .popup-image {
    width: 100%;
    height: 150px;
    object-fit: cover;
    display: block;
}

.ait-map-popup .popup-content {
    padding: 16px;
}

.ait-map-popup h3 {
    margin: 0 0 8px 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--ait-color-heading);
    line-height: 1.4;
}

.ait-map-popup .popup-price {
    font-size: 22px;
    font-weight: 700;
    color: #059669;
    margin-bottom: 10px;
}

.ait-map-popup .popup-specs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 12px;
    color: var(--ait-color-text);
    margin-bottom: 10px;
}

.ait-map-popup .popup-specs span {
    background: var(--ait-color-alt-background);
    padding: 4px 8px;
    border-radius: 6px;
}

.ait-map-popup .popup-specs i {
    margin-right: 4px;
    color: var(--ait-color-faded);
}

.ait-map-popup .popup-cost-per-sqft {
    font-size: 13px;
    color: var(--ait-color-faded);
    margin-bottom: 12px;
}

.ait-map-popup .popup-link {
    display: block;
    background: linear-gradient(135deg, var(--ait-color-primary) 0%, #3182ce 100%);
    color: white !important;
    padding: 12px 16px;
    text-decoration: none !important;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    border-radius: 8px;
    transition: all 0.2s;
}

.ait-map-popup .popup-link:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(66, 153, 225, 0.4);
}

/* ====================================
   SKELETON LOADING
   ==================================== */
.ait-loading-skeleton {
    padding: 10px 0;
}

.skeleton-card {
    display: flex;
    gap: 20px;
    padding: 20px;
    background: white;
    border-radius: var(--ait-radius);
    border: 2px solid var(--ait-color-border);
    margin-bottom: 16px;
}

.skeleton-image {
    width: 280px;
    height: 180px;
    border-radius: 12px;
    background: #e2e8f0;
    flex-shrink: 0;
}

.skeleton-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.skeleton-line {
    height: 20px;
    border-radius: 4px;
    background: #e2e8f0;
}

.skeleton-specs {
    display: flex;
    gap: 12px;
    margin-top: auto;
}

.skeleton-badge {
    width: 80px;
    height: 32px;
    border-radius: 8px;
    background: #e2e8f0;
}

/* Shimmer animation */
.shimmer {
    background: linear-gradient(90deg, #e2e8f0 25%, #f7fafc 50%, #e2e8f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

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

/* ====================================
   v5.3.0 ANALYTICS DASHBOARD - FIXED HEIGHT
   ==================================== */
.ait-analytics-panel {
    background: linear-gradient(135deg, #0f0f1a 0%, #1a1a2e 100%);
    border-radius: var(--ait-radius);
    color: white;
    border: 2px solid #2d3748;
    box-shadow: var(--ait-shadow);
    flex: 1;
    min-height: 400px;
    max-height: calc(90vh - 590px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.analytics-scroll-container {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.analytics-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.analytics-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: white;
}

.analytics-header h3 i {
    margin-right: 8px;
    color: var(--ait-color-primary);
}

.analytics-badge {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    animation: pulse 2s infinite;
}

.analytics-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.analytics-stat-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s;
}

.analytics-stat-card:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
}

.stat-icon {
    font-size: 20px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: var(--ait-color-primary);
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 20px;
    font-weight: 700;
    color: white;
    line-height: 1.2;
}

.stat-label {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ====================================
   v5.3.0 CHART CONTAINER - FIXED HEIGHT
   ==================================== */
.analytics-chart-container {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.chart-title {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
}

.chart-title i {
    margin-right: 6px;
    color: var(--ait-color-primary);
}

/* v5.3.0: Fixed height chart wrapper */
.chart-wrapper {
    height: 180px;
    position: relative;
}

.chart-wrapper canvas {
    max-height: 180px !important;
}

.trend-indicator {
    font-size: 13px;
    font-weight: 600;
}

.trend-up { color: #48bb78; }
.trend-down { color: #fc8181; }
.trend-neutral { color: #ecc94b; }

.trend-indicator i {
    margin-right: 4px;
}

/* Market Sentiment */
.analytics-sentiment {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 16px;
}

.sentiment-header {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sentiment-meter {
    height: 8px;
    background: linear-gradient(90deg, #4299e1 0%, #ecc94b 50%, #e53e3e 100%);
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}

.sentiment-bar {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    transition: width 0.5s ease;
}

.sentiment-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.5);
}

.sentiment-labels span:nth-child(2) {
    color: white;
    font-weight: 600;
}

/* v5.3.0: Sentiment source citation */
.sentiment-source {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 10px;
    color: rgba(255, 255, 255, 0.4);
    display: flex;
    align-items: center;
    gap: 6px;
}

.sentiment-source i {
    color: var(--ait-color-primary);
}

/* Quick Stats */
.analytics-quick-stats {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 16px;
}

.quick-stat {
    flex: 1;
    text-align: center;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    padding: 10px;
}

.qs-label {
    display: block;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    margin-bottom: 4px;
}

.qs-value {
    font-size: 14px;
    font-weight: 600;
    color: white;
}

/* ====================================
   v5.3.0 LOCAL NEWS SECTION - CLICKABLE
   ==================================== */
.analytics-news {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 16px;
}

.news-header {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.news-header i {
    margin-right: 6px;
    color: var(--ait-color-primary);
}

.news-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* v5.3.0: Clickable news items */
a.news-item {
    display: flex;
    gap: 12px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    border-left: 3px solid var(--ait-color-primary);
    transition: all 0.2s;
    text-decoration: none !important;
    color: inherit !important;
    cursor: pointer;
}

a.news-item:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: translateX(4px);
    border-left-color: var(--ait-color-success);
}

.news-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(66, 153, 225, 0.2);
    border-radius: 8px;
    color: var(--ait-color-primary);
    font-size: 14px;
    flex-shrink: 0;
}

.news-content {
    flex: 1;
    min-width: 0;
}

.news-title {
    font-size: 12px;
    font-weight: 500;
    color: white;
    line-height: 1.4;
    margin-bottom: 4px;
}

.news-meta {
    display: flex;
    gap: 12px;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.5);
}

.news-meta i {
    margin-right: 4px;
}

/* Analytics Footer */
.analytics-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 10px;
    color: rgba(255, 255, 255, 0.4);
}

.analytics-powered {
    font-weight: 500;
}

.analytics-powered i {
    margin-left: 4px;
}

/* ====================================
   HEADER STYLES
   ==================================== */
.ait-search-header {
    text-align: center;
    margin-bottom: 30px;
}

.search-title {
    font-size: 36px;
    font-weight: 700;
    color: var(--ait-color-heading);
    margin-bottom: 10px;
    letter-spacing: -0.5px;
}

.search-subtitle {
    font-size: 16px;
    color: var(--ait-color-faded);
    margin-bottom: 35px;
}

/* ====================================
   CITY SELECTOR
   ==================================== */
.city-selector {
    margin-bottom: 25px;
    text-align: center;
}

.city-selector label {
    display: block;
    font-size: 18px;
    font-weight: 600;
    color: var(--ait-color-text);
    margin-bottom: 12px;
}

.city-selector label i {
    margin-right: 8px;
    color: var(--ait-color-primary);
}

.city-selector select {
    width: 100%;
    max-width: 450px;
    padding: 16px 24px !important;
    font-size: 16px !important;
    line-height: 1.5 !important;
    border: 2px solid var(--ait-color-border) !important;
    border-radius: 14px !important;
    background-color: white !important;
    color: var(--ait-color-text) !important;
    cursor: pointer;
    transition: all 0.3s ease;
    appearance: none !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%232d3748' d='M6 9L1 4h10z'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: calc(100% - 20px) center !important;
    text-align: center !important;
    text-align-last: center !important;
    margin: 0 auto;
    display: block;
}

.city-selector select:hover {
    border-color: var(--ait-color-primary) !important;
}

.city-selector select:focus {
    outline: none;
    border-color: var(--ait-color-primary) !important;
    box-shadow: 0 0 0 4px rgba(66, 153, 225, 0.15);
}

/* ====================================
   SEARCH BUTTON
   ==================================== */
.search-button {
    background: linear-gradient(135deg, var(--ait-color-primary) 0%, #3182ce 100%);
    color: white;
    border: none;
    padding: 16px 56px;
    font-size: 18px;
    font-weight: 600;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(66, 153, 225, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.search-button i {
    font-size: 16px;
}

.search-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(66, 153, 225, 0.5);
}

.search-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* ====================================
   RESULTS CONTAINER
   ==================================== */
.results-container {
    margin-top: 10px;
}

.results-header {
    font-size: 22px;
    font-weight: 700;
    color: var(--ait-color-heading);
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 3px solid var(--ait-color-primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.results-header i {
    margin-right: 8px;
    color: var(--ait-color-primary);
}

.results-count {
    font-size: 14px;
    color: var(--ait-color-faded);
    font-weight: 500;
    background: var(--ait-color-alt-background);
    padding: 6px 14px;
    border-radius: 20px;
}

.results-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.results-timestamp {
    color: var(--ait-color-faded);
    font-size: 13px;
}

.results-timestamp i {
    margin-right: 6px;
}

.results-sort {
    display: flex;
    align-items: center;
    gap: 10px;
}

.results-sort label {
    font-size: 14px;
    color: var(--ait-color-text);
    font-weight: 600;
}

.results-sort label i {
    margin-right: 6px;
}

.results-sort select {
    padding: 10px 40px 10px 14px;
    font-size: 14px;
    border: 2px solid var(--ait-color-border);
    border-radius: 10px;
    background-color: white;
    color: var(--ait-color-text);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath fill='%232d3748' d='M5 7L1 3h8z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: calc(100% - 12px) center;
}

.results-sort select:focus {
    outline: none;
    border-color: var(--ait-color-primary);
}

/* ====================================
   HOME ITEM CARDS - AIRBNB STYLE
   ==================================== */
.home-item {
    background: white;
    border: 2px solid var(--ait-color-border);
    border-radius: var(--ait-radius);
    padding: 20px;
    margin-bottom: 16px;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: row;
    gap: 20px;
    cursor: pointer;
    opacity: 0;
    transform: translateY(20px);
}

.home-item.animate-in {
    opacity: 1;
    transform: translateY(0);
    animation: slideIn 0.4s ease forwards;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.home-item:hover {
    border-color: var(--ait-color-primary);
    box-shadow: var(--ait-shadow-hover);
    transform: translateY(-3px);
}

.home-item.highlighted {
    border-color: var(--ait-color-primary) !important;
    box-shadow: 0 0 0 4px rgba(66, 153, 225, 0.3), var(--ait-shadow-hover) !important;
    animation: highlightPulse 0.5s ease;
}

@keyframes highlightPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.01); }
}

.home-image-container {
    flex-shrink: 0;
    width: 280px;
    height: 200px;
    border-radius: 14px;
    overflow: hidden;
    border: 2px solid var(--ait-color-border);
}

.home-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s;
}

.home-item:hover .home-image-container img {
    transform: scale(1.05);
}

.home-image-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 56px;
}

.home-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.home-address {
    font-size: 17px;
    font-weight: 600;
    color: var(--ait-color-heading);
    line-height: 1.4;
}

.home-address a {
    color: var(--ait-color-primary);
    text-decoration: none;
    transition: color 0.2s;
}

.home-address a:hover {
    color: var(--ait-color-secondary);
    text-decoration: underline;
}

.home-address i {
    margin-right: 6px;
    color: var(--ait-color-faded);
}

.home-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.home-price {
    font-size: 28px;
    font-weight: 700;
    color: #059669;
}

.home-specs {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 14px;
    color: var(--ait-color-text);
}

.home-specs span {
    display: flex;
    align-items: center;
    gap: 4px;
    background: var(--ait-color-alt-background);
    padding: 6px 12px;
    border-radius: 8px;
}

.home-specs span i {
    color: var(--ait-color-faded);
}

.cost-per-sqft {
    font-weight: 600;
    color: var(--ait-color-secondary) !important;
    background: rgba(66, 153, 225, 0.1) !important;
}

.view-listing-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    padding: 12px 28px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    align-self: flex-start;
    margin-top: auto;
}

.view-listing-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
    color: white;
    text-decoration: none;
}

/* Results Footer */
.results-footer {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid var(--ait-color-border);
}

.load-more-btn {
    margin-bottom: 16px;
}

.view-all-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--ait-color-primary);
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
}

.view-all-link:hover {
    color: var(--ait-color-secondary);
    text-decoration: underline;
}

/* Error Message */
.error-message {
    padding: 30px;
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border: 2px solid #fca5a5;
    border-radius: var(--ait-radius);
    color: #991b1b;
    text-align: center;
}

.error-icon {
    font-size: 48px;
    display: block;
    margin-bottom: 16px;
}

/* ====================================
   RESPONSIVE DESIGN
   ==================================== */
@media (max-width: 1024px) {
    .ait-split-screen {
        flex-direction: column;
    }
    
    .ait-map-sidebar {
        order: -1;
        position: relative;
        top: 0;
        max-height: none;
    }
    
    .ait-map-wrapper {
        height: 400px;
        min-height: 400px;
    }
    
    #ait-map {
        min-height: 400px !important;
    }
    
    .ait-listings-sidebar {
        max-height: none;
        overflow-y: visible;
    }
    
    .ait-analytics-panel {
        max-height: 600px;
    }
}

@media (max-width: 768px) {
    .home-item {
        flex-direction: column;
    }
    
    .home-image-container {
        width: 100%;
        height: 220px;
    }
    
    .skeleton-card {
        flex-direction: column;
    }
    
    .skeleton-image {
        width: 100%;
        height: 200px;
    }
    
    .search-title {
        font-size: 28px;
    }
    
    .results-header {
        font-size: 18px;
        flex-direction: column;
        align-items: flex-start;
    }
    
    .results-controls {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .results-sort {
        width: 100%;
    }
    
    .results-sort select {
        flex: 1;
    }
    
    .analytics-stats-grid {
        grid-template-columns: 1fr;
    }
    
    .ait-map-wrapper {
        height: 350px;
        min-height: 350px;
    }
    
    #ait-map {
        min-height: 350px !important;
    }
}

@media (max-width: 480px) {
    .home-search-container {
        padding: 20px 12px;
    }
    
    .search-title {
        font-size: 24px;
    }
    
    .search-button {
        padding: 14px 32px;
        font-size: 16px;
    }
    
    .home-specs {
        flex-direction: column;
        gap: 6px;
    }
    
    .ait-map-wrapper {
        height: 300px;
        min-height: 300px;
    }
    
    #ait-map {
        min-height: 300px !important;
    }
    
    .analytics-quick-stats {
        flex-direction: column;
    }
}

/* ====================================
   SCROLLBAR STYLING
   ==================================== */
.ait-listings-sidebar::-webkit-scrollbar,
.analytics-scroll-container::-webkit-scrollbar {
    width: 8px;
}

.ait-listings-sidebar::-webkit-scrollbar-track,
.analytics-scroll-container::-webkit-scrollbar-track {
    background: var(--ait-color-alt-background);
    border-radius: 4px;
}

.ait-listings-sidebar::-webkit-scrollbar-thumb {
    background: var(--ait-color-border);
    border-radius: 4px;
}

.ait-listings-sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--ait-color-faded);
}

.analytics-scroll-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.analytics-scroll-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.analytics-scroll-container::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}
