/* Global Styles */
body {
    margin: 0;
    display: flex;
    flex-direction: column;
    height: 100vh;
    font-family: 'Open Sans', Helvetica, Tahoma, Arial, sans-serif;
    overflow: hidden;
    background-color: #f8fafc; /* Light bluish-white background */
}

.top-bar {
    background-color: #eef6ff; /* Very light blue header background */
    color: #000000; /* Dark text for header contrast */
    padding: 10px;
    text-align: left;
    font-size: 16px;
    font-weight: bold;
    flex-shrink: 0;
    position: relative;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.powered-by {
    font-size: 11px;
    color: #000000;
    text-decoration: none;
    margin-left: auto;
    margin-right: 10px;
    align-self: center;
}

.powered-by:hover {
    text-decoration: underline;
}

.logo {
    height: 40px;
    margin-right: 20px;
    display: inline-block;
    vertical-align: middle;
}

.top-bar span {
    vertical-align: middle;
}

.map-container {
    display: flex;
    flex-direction: column;
    flex: 1;
    position: relative;
    overflow: hidden;
    background-color: #f8fafc; /* Light bluish‐grey for the map container */
}

/* Common sidebar styles */
.sidebar {
    width: 270px;
    background-color: #ebf3fc; /* Soft blue sidebar background */
    color: #000000; /* Dark text for readability */
    padding: 10px;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    transition: transform 0.3s ease;
    position: absolute;
    top: 0;
    bottom: 0;
    z-index: 1000;
}

/* Specific styles for left sidebar */
.sidebar.left {
    left: 0;
    border-right: 1px solid #c9d6e8; /* Subtle border for contrast */
}

/* Specific styles for right sidebar */
.sidebar.right {
    right: 0;
    border-left: 1px solid #c9d6e8;
}

/* Adjusted title colours in the right sidebar */
.sidebar.right .pvgis-section h3,
.sidebar.right .wind-section h3 {
    color: #004a99; /* A deeper blue for headings */
}

/* Styles for bottom sidebar */
.sidebar.bottom {
    height: 300px;
    width: 100%;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    overflow-y: auto;
    padding: 10px;
    box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.1);
    background-color: #ebf3fc; /* Same soft blue as sidebars */
    transition: transform 0.3s ease;
}

.bottom-sidebar-hidden .sidebar.bottom {
    transform: translateY(100%);
}

.bottom-sidebar-hidden .map {
    height: 100%;
}

.left-sidebar-hidden .left {
    transform: translateX(-100%);
}

.right-sidebar-hidden .right {
    transform: translateX(100%);
}

.map {
    flex: 1;
    height: calc(100% - 150px);
    transition: height 0.3s ease;
    background-color: #f8fafc; 
}

.left-sidebar-hidden .map {
    margin-left: 0;
}

.right-sidebar-hidden .map {
    margin-right: 0;
}

.bottom-sidebar-hidden .map {
    height: 100%;
}

/* Toggle buttons */
.toggle-button {
    position: absolute;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 22px;
    color: #000000;
    z-index: 1000;
    transition: left 0.3s, right 0.3s, bottom 0.3s;
    background-color: #b8d4f8; /* Subtle blue */
    border-radius: 5px;
    box-shadow: 0 0 10px #ffffff;
    padding: 5px;
}




.hide-button {
    display: inline;
}

.show-button {
    display: none;
}

#toggleLeftSidebarButton,
#toggleLeftSidebarButtonHidden {
    left: 282px;
    top: 70px;
}

#toggleLeftSidebarButtonHidden {
    left: 10px;
}

#toggleRightSidebarButton,
#toggleRightSidebarButtonHidden {
    right: 282px;
    top: 70px;
}

#toggleRightSidebarButtonHidden {
    right: 10px;
}

.sidebar-hidden .sidebar {
    width: 0;
    padding: 0;
    overflow: hidden;
    box-shadow: none;
}

.sidebar-hidden .hide-button {
    display: none;
}

.sidebar-hidden .show-button {
    display: inline;
}

/* Layer group */
.layer-group {
    margin-bottom: 20px;
}

.layer-group .layer-item {
    display: flex;
    flex-direction: column;
    margin-bottom: 10px;
    position: relative;
}

.layer-group .layer-item .layer-header {
    display: flex;
    align-items: center;
}

.layer-group .layer-item input {
    pointer-events: auto;
    margin-right: 10px;
}

.layer-group .layer-item label {
    flex: 1;
    cursor: pointer;
    color: #000000;
}

.layer-group .layer-item .menu-button {
    background: none;
    border: none;
    cursor: pointer;
    margin-left: 5px;
    font-size: 20px;
    color: #0066cc; /* A clearer blue for the “…” button */
}

