/* static/style.css */

/* --- Basic Setup --- */
html, body {
    margin: 0;
    padding: 0;
    height: 100vh;
    width: 100vw;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    overflow: hidden;
}

/* --- Main Page Layout --- */
body {
    display: flex;
    flex-direction: column; /* Stack header and main content vertically */
}

/* --- Header Styling --- */
#app-header {
    padding: 10px 20px;
    /* --- THIS IS THE ONLY LINE THAT CHANGED --- */
    background-color: #4a6560; /* New header background color */
    border-bottom: 2px solid #e0e0e0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    flex-shrink: 0; /* Prevent header from shrinking */
    z-index: 1001; /* Ensure header is above the map controls */
}

#logo {
    height: 100px; /* Control the logo size */
    vertical-align: middle;
}

/* --- Main Content Wrapper --- */
#main-content {
    display: flex;
    flex-direction: row; /* Arrange map and panel side-by-side */
    flex-grow: 1; /* Allow this section to fill remaining vertical space */
    height: 100%;
    overflow: hidden;
}

/* --- Map Container --- */
#map {
    flex-grow: 1;
    height: 100%;
}

/* --- Info Panel --- */
#info-panel {
    width: 350px;
    flex-shrink: 0;
    padding: 20px;
    box-sizing: border-box;
    overflow-y: auto;
    background-color: #ffffff;
    border-left: 1px solid #ccc;
}

#info-panel h2 {
    margin-top: 0;
    border-bottom: 2px solid #333;
    padding-bottom: 10px;
}

#instructions ol { padding-left: 20px; }
#results h3 { margin-bottom: 5px; }
#results ul { list-style-type: none; padding-left: 0; }
#results li {
    background-color: #f9f9f9;
    padding: 8px;
    border-radius: 4px;
    margin-bottom: 5px;
    font-family: monospace;
}

#clear-button {
    margin-top: 20px;
    padding: 10px 15px;
    border: none;
    background-color: #d9534f;
    color: white;
    border-radius: 5px;
    cursor: pointer;
    width: 100%;
    font-size: 16px;
}

#clear-button:disabled { background-color: #ccc; cursor: not-allowed; }
#clear-button:hover:not(:disabled) { background-color: #c9302c; }

/* --- Side Panel Checkbox Styling --- */
.results-divider {
    font-weight: bold;
    color: #555;
    margin-top: 15px;
    margin-bottom: 5px;
    text-align: center;
    background-color: transparent !important;
}
.side-item-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    width: 100%;
    padding: 2px 0;
}
.house-side-checkbox {
    margin-right: 12px;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* --- Map Label Styling --- */
.leaflet-tooltip.line-label {
    background: white;
    border: 1px solid #555;
    border-radius: 3px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.4);
    opacity: 0.95;
    pointer-events: none;
    white-space: nowrap;
    padding: 2px 5px;
    margin: 0;
}
.leaflet-tooltip.line-label .leaflet-tooltip-content {
    color: #333;
    font-size: 12px;
    font-weight: bold;
    text-align: center;
    line-height: 1.2;
    background: none;
    margin: 0;
    padding: 0;
}
.leaflet-tooltip.line-label::before {
    display: none;
}

/* Add these new styles to your existing CSS file */

/* --- Styles for New Home Page --- */

#main-content.centered-content {
    justify-content: center;
    align-items: center;
    background-color: #f4f4f4;
}

.search-container {
    max-width: 600px;
    width: 100%;
    padding: 40px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    text-align: center;
}

.search-container h1 {
    margin-top: 0;
    color: #333;
}

.autocomplete-container {
    position: relative;
    margin-top: 20px;
}

#address-input {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}

.suggestions-hidden {
    display: none;
}

#suggestions-box {
    position: absolute;
    width: 100%;
    border: 1px solid #ccc;
    border-top: none;
    max-height: 200px;
    overflow-y: auto;
    background-color: white;
    z-index: 1000;
}

.suggestion-item {
    padding: 10px;
    cursor: pointer;
    text-align: left;
}

.suggestion-item:hover {
    background-color: #f0f0f0;
}

#submit-button {
    margin-top: 20px;
    padding: 12px 20px;
    font-size: 16px;
    color: white;
    background-color: #28a745;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

#submit-button:disabled {
    background-color: #aaa;
    cursor: not-allowed;
}

#submit-button:hover:not(:disabled) {
    background-color: #218838;
}

/* --- Loader Spinner --- */
.loader-hidden {
    display: none !important;
}

#loader {
    margin: 20px auto 0;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #4a6560;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Modal */
