/* Estiq Pro v14.0 - Valuation Page UI/UX Overhaul */

/* ===============================================
 * 1. Design System & Variables
 * =============================================== */
:root {
    /* Primary color palette */
    --bs-primary: #2563eb; /* A slightly more standard, professional blue */
    --bs-primary-rgb: 37, 99, 235;
    --bs-primary-light: #eff6ff; /* Lighter for subtle backgrounds */
    --bs-primary-dark: #1d4ed8;

    /* Secondary & Accent Colors */
    --bs-secondary: #64748b;
    --bs-success: #10b981;
    --bs-danger: #ef4444;
    --bs-warning: #f59e0b;
    --bs-info: #3b82f6;

    /* Typography & Backgrounds */
    --bs-body-bg: #f8fafc; /* Lighter gray for a clean look */
    --bs-body-color: #1e293b;
    --bs-font-sans-serif: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --text-muted: #64748b;
    --text-heading: #0f172a; /* Darker for high contrast */

    /* Components Styling */
    --card-bg: #ffffff;
    --card-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.05), 0 2px 4px -2px rgb(0 0 0 / 0.05);
    --card-shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.07), 0 4px 6px -4px rgb(0 0 0 / 0.07);
    --card-border-radius: 0.75rem; /* Standardized radius */
    --card-border-color: #e2e8f0;
    --input-border-color: #cbd5e1;
}

/* ===============================================
 * 2. Global & Helper Classes
 * =============================================== */
body {
    background-color: var(--bs-body-bg);
    font-family: var(--bs-font-sans-serif);
    color: var(--bs-body-color);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* SEO Text Styles */
.seo-article-text {
    line-height: 1.7;
    font-size: 1rem;
}
.seo-article-text h1, .seo-article-text .h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-heading);
    margin-bottom: 1rem;
}
.seo-article-text h2, .seo-article-text .h2 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-heading);
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}
.seo-article-text p {
    margin-bottom: 1.25rem;
}
.seo-article-text p.lead {
    font-size: 1.1rem;
    color: #334155;
    font-weight: 400;
}

/* ===============================================
 * 3. Component Styles
 * =============================================== */

/* Buttons */
.btn {
    transition: all .2s ease-in-out;
    border-radius: 0.5rem;
    font-weight: 600;
    padding: 0.55rem 1.2rem;
}
.btn-primary {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
}
.btn-primary:hover {
    background-color: var(--bs-primary-dark);
    border-color: var(--bs-primary-dark);
}
.btn-success {
    background-color: var(--bs-success);
    border-color: var(--bs-success);
}
.btn-outline-primary {
    color: var(--bs-primary);
    border-color: var(--bs-primary);
}
.btn-outline-primary:hover {
    background-color: var(--bs-primary);
    color: white;
}
.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

/* Cards */
.card {
    box-shadow: var(--card-shadow);
    border-radius: var(--card-border-radius);
    border: none;
}

/* Forms */
.form-label {
    font-weight: 500;
    color: #475569;
    font-size: 0.875rem;
    margin-bottom: 0.35rem;
}
.form-control, .form-select {
    background-color: #fff;
    border: 1px solid var(--input-border-color);
    border-radius: 0.5rem;
    transition: border-color .15s ease-in-out,box-shadow .15s ease-in-out;
    padding: 0.65rem 1rem;
}
.form-control:focus, .form-select:focus {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 3px rgba(var(--bs-primary-rgb), 0.15);
}

.contact-prefill {
    border: 1px dashed rgba(var(--bs-primary-rgb), 0.4);
    background: var(--bs-primary-light);
    border-radius: 0.85rem;
    padding: 1rem 1.25rem;
}
.contact-prefill-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.75rem;
    background: rgba(var(--bs-primary-rgb), 0.15);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}
.contact-prefill-list li + li {
    margin-top: 0.25rem;
}
.contact-success-state {
    background: linear-gradient(135deg, rgba(var(--bs-primary-rgb), 0.08), rgba(16, 185, 129, 0.08));
    border: 1px solid rgba(var(--bs-primary-rgb), 0.2);
}
.contact-modal .modal-content {
    border-radius: 1.25rem;
}
.contact-modal .modal-header {
    align-items: flex-start;
}

/* Map */
#map {
    border-radius: var(--card-border-radius);
    background: #e9ecef;
    z-index: 1;
}