.layer-group .layer-item .context-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 25px;
    background: #ffffff;
    border: 1px solid #ccc;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

.sidebar.left .layer-item label {
    font-size: 13px; 
}

.layer-group .layer-item .context-menu.active {
    display: block;
}

.layer-group .layer-item .context-menu input[type="range"] {
    width: 100px;
}

.layer-group .layer-item .legend {
    display: none;
    font-size: 14px;
    padding-left: 20px;
}

/* Search container */
.search-container {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    background: #ffffff;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    flex-wrap: wrap;
}

.search-container input {
    border: none;
    outline: none;
    padding: 5px;
    width: 150px;
}

.scenario-container,
.coordinate-search {
    display: flex;
    align-items: center;
    gap: 5px;
}

.coordinate-search label {
    margin-left: 5px;
}

.coordinate-search input {
    width: 70px;
}

#goToLatLon {
    padding: 5px;
    margin-left: 5px;
    cursor: pointer;
}

.search-container ul {
    list-style: none;
    margin: 0;
    padding: 0;
    background: #ffffff;
    border: 1px solid #ccc;
    border-top: none;
    position: absolute;
    top: 35px;
    width: 100%;
    z-index: 1000;
}

.search-container ul li {
    padding: 5px;
    cursor: pointer;
}

.search-container ul li:hover {
    background: #efefef;
}

.scenario-container {
    margin-left: 10px;
}

.arrow-button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    margin-left: 5px;
    color: #0056b3;
}

/* Popup windows */
.popup {
    display: none;
    position: absolute;
    z-index: 10;
    background-color: #ffffff;
    box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.5);
    padding: 10px;
    border-radius: 5px;
}

.popup-content {
    position: relative;
}

.popup-close {
    position: absolute;
    top: 5px;
    right: 10px;
    cursor: pointer;
    font-size: 20px;
}

/* Sub-layers */
.sub-layers {
    display: none;
    padding-left: 20px;
}

.sub-layers.visible {
    display: block;
}

#coordinates {
    position: absolute;
    bottom: 35px;
    left: 280px;
    background: rgba(255, 255, 255, 0.7);
    padding: 5px;
    border-radius: 3px;
    transition: left 0.3s, right 0.3s;
}

#pickedCoordinates {
    margin-top: 10px;
    padding: 5px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 3px;
    border: 1px solid #ccc;
    color: #000000; 
}

/* Right sidebar inputs */
.sidebar.right input[type="number"],
.sidebar.right select,
.sidebar.right input[type="checkbox"] {
    width: 100%;
    padding: 5px;
    margin-top: 5px;
    margin-bottom: 10px;
    box-sizing: border-box;
    border: 1px solid #ccc;
    border-radius: 3px;
    background-color: #ffffff; /* White input background */
    color: #000000; 
}

.legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
}

.legend-item img {
    margin-right: 5px;
}

/* Menu */
.menu {
    position: absolute;
    right: 400px;
    top: 10px;
}

.menu ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.menu ul li {
    display: inline-block;
    position: relative;
}

.menu ul li a {
    text-decoration: none;
    color: #000000; 
    font-weight: bold;
    padding: 10px 20px;
    display: block;
    background-color: #ffffff;
}

.menu ul li a:hover {
    background-color: #efefef;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: #f9f9f9;
    min-width: 160px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 1;
}

.dropdown-content a {
    color: #000000;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
}

.dropdown-content a:hover {
    background-color: #ddd;
}

.show {
    display: block;
}

.layer-item.selected {
    background-color: #c8ddf2; /* Slight highlight with a bluish tint */
    border: 1px solid #777777;
}

/* Drawing toggle button */
.toggle-draw-button {
    background-color: #acd0f3; 
    border: 1px solid #89b3df;
    padding: 10px;
    cursor: pointer;
    color: #000000;
}

.toggle-draw-button.pressed {
    background-color: #89b3df;
    border: 1px solid #678fbf;
}

.section-name {
    font-weight: bold;
    color: #004a99; /* Blue highlight for section name */
}

.subsection-name {
    color: #556b8d; /* Subtle grey‐blue for subsection */
}

/* Tabs */
.tabs {
    display: flex;
    justify-content: space-around;
    background-color: #dce8f7; /* Light bluish background for tabs */
    border-bottom: 1px solid #c9d6e8;
}

.pvgis-tabs .tab-button, .bottom-tabs .tab-button {
    background-color: inherit;
    border: none;
    outline: none;
    cursor: pointer;
    padding: 14px 16px;
    transition: background-color 0.3s;
    font-size: 16px;
    color: #000000;
}

.pvgis-tabs .tab-button:hover, .bottom-tabs .tab-button:hover {
    background-color: #c9d6e8;
}