.modal.hidden { display: none; }
.modal {
  position: fixed; inset: 0; background: rgba(0,0,0,0.45);
  display: flex; align-items: center; justify-content: center; z-index: 2000;
}
.modal-content {
  background: #fff; width: 420px; max-width: 92vw; border-radius: 8px;
  padding: 20px; box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}
.modal-close { float: right; cursor: pointer; font-size: 22px; }
#price-form { display: grid; grid-template-columns: 1fr; gap: 10px; }
#price-form input, #price-form select { padding: 10px; font-size: 15px; }
#pm-submit { padding: 12px; font-size: 16px; background: #28a745; color: #fff; border: 0; border-radius: 4px; cursor: pointer; }
#pm-submit:disabled { opacity: .6; cursor: not-allowed; }
#pm-status { margin-top: 10px; font-size: 14px; }

/* Primary CTA button in side panel */
#info-panel .primary {
  margin-top: 10px; padding: 10px 15px; border: none; border-radius: 5px; cursor: pointer; width: 100%;
  background: #0070f3; color: #fff; font-size: 16px;
}
#info-panel .primary:disabled { background: #aaa; cursor: not-allowed; }

#map.snapshot-mode .leaflet-pane,
#map.snapshot-mode .leaflet-map-pane,
#map.snapshot-mode .leaflet-tile-pane,
#map.snapshot-mode .leaflet-overlay-pane,
#map.snapshot-mode .leaflet-objects-pane,
#map.snapshot-mode .leaflet-tooltip-pane,
#map.snapshot-mode .leaflet-popup-pane,
#map.snapshot-mode .leaflet-zoom-animated {
  transform: none !important;
}

/* --- New Styles for Price Display in Modal --- */
#price-result-view.hidden,
#price-entry-view.hidden {
    display: none;
}

.price-highlight {
    font-size: 2.5em;
    font-weight: bold;
    color: #28a745;
    text-align: center;
    margin: 20px 0;
    padding: 15px;
    background-color: #f0f8f2;
    border-radius: 8px;
    border: 2px dashed #28a745;
}

.small-text {
    font-size: 0.9em;
    color: #666;
    text-align: center;
    margin-top: 15px;
}


/* static/style.css */

/* --- Basic Setup --- */
html, body {
    margin: 0; padding: 0; height: 100vh; width: 100vw;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    overflow: hidden;
}

/* --- Layout --- */
body { display: flex; flex-direction: column; }
#app-header {
    padding: 10px 20px; background-color: #4a6560; border-bottom: 2px solid #e0e0e0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05); flex-shrink: 0; z-index: 1001;
}
#logo { height: 100px; vertical-align: middle; }
#main-content { display: flex; flex-direction: row; flex-grow: 1; height: 100%; overflow: hidden; }
#map { flex-grow: 1; height: 100%; }

/* --- Info Panel --- */
#info-panel {
    width: 350px; flex-shrink: 0; padding: 20px; box-sizing: border-box;
    overflow-y: auto; background-color: #ffffff; border-left: 1px solid #ccc;
}
#info-panel h2 { margin-top: 0; border-bottom: 2px solid #333; padding-bottom: 10px; }
#instructions ol { padding-left: 20px; }
#results h3 { margin-bottom: 5px; }
#results ul { list-style-type: none; padding-left: 0; }
#results li { background-color: #f9f9f9; padding: 8px; border-radius: 4px; margin-bottom: 5px; font-family: monospace; }
.results-divider { font-weight: bold; color: #555; margin-top: 15px; text-align: center; background-color: transparent !important; }

/* --- Buttons --- */
#clear-button {
    margin-top: 20px; padding: 10px 15px; border: none; background-color: #d9534f;
    color: white; border-radius: 5px; cursor: pointer; width: 100%; font-size: 16px;
}
#clear-button:disabled { background-color: #ccc; cursor: not-allowed; }
#clear-button:hover:not(:disabled) { background-color: #c9302c; }
#info-panel .primary {
    margin-top: 10px; padding: 10px 15px; border: none; border-radius: 5px; cursor: pointer; width: 100%;
    background: #0070f3; color: #fff; font-size: 16px;
}
#info-panel .primary:disabled { background: #aaa; cursor: not-allowed; }

/* --- Side Panel Checkbox Styling --- */
.side-item-label { display: flex; align-items: center; cursor: pointer; width: 100%; padding: 2px 0; }
.house-side-checkbox { margin-right: 12px; width: 18px; height: 18px; flex-shrink: 0; }

