#mainContainer {
    width: 100%;
}

.controls {

    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

button {
    padding: 10px 20px;
    border: 1px solid #333;
    background: var(--bg-panel);
    font-size: 14px;
    cursor: pointer;
}

button:hover {
    background: var(--highlight-bg);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

button.processing {
    background: #707070;
    color: #000;
}

.maps-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 0px;
}

.map-wrapper {
    border: 1px solid #ccc;
}

.map-wrapper h3 {
    background: #f0f0f0;
    padding: 10px;
    text-align: center;
    font-size: 16px;
    /* border-bottom: 1px solid #ccc; */
}

.map {
    width: 100%;
    height: 350px;
}

/* Loading Indicator - Simplified */
.loading-container {
    display: none;
    margin: 0px 0;
    padding: 15px;
   border: 1px solid var(--border-medium);
    background: white;
}


.loading-container.active {
    display: block;
}

.loading-header {
    text-align: left;
    margin-bottom: 10px;
    font-size: 13px;
    font-weight: normal;
}

.loading-bar {
    width: 100%;
    height: 15px;
    background: #e0e0e0;
    border-radius: 15px;
    overflow: hidden;
    border: 1px solid #333;
}

.loading-progress {
    height: 100%;
    background: linear-gradient(90deg, #34a853 0%, #5cb85c 100%);
    width: 0%;
    transition: width 0.3s ease;
    position: relative;
}

.loading-percentage {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-weight: bold;
    font-size: 14px;
    z-index: 10;
    text-shadow: 0 0 5px rgba(0,0,0,0.8);
    pointer-events: none;
    display: none;
}


#resultsPanel {
    /* border: 1px solid var(--border-medium); */
    /* padding: 10px; */
    margin-top: 10px;
}

#resultsPanel h2 {
    font-size: 18px;
    margin-bottom: 10px;
    border-bottom: 1px solid #ccc;
    padding-bottom: 8px;
}

#resultsPanel h3 {
    font-size: 16px;
    margin: 0px 0 5px 0;
}

#resultsPanel h4 {
    font-size: 14px;
    text-align: left;
    margin: 0px 0 5px 0;
}

/* Analysis boxes with borders */
.analysis-box {
   border: 1px solid var(--border-medium);
   padding: 10px;
   margin: 0px 0 10px 0;
}

.section {
    margin: 10px 0;
}

.summary-grid {
    font-size: 14px;
}

.summary-grid > div {
    margin-bottom: 5px;
    background: white;
}

/* Image Slider Container */
.img-slider-container {
    position: relative;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    overflow: hidden;
    border: 1px solid #333;
    aspect-ratio: 16/9;
}

.img-slider-container .base-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.overlay-image-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.overlay-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    clip-path: inset(0 50% 0 0);
}


/* Slider Handle & Controls */
.slider-handle {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 3px;
    height: 100%;
    background-color: white;
    cursor: ew-resize;
    z-index: 10;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
}

.slider-handle .knob {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 32px;
    height: 32px;
    background-color: #333;
    border: 3px solid white;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
    cursor: grab;
    z-index: 11;
}

.slider-handle::before,
.slider-handle::after {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 30px;
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.6);
    pointer-events: none;
    z-index: 9;
    background: none;
}

.slider-handle::before {
    content: "◄";
    right: calc(100% + 20px);
}

.slider-handle::after {
    content: "►";
    left: calc(100% + 20px);
}

.slider-instruction {
    position: absolute;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 7px 10px;
    border-radius: 4px;
    font-size: 21px;
    font-weight: bold;
    pointer-events: none;
    z-index: 12;
    transition: opacity 0.3s, visibility 0.3s;
}

.slider-instruction.hidden {
    opacity: 0;
    visibility: hidden;
}

.slider-instruction p {
    color: white !important;   /* forces white text */
    z-index: 1000;             /* ensures it appears above map layers */
}



.slider-instruction.hidden {
    opacity: 0;
    visibility: hidden;
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 5px;
    font-size: 13px;
    color: #666;
}