.pvgis-tabs .tab-button.active, .bottom-tabs .tab-button.active {
    background-color: #aac5e3; /* Slightly darker bluish for active tab */
}

.pvgis-tab-content, .bottom-tab-content {
    display: none;
    padding: 20px;
}

.pvgis-tab-content.active, .bottom-tab-content.active {
    display: block;
    background-color: #eef6ff; 
    color: #000000; 
}

/* Contact Form */
.content {
    padding: 20px;
    max-width: 1000px;
    width: 90%;
    margin: 20px auto;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    overflow: auto;
}

form label {
    display: block;
    margin: 10px 0 5px;
}

form input, form textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
    color: #000000;
}

form textarea {
    height: 250px;
    resize: vertical;
}

form button {
    background-color: #b8d4f8;
    color: #000000;
    border: none;
    padding: 10px 20px;
    margin-top: 10px;
    cursor: pointer;
    border-radius: 4px;
    font-size: 16px;
}

form button:hover {
    background-color: #98bbdd;
}

.footer {
    text-align: center;
    margin-top: 20px;
}

select[multiple] {
    width: 200px;
    height: 100px;
    overflow-y: auto;
    padding: 5px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: #ffffff;
    font-size: 14px;
}

select[multiple] option {
    padding: 3px;
    background-color: #ffffff;
    cursor: pointer;
}

select[multiple] option:hover {
    background-color: #efefef;
}

/* Select2 multi-select */
.select2-container .select2-selection--multiple {
    font-size: 12px;
    min-height: 34px;
    padding: 5px;
    box-sizing: border-box;
}

.select2-container .select2-selection--multiple .select2-selection__rendered {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.select2-container .select2-results__option {
    font-size: 12px;
}

.select2-container .select2-selection__choice {
    background-color: #eee;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 3px 5px;
    font-size: 12px;
    color: #333;
}

.select2-container .select2-selection__choice__remove {
    margin-right: 5px;
    color: #666;
    cursor: pointer;
}

.select2-container .select2-selection__choice__remove:hover {
    color: #444;
}

/* Select2 single‐select */
.select2-container--default .select2-selection--single {
    height: 34px;
    border-radius: 4px;
    border: 1px solid #ccc;
    background-color: #ffffff;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 34px;
    padding-left: 8px;
    color: #333;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 34px;
}

.select2-container--default .select2-dropdown {
    border-radius: 4px;
}

.select2-container .select2-selection--single {
    width: 200px; 
}

/* Action buttons */
.action-button, .add-label-button, .add-step-button, .remove-step-button, 
.add-operation-after-button, .remove-operation-button {
    background-color: #b8d4f8;
    color: #000000;
    border: none;
    padding: 5px 10px;
    margin: 5px;
    cursor: pointer;
    border-radius: 4px;
    font-size: 14px;
}

.action-button:hover, .add-label-button:hover, .add-step-button:hover, .remove-step-button:hover, 
.add-operation-after-button:hover, .remove-operation-button:hover {
    background-color: #98bbdd;
}

.step-container {
    margin: 10px 0;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: #f2f5fa; 
    color: #333333;
}

.operations {
    margin-top: 10px;
}

.operation {
    margin-left: 20px;
    padding: 5px;
    border: 1px dashed #ccc;
    background-color: #ffffff; 
    border-radius: 4px;
    color: #333333;
}

#addInitialStep {
    margin: 10px 0;
}

.step-number, .operation-number {
    font-weight: bold;
    margin-right: 5px;
    color: #333333;
}

.operation-label, .step-label {
    margin-left: 5px;
    color: #555555;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.4);
    padding-top: 60px;
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 400px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.close-button {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
}

.close-button:hover,
.close-button:focus {
    color: #000;
    text-decoration: none;
    cursor: pointer;
}

h2 {
    margin-top: 0;
}

/* Export GeoJSON button */
.export-geojson-button {
    background-color: #b8d4f8;
    color: #000000;
    border: none;
    padding: 5px 10px;
    margin-left: 10px;
    cursor: pointer;
    border-radius: 4px;
    font-size: 14px;
}

.export-geojson-button:hover {
    background-color: #98bbdd;
}

/* Energy buttons */
.energy-button {
    font-size: 18px; 
    padding: 2px 2px; 
    color: #000000;
    margin-left: 10px;
    background-color: #b8d4f8; 
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.energy-button:hover {
    background-color: #98bbdd;
}

.wind-button {
    margin-right: 10px;
}

.green-text {
    color: #008000; 
    font-weight: bold;
}

/* Energy output */
.energy-output {
    margin-top: 10px;
    padding: 5px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 3px;
    border: 1px solid #ccc;
}

.energy-output h3 {
    color: #004a99;
    font-size: 14px;
    margin-bottom: 10px;
}

.energy-output p {
    font-size: 14px;
    color: #333333;
}

.solar-energy, .wind-energy {
    border: 1px solid #ddd;
}

#solarEnergyValue, #windEnergyValue {
    font-weight: bold;
    color: #008000; 
}

.result-box {
    background-color: rgba(255, 255, 255, 0.9);
    padding: 10px;
    border-radius: 5px;
    border: 1px solid #ccc;
    margin-top: 10px;
}

.result-title {
    font-weight: bold;
    margin-bottom: 5px;
}

.output-box {
    background-color: rgba(255, 255, 255, 0.7);
    padding: 10px;
    border-radius: 5px;
    border: 1px solid #ccc;
    margin-top: 10px;
    font-size: 16px;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
    color: #000000;
}

/* Wind section */
.wind-section {
    text-align: center;
}

#enableWindGeoJSONPickingButton {
    display: inline-block;
    margin: 0 auto;
    padding: 5px 10px;
    font-size: 16px;
    background-color: #b8d4f8;
    color: #000000;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

#enableWindGeoJSONPickingButton:hover {
    background-color: #98bbdd;
}