/* --- Map Label Styling --- */
.leaflet-tooltip.line-label { background: white; border: 1px solid #555; border-radius: 3px; box-shadow: 0 1px 3px rgba(0,0,0,0.4); opacity: 0.95; pointer-events: none; white-space: nowrap; padding: 2px 5px; margin: 0; }
.leaflet-tooltip.line-label .leaflet-tooltip-content { color: #333; font-size: 12px; font-weight: bold; text-align: center; line-height: 1.2; background: none; margin: 0; padding: 0; }
.leaflet-tooltip.line-label::before { display: none; }

/* --- Home Page Styles --- */
#main-content.centered-content { justify-content: center; align-items: center; background-color: #f4f4f4; }
.search-container { max-width: 600px; width: 100%; padding: 40px; background: white; border-radius: 8px; box-shadow: 0 4px 15px rgba(0,0,0,0.1); text-align: center; }
.search-container h1 { margin-top: 0; color: #333; }
.autocomplete-container { position: relative; margin-top: 20px; }
#address-input { width: 100%; padding: 12px; font-size: 16px; border: 1px solid #ccc; border-radius: 4px; box-sizing: border-box; }
.suggestions-hidden { display: none; }
#suggestions-box { position: absolute; width: 100%; border: 1px solid #ccc; border-top: none; max-height: 200px; overflow-y: auto; background-color: white; z-index: 1000; }
.suggestion-item { padding: 10px; cursor: pointer; text-align: left; }
.suggestion-item:hover { background-color: #f0f0f0; }
#submit-button { margin-top: 20px; padding: 12px 20px; font-size: 16px; color: white; background-color: #28a745; border: none; border-radius: 4px; cursor: pointer; transition: background-color 0.2s; }
#submit-button:disabled { background-color: #aaa; cursor: not-allowed; }
#submit-button:hover:not(:disabled) { background-color: #218838; }
.loader-hidden { display: none !important; }
#loader { margin: 20px auto 0; border: 5px solid #f3f3f3; border-top: 5px solid #4a6560; border-radius: 50%; width: 40px; height: 40px; animation: spin 1s linear infinite; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* --- Modal --- */
.modal.hidden { display: none; }
.modal { position: fixed; inset: 0; background: rgba(0,0,0,0.45); display: flex; align-items: center; justify-content: center; z-index: 2000; }
.modal-content { background: #fff; width: 420px; max-width: 92vw; border-radius: 8px; padding: 20px; box-shadow: 0 10px 30px rgba(0,0,0,0.2); max-height: 90vh; overflow-y: auto; }
.modal-close { float: right; cursor: pointer; font-size: 22px; font-weight: bold; }
#price-form { display: grid; grid-template-columns: 1fr; gap: 12px; }
#price-form label { font-weight: bold; font-size: 0.9em; margin-bottom: -5px; }
#price-form input, #price-form select { padding: 10px; font-size: 15px; border-radius: 4px; border: 1px solid #ccc; width: 100%; box-sizing: border-box; }
#pm-submit { padding: 12px; font-size: 16px; background: #28a745; color: #fff; border: 0; border-radius: 4px; cursor: pointer; transition: background-color 0.2s; }
#pm-submit:hover { background-color: #218838; }
#pm-submit:disabled { opacity: .6; cursor: not-allowed; }
#pm-status { margin-top: 10px; font-size: 14px; text-align: center; }
#price-result-view.hidden, #price-entry-view.hidden { display: none; }
.price-highlight { font-size: 2.5em; font-weight: bold; color: #28a745; text-align: center; margin: 20px 0; padding: 15px; background-color: #f0f8f2; border-radius: 8px; border: 2px dashed #28a745; }
.small-text { font-size: 0.9em; color: #666; text-align: center; margin-top: 15px; }

/* For html2canvas rendering */
#map.snapshot-mode .leaflet-pane, #map.snapshot-mode .leaflet-map-pane,
#map.snapshot-mode .leaflet-tile-pane, #map.snapshot-mode .leaflet-overlay-pane,
#map.snapshot-mode .leaflet-objects-pane, #map.snapshot-mode .leaflet-tooltip-pane,
#map.snapshot-మpane, #map.snapshot-mode .leaflet-zoom-animated { transform: none !important; }


/* --- NEW: Color Selector Styles --- */
#pm-color-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    border: 1px solid #ccc;
    padding: 8px;
    border-radius: 4px;
    margin-top: 5px;
}

.color-option {
    position: relative;
}

.color-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.color-option label {
    display: flex;
    align-items: center;
    padding: 8px;
    border: 2px solid transparent;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
    background-color: #f9f9f9;
}

.color-option label:hover {
    background-color: #eef;
}

.color-option input[type="radio"]:checked + label {
    border-color: #0070f3;
    background-color: #e6f0ff;
}

.color-swatch-img {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    margin-right: 10px;
    border: 1px solid #ddd;
    object-fit: cover;
}

.color-option label span {
    font-size: 14px;
    font-weight: normal;
}