/* Custom Map Markers */
.leaflet-div-icon {
    background: transparent;
    border: none;
}
.map-marker {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 36px;
    height: 36px;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease-in-out;
}
.map-marker .icon-content {
    transform: rotate(45deg);
    color: #fff;
    font-size: 16px;
    font-weight: bold;
}
.target-marker { background-color: var(--bs-primary); border: 2px solid white; }
.comp-marker { background-color: var(--bs-secondary); width: 30px; height: 30px; opacity: 0.8; }
.comp-marker .icon-content { font-size: 12px; }
.highlight-marker { background-color: var(--bs-warning); transform: rotate(-45deg) scale(1.2); opacity: 1; z-index: 1000 !important; } /* Ensure highlight is on top */


/* Toast Notifications */
#toast-container { position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 2000; }
.toast { box-shadow: var(--card-shadow-lg); border:0; border-radius: 0.5rem; }

/* ===============================================
 * 4. Valuation Page Specifics
 * =============================================== */

/* Confidence Display */
.confidence-display {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.confidence-value {
    font-size: 1.25rem;
    font-weight: 700;
}
.confidence-high { color: var(--bs-success); }
.confidence-medium { color: var(--bs-warning); }
.confidence-low { color: var(--bs-danger); }

/* Valuation Top Comparables */
.list-group-item.comp-row {
    transition: background-color .2s;
    cursor: pointer;
}
.list-group-item.comp-row:hover {
    background-color: var(--bs-primary-light);
}

/* ===============================================
 * 5. Other Sections
 * =============================================== */

/* Market Insights Tabs */
.nav-pills .nav-link {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.9rem;
    border-radius: 0.5rem;
}
.nav-pills .nav-link.active {
    background-color: var(--bs-primary-light);
    color: var(--bs-primary);
}

/* Insight Card */
.insight-card {
    background-color: #f8fafc;
    padding: 1rem;
    border-radius: 0.75rem;
    text-align: center;
    border: 1px solid var(--card-border-color);
    height: 100%;
}
.insight-card .value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-heading);
    line-height: 1.2;
    margin-bottom: 0.25rem;
}
.insight-card .label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
}

/* H3 Chart Container */
#h3-price-analysis-container canvas {
    max-height: 220px;
}

/* ===============================================
 * 6. Skeleton Loaders (If used)
 * =============================================== */
.skeleton-loader { /* ... existing skeleton styles ... */ }

/* Ensure homepage map always has height */
#map {
    min-height: 320px;
}
.map-wrapper {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

/* Cookie banner */
.cookie-banner {
    position: fixed;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    width: min(960px, calc(100% - 24px));
    background: #fff;
    border: 1px solid rgba(15,23,42,0.08);
    box-shadow: 0 12px 30px rgba(15,23,42,0.12);
    border-radius: 14px;
    padding: 14px 16px;
    z-index: 2001;
}
.cookie-banner__content {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
}
.cookie-banner__actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.cookie-preferences {
    margin-top: 12px;
    padding: 12px;
    border-top: 1px solid rgba(15,23,42,0.08);
    background: #f8fafc;
    border-radius: 10px;
}

@media (max-width: 576px) {
    .cookie-banner__content {
        flex-direction: column;
        align-items: flex-start;
    }
    .cookie-banner__actions {
        width: 100%;
    }
}

/* ===============================================
 * Market heatmap legend & loading
 * =============================================== */
.heatmap-legend {
    position: absolute;
    right: 12px;
    bottom: 12px;
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: var(--card-shadow);
    border-radius: 12px;
    padding: 10px 12px;
    z-index: 10;
    font-size: 0.88rem;
    min-width: 170px;
}
.heatmap-legend .legend-title {
    font-weight: 700;
    color: #0f172a;
}
.heatmap-legend .legend-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
    color: #475569;
}
.heatmap-legend .legend-row:last-child {
    margin-bottom: 0;
}
.heatmap-legend .legend-color {
    width: 18px;
    height: 12px;
    border-radius: 4px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    flex: 0 0 18px;
}
.heatmap-legend .legend-label {
    flex: 1;
}
.map-loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, rgba(255,255,255,0.7), rgba(255,255,255,0.5));
    z-index: 9;
}
.map-loading.d-none {
    display: none !important;
}
@media (max-width: 576px) {
    .heatmap-legend {
        left: 12px;
        right: 12px;
        min-width: unset;
        font-size: 0.82rem;
    }
}