/* Tool Container */
.tool-section {
    margin-bottom: 10px;
    padding: 10px;
    background-color: #ebf3fc; 
    color: #000000;
    border: 1px solid #ccc;
}

.tool-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.tool-header h3 {
    font-size: 16px !important;
    margin: 0;
}

.tool-header button {
    background-color: #b8d4f8;
    color: #000000;
    border: none;
    padding: 5px 10px;
    cursor: pointer;
    border-radius: 4px;
}

.tool-header button:hover {
    background-color: #98bbdd;
}

.tool-content {
    margin-top: 10px;
}

.tool-section.closed .tool-content {
    display: none;
}

/* Icon button */
.tool-header .icon-button {
    background-color: #b8d4f8;
    color: #000000;
    border: none;
    padding: 6px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tool-header .icon-button i {
    font-size: 18px;
}

/* Optional hover effect */
.tool-header .icon-button:hover {
    background-color: #98bbdd;
}

.icon-button {
    background-color: #b8d4f8;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    color: #000000;
    display: inline-flex; 
    align-items: center;
    justify-content: center;
    padding: 6px 8px;
    font-size: 16px;
    margin: 5px;
}

.icon-button:hover {
    background-color: #98bbdd;
}

.icon-button i {
    pointer-events: none;
}

.info-button {
    background: none;
    border: none;
    cursor: pointer;
    margin-left: 5px;
    color: #333;
    font-size: 16px;
}

.info-button i {
    color: #333;
}

.info-button:hover i {
    color: #0056b3;
}

/* Transparency overlay */
.transparency-overlay {
    display: none;
    position: absolute;
    left: 25px;
    top: 40px;
    background-color: #ffffff;
    border: 1px solid #ccc;
    padding: 10px;
    min-width: 150px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    z-index: 2000;
}

.transparency-overlay .overlay-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 5px;
}

.close-overlay-button {
    background: none;
    border: none;
    cursor: pointer;
    font-weight: bold;
    color: #666;
    font-size: 16px;
}

.close-overlay-button:hover {
    color: #000;
}

/* Bottom sidebar expansions */
.bottom-sidebar-expanded .sidebar.bottom {
    height: 100% !important; 
    top: 0;
    transform: translateY(0%);
}

.bottom-sidebar-expanded .map {
    height: 0;
    overflow: hidden;
}

#toggleBottomSidebarButton {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    background: #b8d4f8;
    color: #000000;
    font-size: 18px;
    cursor: pointer;
    padding: 5px 8px;
    border-radius: 4px;
    box-shadow: 0 0 5px #fff;
    border: none;
    transition: bottom 0.3s;
}

.bottom-sidebar-hidden #toggleBottomSidebarButton {
    bottom: 10px;
}

.map-container:not(.bottom-sidebar-hidden):not(.bottom-sidebar-expanded) #toggleBottomSidebarButton {
    bottom: 310px;
}

.bottom-sidebar-expanded #toggleBottomSidebarButton {
    display: none;
}

.modal-spinner {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    /* 
      Moves the box to the center of the screen. 
      (Because top/left=50% and translate -50% shifts it to actual center.)
    */
    background-color: #ffffff;
    border: 2px solid #888;
    border-radius: 8px;
    padding: 20px 30px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    z-index: 9999; /* or some large number to appear on top */
    text-align: center;
  }
  
  .modal-spinner-content i {
    font-size: 28px;
    margin-right: 10px;
    vertical-align: middle;
  }
  
  /* Optionally darken the background behind the modal */
  body.show-spinner-modal::before {
    content: "";
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.35);
    z-index: 9998; /* behind the .modal-spinner but above page */
  }
  