.slider-labels .label-left,
.slider-labels .label-right {
    font-weight: bold;
}

body.grabbing,
body.grabbing * {
    cursor: ew-resize !important;
}

/* Legends */
.legends-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}

.legend-box h4 {
    margin: 0 0 8px 0;
    padding-bottom: 5px;
    text-align: left;
    font-size: 14px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 4px 0;
    font-size: 13px;
}

.legend-color {
    width: 24px;
    height: 24px;
    border: 1px solid #333;
    display: inline-block;
    flex-shrink: 0;
}

/* Citation and methodology notes */
.methodology-notes {
    margin-top: 10px;
    padding: 10px;
    background: #ffffff;
    border: 1px solid #ddd;
    font-size: 13px;
    line-height: 1.6;
}

.methodology-notes h4 {
    margin: 0 0 8px 0;
    font-size: 14px;
}

.methodology-notes p {
    /* margin: 5px 0; */
}

/* Table Styles */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    background: white;
}

table th,
table td {
    padding: 8px;
    border: 1px solid #ddd;
    text-align: left;
    font-size: 13px;
}

table th {
    background: #f0f0f0;
    font-weight: bold;
}

table td:nth-child(2),
table td:nth-child(3),
table td:nth-child(4) {
    text-align: center;
}

table td.positive {
    color: #228b22;
}

table td.negative {
    color: #dc143c;
}


/* Location Search */
.location-search-container {
    margin-bottom: 10px;
    padding: 0px;
    border: 0px solid #333;
}

.location-search-container h3 {
    margin: 0 0 5px 0;
    font-size: 13px;
}

.search-wrapper {
    position: relative;
    display: flex;
    gap: 10px;
    align-items: center;
}

#locationSearch {
    width: 400px;
    padding: 10px 15px;
    border: 1px solid #333;
    font-size: 14px;
    box-sizing: border-box;
}

#locationSearch:focus {
    outline: none;
}

#classifyBtn {
    white-space: nowrap;
    font-weight: bold;
    padding: 10px 20px;
}

#classifyBtn:hover {
}

#classifyBtn:active {
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

#classifyBtn:disabled {
    box-shadow: none;
    transform: none;
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    width: 400px;
    background: white;
    border: 1px solid #333;
    border-top: none;
    max-height: 300px;
    overflow-y: auto;
    z-index: 10000;
    display: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.search-results.active {
    display: block;
}

.search-result-item {
    padding: 10px 15px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
    font-size: 13px;
    transition: background 0.15s;
}

.search-result-item:hover {
    background: #f5f5f5;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-name {
    font-weight: bold;
    margin-bottom: 2px;
    color: #333;
}

.search-result-details {
    font-size: 12px;
    color: #666;
}

.search-note {
    margin-top: 8px;
    font-size: 12px;
    color: #303030;
    line-height: 1.4;
}

.leaflet-control-attribution a {
  text-decoration: none;
  display: none;
}


/* Statistical Analysis Two-Column Layout */
.stats-two-column {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 5px;
}

.stats-left {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.stats-right {
    align-self: start;
}

.stats-section {
    margin-bottom: 5px;
    padding: 10px;
    border: 1px solid #ddd;
}

/* Simple row-based layout */
.stats-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    line-height: 1.4;
}

.stat-label {
    font-size: 13px;
}

.stat-value {
    font-size: 13px;
    font-weight: 500;
}

/* Text sections */
.explanation-text,
.interpretation-text {
    margin-top: 12px;
    font-size: 13px;
    line-height: 1.4;
}

.explanation-text p,
.interpretation-text p {
    margin: 8px 0;
}

/* Chart */
.chart-container {
    background: white;
    padding: 10px;
    border: 1px solid #ddd;
}

.regression-chart {
    width: 100%;
    height: auto;
    display: block;
}

.chart-description {
    margin-top: 10px;
    font-size: 13px;
    line-height: 1.4;
}

.chart-description p {
    margin: 0;
}

.no-data {
    color: #999;
    font-style: italic;
    margin: 5px 0;
    font-size: 13px;
}