/* Terrain View Button */
.terrain-view-btn {
    position: absolute;
    right: 10px;
    top: 310px;
    padding: 10px;
    background: linear-gradient(135deg, #25292e, #383e47);
    color: #e0e0e0;
    border: 1px solid #456789;
    border-radius: 8px;
    cursor: pointer;
    z-index: 1000;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
}

.terrain-view-btn:hover {
    background-color: #3d566e;
    color: #D18F3A;
    border-color: #D18F3A;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.terrain-view-btn svg {
    width: 24px;
    height: 24px;
}

/* Terrain View Container */
.terrain-view-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 2000;
    display: none;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.terrain-view-container.visible {
    display: block;
    opacity: 1;
}

/* Controls */
.terrain-controls {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2001;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.terrain-close-btn {
    background: rgba(50, 56, 63, 0.8);
    border: 1px solid #456789;
    color: #e0e0e0;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.terrain-close-btn:hover {
    background: rgba(209, 143, 58, 0.8);
    border-color: #e0e0e0;
}

.terrain-layers-btn {
    background: rgba(50, 56, 63, 0.8);
    border: 1px solid #456789;
    color: #e0e0e0;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.terrain-layers-btn:hover {
    background: rgba(209, 143, 58, 0.8);
    border-color: #e0e0e0;
}

/* Layer Panel */
.terrain-layers-panel {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(50, 56, 63, 0.8);
    border: 1px solid #456789;
    border-radius: 8px;
    padding: 15px;
    color: #e0e0e0;
    min-width: 200px;
    max-width: 300px;
    max-height: 80vh;
    overflow-y: auto;
    z-index: 2001;
    display: none;
}

.terrain-layers-panel.visible {
    display: block;
}

.terrain-layers-panel h3 {
    margin: 0 0 10px 0;
    color: #D18F3A;
    font-size: 16px;
    font-weight: 600;
}

.terrain-layer-item {
    display: flex;
    align-items: center;
    padding: 8px 5px;
    border-bottom: 1px solid rgba(69, 103, 137, 0.3);
}

.terrain-layer-item:last-child {
    border-bottom: none;
}

.terrain-layer-toggle {
    margin-right: 10px;
    appearance: none;
    width: 16px;
    height: 16px;
    border: 1px solid #456789;
    border-radius: 3px;
    background: #32383f;
    position: relative;
    cursor: pointer;
}

.terrain-layer-toggle:checked {
    background: #D18F3A;
}

.terrain-layer-toggle:checked::after {
    content: "✓";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 12px;
}

.terrain-layer-name {
    font-size: 14px;
    flex: 1;
}

/* Loading Indicator */
.terrain-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(50, 56, 63, 0.9);
    padding: 20px;
    border-radius: 8px;
    color: #e0e0e0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    z-index: 2002;
}

.terrain-loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #456789;
    border-top: 4px solid #D18F3A;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.terrain-loading-text {
    font-size: 14px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Cesium Overrides */
.cesium-viewer-bottom {
    display: none !important;
}

.cesium-viewer-toolbar {
    right: 60px !important;
    top: 10px !important;
}

.cesium-baseLayerPicker-dropDown {
    right: 60px !important;
}

/* Site info panel */
.terrain-site-info {
    position: absolute;
    bottom: 20px;
    left: 20px;
    background: rgba(50, 56, 63, 0.8);
    border: 1px solid #456789;
    border-radius: 8px;
    padding: 15px;
    color: #e0e0e0;
    max-width: 300px;
    z-index: 2001;
}

.terrain-site-info h3 {
    margin: 0 0 10px 0;
    color: #D18F3A;
    font-size: 16px;
    font-weight: 600;
}

.terrain-site-info p {
    margin: 5px 0;
    font-size: 14px;
}

.terrain-site-info-toggle {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    color: #e0e0e0;
    font-size: 16px;
    cursor: pointer;
}

/* Compass */
.terrain-compass {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 80px;
    height: 80px;
    background: rgba(50, 56, 63, 0.8);
    border: 1px solid #456789;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2001;
}

.terrain-compass-inner {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #32383f;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.terrain-compass-needle {
    position: absolute;
    width: 4px;
    height: 30px;
    background: linear-gradient(to bottom, #D18F3A 0%, #D18F3A 50%, #fff 50%, #fff 100%);
    transform-origin: center center;
    transition: transform 0.2s ease;
}

.terrain-compass-marker {
    position: absolute;
    font-size: 10px;
    color: #e0e0e0;
}

.terrain-compass-n {
    top: 5px;
    left: 50%;
    transform: translateX(-50%);
}

.terrain-compass-e {
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
}

.terrain-compass-s {
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
}

.terrain-compass-w {
    left: 5px;
    top: 50%;
    transform: translateY(-50%);
}

/* Three.js terrain view styles */
.terrain-view-threejs-btn {
    position: absolute;
    right: 10px;
    top: 360px;
    padding: 10px;
    background: linear-gradient(135deg, #25292e, #383e47);
    color: #e0e0e0;
    border: 1px solid #456789;
    border-radius: 8px;
    cursor: pointer;
    z-index: 1000;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
}

.terrain-view-threejs-btn:hover {
    background-color: #3d566e;
    color: #D18F3A;
    border-color: #D18F3A;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.exaggeration-control {
    background: rgba(50, 56, 63, 0.8);
    border: 1px solid #456789;
    border-radius: 8px;
    padding: 10px;
    margin-top: 10px;
    color: #e0e0e0;
    display: flex;
    flex-direction: column;
    width: 180px;
}

.exaggeration-control label {
    margin-bottom: 5px;
    font-size: 14px;
}

.exaggeration-control input[type="range"] {
    width: 100%;
}

 .global-comparison-btn {
  position: absolute;
  right: 10px;
  bottom: 70px;
  padding: 10px 18px;
  background: linear-gradient(135deg, #25292e, #383e47);
  color: #e0e0e0;
  border: 1px solid #456789;
  border-radius: 25px;
  font-size: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  z-index: 1000;
}

.global-comparison-btn:hover {
  background-color: #3d566e;
  color: #D18F3A;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
  border-color: #D18F3A;
}

.global-comparison-btn::after {
  content: "Advanced data plotting and analysis module";
  font-family: 'Raleway', sans-serif;
  font-weight: 500;
  font-size: 14px;
  margin-left: 8px;
  color: inherit;
}


.gc-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
}

.gc-content {
  width: 90vw;
  height: 95vh;
  background: linear-gradient(135deg, #25292e, #383e47);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  position: relative;
  margin-right: calc(100vw - 100%);
  overflow: hidden;
}


.gc-header {
  flex: 0 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.3rem;
  background: #383e47;
  border-bottom: 1px solid #456789;
}


.gc-tab-content {
  flex: 1;
  width: 100%;
  box-sizing: border-box;
  overflow: hidden;
  position: relative;
}

.gc-chart-container, .gc-scatter-plot, .gc-variable-selectors, .gc-regression-controls {
  background: linear-gradient(135deg, #25292e, #383e47);
}

  .gc-header-left {
    display: flex;
    align-items: center;
  }
  
  .gc-header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
  }
  
  .gc-header h2 {
    color: #D18F3A;
    margin: 0;
    font-size: 1.5rem;
  }
  
  .gc-close {
    background: none;
    border: none;
    color: #ecf0f1;
    font-size: 24px;
    cursor: pointer;
    padding: 0.5rem;
    line-height: 1;
    border-radius: 4px;
    transition: background-color 0.2s;
  }
  
  .gc-close:hover {
    background: rgba(231, 76, 60, 0.15);
}

.gc-export-btn:hover {
  background: rgba(60, 231, 74, 0.15);
}

  .gc-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
  }
  
  .gc-tab {
    color: #bdc3c7;
    padding: 0.25rem 0.75rem;
    font-size: 1.1rem;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: color 0.2s, border-bottom-color 0.2s;
  }
  
  .gc-tab:hover {
    color: #D18F3A;
    border-bottom-color: #D18F3A;
  }
  
  .gc-tab.active {
    color: #D18F3A;
    border-bottom-color: #D18F3A;
  }

/* First tab specific styles */
#compare-tab {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}
  
  .gc-chart-buttons {
    flex: 0 0 auto;
    position: sticky;
    top: 0;
    padding: 0.5rem;
    background: linear-gradient(135deg, #25292e, #383e47);
    z-index: 2;
    display: flex;
    gap: 0.5rem;
    border-bottom: 1px solid #456789;
  }
  
  .gc-add-chart {
    background: linear-gradient(135deg, #2a2e35, #3d4a57);
    color: #ecf0f1;
    border: 1px solid #456789;
    padding: 0.25rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
  }
  
  .gc-add-chart:hover {
    background: #3d566e;
    border-color: #D18F3A;
  }
  
  #gc-charts-container {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
    height: calc(100% - 50px); /* Adjust based on gc-chart-buttons height */
    scrollbar-width: thin;
    scrollbar-color: #456789 #2c3e50;
  }
  
  #gc-charts-container::-webkit-scrollbar {
    width: 8px;
  }
  
  #gc-charts-container::-webkit-scrollbar-track {
    background: #25292e;
  }
  
  #gc-charts-container::-webkit-scrollbar-thumb {
    background-color: #456789;
    border-radius: 4px;
    border: 2px solid #25292e;
  }
  

  .gc-chart-container, .gc-scatter-plot, .gc-variable-selectors, .gc-regression-controls {
    background: linear-gradient(135deg, #25292e, #383e47);
  }

  .gc-chart-body {
    padding: 0.5rem;
  }

  .gc-chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #2a2e35;
    border-bottom: 1px solid #456789;
  }
  
  .gc-chart-header h3 {
    font-size: 1rem;
    margin: 0;
    color: #ecf0f1;
  }
  
  .gc-chart-actions {
    display: flex;
    gap: 0.5rem;
  }
  
  .gc-export-btn {
    background: none;
    border: none;
    color: #ecf0f1;
    cursor: pointer;
    padding: 0.3rem;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: background-color 0.2s;
  }
  
.gc-add-variable-row {
  display: flex;
  gap: 0.5rem;
}

.gc-select-site,
.gc-select-variable,
.gc-regression-controls select {
  width: 100%;
  background: linear-gradient(135deg, #25292e, #383e47);
  color: #ecf0f1;
  border: 1px solid #456789;
  border-radius: 4px;
  margin-bottom: 0.5rem;
}
  
.gc-select-site:hover,
.gc-select-variable:hover,
.gc-regression-controls select:hover {
  border-color: #D18F3A;
  background: rgba(255, 255, 255, 0.1);
}

  .gc-btn-add-variable {
    background: linear-gradient(135deg, #3a3f47, #484e57);
    color: #e0e0e0;
    border: 1px solid #A67C32;
    padding: 0.3rem 0.75rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
  }
  
  .gc-btn-add-variable:hover {
    background: #3d566e;
    border-color: #D18F3A;
    color: #D18F3A;
  }
  
  .gc-btn-add-variable:disabled {
    background: #5a5e66;
    border-color: #666b74;
    color: #95a5a6;
    cursor: not-allowed;
  }
  
  
  .gc-btn-add-variable:disabled {
    background: #95a5a6;
    cursor: not-allowed;
  }
  
  .gc-aggregation-controls {
    display: flex;
    gap: 0.25rem;
    margin: 0.5rem 0;
  }
  
  .gc-aggregation-btn {
    background: linear-gradient(135deg, #25292e, #383e47);
    color: #ecf0f1;
    border: 1px solid #456789;
    padding: 0.25rem 0.5rem;
    font-size: 0.85rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
  }
  
  .gc-aggregation-btn.active {
    background: #A67C32;
    border-color: #D18F3A;
  }
  
  .gc-aggregation-btn:hover:not(.active) {
    background: #3d566e;
    border-color: #D18F3A;
  }






.gc-error {
  color: #e74c3c;
  text-align: center;
  padding: 1rem;
  background: rgba(231, 76, 60, 0.1);
  border-radius: 4px;
  margin: 1rem;
}


.gc-loading-container {
  margin: 1rem;
  width: calc(100% - 2rem);
  text-align: center;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1000;
}

.gc-loading-bar {
  width: 100%;
  height: 4px;
  background: #32383f;
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.gc-loading-progress {
  width: 0%;
  height: 100%;
  background: #A67C32;
  position: absolute;
  left: 0;
  transition: width 0.3s ease;
}

.gc-loading-text {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: #b0b0b0;
}

.gc-chart-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(42, 46, 53, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 999;
}

