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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.6;
    color: #e1e5e9;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    min-height: 100vh;
}

/* Full-width banner gradient background */
.banner-background {
    position: relative;
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    background: linear-gradient(90deg, 
        #0f1419 0%, 
        #1a1a2e 25%, 
        #16213e 45%, 
        #26c6da 49%, 
        #00bcd4 50%, 
        #9c27b0 51%, 
        #16213e 55%, 
        #1a1a2e 75%, 
        #0f1419 100%
    );
    padding: 0;
    margin-bottom: 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header Styles */
header {
    position: relative;
    background: transparent;
    border-radius: 0;
    margin-bottom: 0;
    overflow: hidden;
    width: 100%;
    margin: 0;
    padding: 0;
    z-index: 2;
}

.banner-image {
    width: 100vw;
    height: 450px;
    object-fit: cover;
    object-position: center;
    border-radius: 0;
    position: relative;
    z-index: 1;
    display: block;
    margin-left: calc(-50vw + 50%);
}

.display-4 {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Search Container */
.search-container {
    background: rgba(30, 42, 74, 0.95);
    backdrop-filter: blur(10px);
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    margin-bottom: 2rem;
    border: 1px solid rgba(102, 126, 234, 0.2);
}

/* Distance slider styling */
.distance-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    border-radius: 5px;
    background: #e9ecef;
    outline: none;
    opacity: 0.9;
    transition: opacity 0.2s;
}

.distance-slider:hover {
    opacity: 1;
}

.distance-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #0f3460;
    cursor: pointer;
    border: 3px solid white;
    box-shadow: 0 2px 8px rgba(15, 52, 96, 0.4);
}

.distance-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #0f3460;
    cursor: pointer;
    border: 3px solid white;
    box-shadow: 0 2px 8px rgba(15, 52, 96, 0.4);
    border: none;
}

/* Track styling for different browsers */
.distance-slider::-webkit-slider-track {
    width: 100%;
    height: 8px;
    cursor: pointer;
    background: linear-gradient(90deg, #0f3460 0%, #16213e 100%);
    border-radius: 5px;
}

.distance-slider::-moz-range-track {
    width: 100%;
    height: 8px;
    cursor: pointer;
    background: linear-gradient(90deg, #0f3460 0%, #16213e 100%);
    border-radius: 5px;
}

.input-group-text {
    border: none;
    background: linear-gradient(135deg, #0f3460 0%, #16213e 100%) !important;
    border-radius: 12px 0 0 12px !important;
    color: #ffffff;
}

.form-control {
    border: 2px solid #16213e;
    border-radius: 0 !important;
    padding: 15px 20px;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    flex: 1;
    min-width: 0;
    background-color: #1a1a2e;
    color: #e1e5e9;
}

.form-control::placeholder {
    color: #adb5bd;
}

.form-control:focus {
    border-color: #0f3460;
    box-shadow: 0 0 0 0.2rem rgba(15, 52, 96, 0.25);
    background-color: #1a1a2e !important;
    color: #e1e5e9 !important;
}

.form-control:active {
    background-color: #1a1a2e !important;
    color: #e1e5e9 !important;
}

.form-control:focus-visible {
    background-color: #1a1a2e !important;
    color: #e1e5e9 !important;
}


.btn-primary {
    background: linear-gradient(135deg, #0f3460 0%, #16213e 100%);
    border: none;
    border-radius: 0 12px 12px 0 !important;
    padding: 15px 25px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    color: #ffffff;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(15, 52, 96, 0.4);
    background: linear-gradient(135deg, #16213e 0%, #1a1a2e 100%);
}

.btn-primary:disabled {
    background: #6c757d;
    transform: none;
    box-shadow: none;
}

/* Report Cards */
.report-header {
    background: rgba(30, 42, 74, 0.95);
    backdrop-filter: blur(10px);
    padding: 1.5rem;
    border-radius: 15px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(102, 126, 234, 0.2);
}

.report-card {
    background: rgba(26, 26, 46, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid rgba(15, 52, 96, 0.3);
}

.report-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.card-header {
    background: linear-gradient(135deg, #16213e 0%, #0f3460 100%);
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #0f3460;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    color: #e1e5e9;
}

.card-header:hover {
    background: linear-gradient(135deg, #0f3460 0%, #16213e 100%);
}

.card-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
}

.collapse-icon {
    transition: transform 0.3s ease;
    color: #adb5bd;
}

.card-header[aria-expanded="true"] .collapse-icon {
    transform: rotate(180deg);
}

.card-body {
    padding: 1.5rem;
}

/* Data Display Styles */
.data-summary {
    background: #16213e;
    padding: 1rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    border-left: 4px solid #0f3460;
    color: #e1e5e9;
}

.data-list {
    list-style: none;
    padding: 0;
}

.data-list li {
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    background: #16213e;
    border-radius: 8px;
    border: 1px solid #0f3460;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
    color: #e1e5e9;
}

.data-list li:hover {
    background: #0f3460;
    border-color: #1a1a2e;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.data-table th,
.data-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #dee2e6;
}

.data-table th {
    background: #16213e;
    font-weight: 600;
    color: #e1e5e9;
    border-bottom: 1px solid #0f3460;
}

.data-table tbody tr:hover {
    background: #16213e;
}

.data-table td {
    color: #e1e5e9;
    border-bottom: 1px solid #0f3460;
}

/* Badge Styles */
.badge {
    font-size: 0.875rem;
    padding: 0.5rem 0.75rem;
    border-radius: 20px;
}

.rating-badge {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}

.distance-badge {
    background: linear-gradient(135deg, #17a2b8 0%, #6f42c1 100%);
    color: white;
}

/* Loading States */
.spinner-border {
    animation: spinner-border 0.75s linear infinite;
}

/* Alert Styles */
.alert {
    border-radius: 12px;
    border: none;
    margin-bottom: 1.5rem;
}

.alert-danger {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
}

/* Input Group Styling */
.input-group {
    display: flex;
    width: 100%;
}

.input-group .form-control {
    flex: 1;
    min-width: 200px;
}

.input-group .btn {
    white-space: nowrap;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .banner-background {
        margin-left: 0;
        width: 100%;
        margin-bottom: 1rem;
        overflow: hidden;
        background: linear-gradient(90deg, 
            #0f1419 0%, 
            #1a1a2e 20%, 
            #16213e 35%, 
            #26c6da 42%, 
            #00bcd4 50%, 
            #9c27b0 58%, 
            #16213e 65%, 
            #1a1a2e 80%, 
            #0f1419 100%
        ) !important;
    }
    
    .banner-image {
        width: 100% !important;
        height: 250px !important;
        margin-left: 0 !important;
        object-fit: cover !important;
        object-position: center;
        max-width: 100%;
        display: block;
    }
    
    header {
        padding: 0.5rem !important;
        max-width: 100%;
        margin: 0 !important;
        overflow: hidden;
    }
    
    .display-4 {
        font-size: 2rem;
    }
    
    .search-container {
        padding: 1.5rem 1rem;
        margin: 0 10px;
    }
    
    .input-group {
        flex-direction: column;
        gap: 0.5rem;
        width: 100% !important;
    }
    
    .input-group-text,
    .form-control,
    .btn-primary {
        border-radius: 12px !important;
        width: 100% !important;
        box-sizing: border-box;
    }
    
    .col-lg-8.col-md-10 {
        padding-left: 5px !important;
        padding-right: 5px !important;
    }
    
    .card-header {
        padding: 1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .data-list li {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

/* Dark Theme Text Colors */
.text-muted {
    color: #adb5bd !important;
}

.lead {
    color: #ced4da;
}

.card-body {
    color: #e1e5e9;
}

/* Chrome autofill styling fixes */
.form-control:-webkit-autofill,
.form-control:-webkit-autofill:hover,
.form-control:-webkit-autofill:focus,
.form-control:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px #1a1a2e inset !important;
    -webkit-text-fill-color: #e1e5e9 !important;
    background-color: #1a1a2e !important;
    color: #e1e5e9 !important;
    transition: background-color 5000s ease-in-out 0s;
}

/* Additional input states */
.form-control:not(:placeholder-shown) {
    background-color: #1a1a2e !important;
    color: #e1e5e9 !important;
}

/* Improved text contrast for dark theme */
.report-header h2,
.report-header .h3 {
    color: #ffffff !important;
}

.report-header p {
    color: #ced4da !important;
}

/* Links styling for dark theme */
a {
    color: #74b9ff;
}

a:hover {
    color: #0984e3;
}

/* Crime statistics links */
.card-body a {
    color: #74b9ff;
    text-decoration: underline;
}

.card-body a:hover {
    color: #0984e3;
}

/* Chart containers should have dark backgrounds */
.chart-container,
canvas,
#priceChartContainer,
#dynamicChartContainer,
.chart-wrapper,
.price-trends-container {
    background-color: #1a1a2e !important;
    border-radius: 8px;
    padding: 1rem;
}

/* All table backgrounds */
table,
.table,
.data-table,
tbody,
thead,
tr,
td,
th {
    background-color: #16213e !important;
    color: #e1e5e9 !important;
    border-color: #0f3460 !important;
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: #1a1a2e !important;
}

/* Property sales cards and summaries */
.sales-summary,
.property-summary,
.summary-card,
.stats-card,
.info-card {
    background-color: #16213e !important;
    color: #e1e5e9 !important;
    border: 1px solid #0f3460 !important;
    border-radius: 8px;
    padding: 1rem;
}

/* Flood risk and other data sections */
.flood-risk-container,
.flood-risk-section,
.flood-data,
.data-container,
.risk-assessment,
.assessment-box {
    background-color: #16213e !important;
    padding: 1rem;
    border-radius: 8px;
    color: #e1e5e9 !important;
    border: 1px solid #0f3460;
}

/* Override any white backgrounds in data sections */
.data-section,
.info-box,
.summary-box,
.alert-info,
.alert-warning,
.alert-success {
    background-color: #16213e !important;
    color: #e1e5e9 !important;
    border-color: #0f3460 !important;
}

/* Bootstrap alert overrides for dark theme */
.alert {
    background-color: #16213e !important;
    color: #e1e5e9 !important;
    border-color: #0f3460 !important;
}

/* Comprehensive white background overrides for dynamic content */
.bg-white,
.bg-light,
.card-body .bg-white,
.card-body .bg-light,
/* Flood risk specific elements */
#floodRiskData,
#floodRiskData *,
.flood-data,
.flood-info,
.flood-summary,
.flood-warning,
.flood-zone,
.flood-assessment,
.risk-badge,
.flood-links,
/* Price trends and chart elements */
#salesData,
#salesData *,
#priceChartContainer,
#priceChartContainer *,
#dynamicChartContainer,
#dynamicChartContainer *,
.sales-data,
.property-data,
.trends-data,
.chart-title,
.chart-legend,
.chart-info,
.sales-summary,
.price-summary,
.trend-summary,
.statistics-box,
/* Dynamic content containers */
.data-content,
.content-section,
.info-section,
.summary-section,
.detail-box,
.result-box,
.analysis-box,
/* Any divs inside report cards */
.report-card div,
.card-body div,
.collapse div,
/* Bootstrap components that might have white backgrounds */
.list-group,
.list-group-item,
.card,
.card-body,
.modal-content,
.modal-body,
.dropdown-menu,
.dropdown-item

.chartjs-render-monitor,
.chart-area,
.chart-canvas {
    background-color: transparent !important;
}

/* Utility Classes */
.text-primary {
    color: #74b9ff !important;
}

.bg-primary {
    background: linear-gradient(135deg, #0f3460 0%, #16213e 100%) !important;
}

.d-none {
    display: none !important;
}

.d-block {
    display: block !important;
}

/* Remove overly broad CSS rule that was breaking layout */

/* Restore normal layout - removed overly broad CSS rule */

/* Chart containers */
#priceChartContainer,
#dynamicChartContainer {
    background-color: #16213e !important;
    padding: 20px !important;
    border-radius: 8px !important;
    margin: 20px 0 !important;
    text-align: center;
    min-height: 450px !important;
    width: 100% !important;
}

/* Chart canvas styling - with proper dimensions */
#priceChart {
    background-color: #ffffff !important;
    border: 1px solid #ddd !important;
    border-radius: 8px !important;
    display: block !important;
    margin: 0 auto !important;
    width: 100% !important;
    max-width: 800px !important;
    min-width: 400px !important;
    height: 400px !important;
    min-height: 300px !important;
}

#dynamicPriceChart {
    background-color: #16213e !important;
    border: 1px solid #0f3460 !important;
    border-radius: 8px !important;
    display: block !important;
    margin: 0 auto !important;
    width: 100% !important;
    max-width: 800px !important;
    min-width: 400px !important;
    height: 400px !important;
    min-height: 300px !important;
}

/* Specific overrides for elements that might get white backgrounds */
p, span, div, ul, li, strong, em, small, h1, h2, h3, h4, h5, h6 {
    color: inherit !important;
}

/* Force dark backgrounds for specific containers that might get white */
.data-summary,
.flood-risk-container,
.sales-summary,
.property-summary,
.info-card,
.summary-card,
.stats-card {
    background-color: #16213e !important;
    color: #e1e5e9 !important;
    border: 1px solid #0f3460 !important;
}

/* Chart.js specific dark theme enforcement */
.chart-container canvas,
#priceChart,
#dynamicChart {
    background-color: #1a1a2e !important;
}

/* Animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.report-card {
    animation: fadeInUp 0.5s ease forwards;
}

.report-card:nth-child(1) { animation-delay: 0.1s; }
.report-card:nth-child(2) { animation-delay: 0.2s; }
.report-card:nth-child(3) { animation-delay: 0.3s; }
.report-card:nth-child(4) { animation-delay: 0.4s; }
.report-card:nth-child(5) { animation-delay: 0.5s; }
