

/* Statistics Tab Styles */
.stats-container {
    display: flex;
    height: 100%;
    overflow: hidden;
  }
  
  .stats-controls {
    display: flex;
    flex-direction: column;
    width: 250px;
    padding: 1rem;
    background: linear-gradient(135deg, #25292e, #383e47);
    border-right: 1px solid #456789;
    overflow-y: auto;
  }
  
  .stats-selection-panel, 
  .stats-functions-panel {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
  }
  
  .stats-selection-panel h3,
  .stats-functions-panel h3 {
    color: #D18F3A;
    margin: 0 0 1rem 0;
    font-size: 1.1rem;
  }
  
  .stats-selection-panel h4 {
    color: #ecf0f1;
    margin: 1rem 0 0.5rem 0;
    font-size: 0.95rem;
  }
  
  .stats-site-selection,
  .stats-variable-selection,
  .stats-time-range {
    margin-bottom: 1rem;
  }
  
  .stats-variables-list {
    max-height: 200px;
    overflow-y: auto;
    margin-top: 0.5rem;
    border: 1px solid #456789;
    border-radius: 4px;
    padding: 0.5rem;
  }
  
  .stats-variable-checkbox {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
  }
  
  .stats-variable-checkbox input {
    margin-right: 0.5rem;
  }
  
  .stats-time-controls label {
    display: block;
    margin-bottom: 0.5rem;
  }
  
  .stats-custom-range {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.5rem;
    padding-left: 1.5rem;
  }
  
  .stats-date-input {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
  }
  
  .stats-date-input input {
    background: #32383f;
    border: 1px solid #456789;
    color: #ecf0f1;
    padding: 0.25rem;
    border-radius: 4px;
  }
  
  .stats-function-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
  }
  
  .stats-calculate-btn {
    width: 100%;
    padding: 0.5rem;
    background: #A67C32;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
  }
  
  .stats-calculate-btn:hover:not(:disabled) {
    background: #D18F3A;
  }
  
  .stats-calculate-btn:disabled {
    background: #5a5a5a;
    cursor: not-allowed;
  }
  
  .stats-results-container {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
  }
  
  .stats-results-container h3 {
    color: #D18F3A;
    margin: 0 0 1rem 0;
    font-size: 1.1rem;
  }
  
  .stats-results {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
  }
  
  .stats-placeholder {
    color: #95a5a6;
    font-style: italic;
    text-align: center;
    padding: 2rem;
  }
  
  .stats-result-panel {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
  }
  
  .stats-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
  }
  
  .stats-table th, 
  .stats-table td {
    border: 1px solid #456789;
    padding: 0.5rem;
    text-align: left;
  }
  
  .stats-table th {
    background: rgba(0, 0, 0, 0.2);
  }
  
  .stats-chart {
    height: 400px;
    margin-bottom: 1rem;
  }
  
  .stats-correlation-matrix {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 1rem;
  }

  .stats-regression-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    align-items: center;
  }
  
  .stats-regression-select {
    flex: 1;
    background: #32383f;
    border: 1px solid #456789;
    padding: 6px 10px;
    color: #ecf0f1;
    border-radius: 4px;
  }

  .stats-apply-btn {
    background: #A67C32;
    border: none;
    padding: 8px 16px;
    color: #fff;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
  }
  
  .stats-apply-btn:hover {
    background: #D18F3A;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
  }
  
  .stats-apply-btn:active {
    transform: translateY(0);
  }

/* Warning message for correlation analysis */
.stats-warning {
  background: rgba(241, 196, 15, 0.1);
  border-left: 4px solid #f1c40f;
  padding: 15px;
  margin: 15px 0;
  border-radius: 0 4px 4px 0;
  color: #ecf0f1;
}

.stats-warning p {
  margin: 5px 0;
}

/* Info message */
.stats-info {
  background: rgba(41, 128, 185, 0.1);
  border-left: 4px solid #3498db;
  padding: 15px;
  margin: 15px 0;
  border-radius: 0 4px 4px 0;
  color: #ecf0f1;
}

.stats-info p {
  margin: 5px 0;
}

/* Make correlation controls more flexible */
.stats-correlation-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  background: rgba(0, 0, 0, 0.2);
  padding: 15px;
  border-radius: 6px;
  width: 100%;
  gap: 20px;
}


/* Improved regression controls */
.stats-regression-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  margin-bottom: 15px;
  align-items: flex-end;
  background: rgba(0, 0, 0, 0.2);
  padding: 15px;
  border-radius: 6px;
}

.stats-regression-controls > div {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.stats-regression-controls label {
  display: block;
  margin-bottom: 4px;
  font-weight: 500;
  color: #D18F3A;
}



/* Improved correlation result panel */
.stats-correlation-result {
  margin-top: 15px;
  background: rgba(0, 0, 0, 0.2);
  padding: 15px;
  border-radius: 6px;
  line-height: 1.5;
}

.stats-correlation-result p {
  margin: 5px 0;
}

/* More space between regression charts */
#regression-chart {
  margin-bottom: 30px;
}

/* Add these new styles to statistics.css */

/* Variable display for correlation X and Y */
.variable-display {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(0, 0, 0, 0.15);
  padding: 12px 15px;
  border-radius: 6px;
  margin-bottom: 10px;
  width: 100%;
  flex-wrap: wrap;
  gap: 10px;
}


.variable-display .axes-info {
  flex: 1;
}

.variable-display p {
  margin: 5px 0;
  font-size: 0.95rem;
}

.variable-display strong {
  color: #D18F3A;
}

.stats-swap-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #34495e;
  border: 1px solid #456789;
  color: #ecf0f1;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
  height: fit-content;
  white-space: nowrap;
}

.stats-swap-btn:hover {
  background: #3d566e;
  border-color: #D18F3A;
  color: #D18F3A;
}

.stats-swap-btn:active {
  transform: translateY(1px);
}

.stats-swap-btn svg {
  transition: transform 0.2s ease;
}

.stats-swap-btn:hover svg {
  transform: scale(1.1);
}

/* Patterns controls */
.stats-patterns-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  margin-bottom: 15px;
  align-items: flex-end;
  background: rgba(0, 0, 0, 0.2);
  padding: 15px;
  border-radius: 6px;
}

.stats-patterns-controls > div {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.stats-patterns-controls label {
  display: block;
  margin-bottom: 4px;
  font-weight: 500;
  color: #D18F3A;
}

.correlation-regression {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.correlation-regression p {
  margin: 0 0 5px 0;
  font-size: 0.95rem;
}

.correlation-regression strong {
  color: #D18F3A;
}

.regression-input-group {
  display: flex;
  gap: 10px;
  align-items: center;
}

.regression-input-group .stats-select {
  min-width: 180px;
  background: #32383f;
  border: 1px solid #456789;
  color: #ecf0f1;
  padding: 6px 10px;
  border-radius: 4px;
}
/* Function selection for statistics module */
.stats-functions-panel .checkbox-group {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.stats-function-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px;
  border-radius: 4px;
  transition: background-color 0.2s ease;
}

.stats-function-checkbox:hover {
  background-color: rgba(255, 255, 255, 0.05);
}

.stats-function-checkbox input {
  margin: 0;
}

.regression-selection {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex: 2;
}

.regression-selection label {
  display: block;
  margin-bottom: 4px;
  font-weight: 500;
  color: #D18F3A;
}

.regression-selection .stats-select {
  flex: 1;
  min-width: 180px;
}

.axes-display {
  display: flex;
  align-items: center;
  gap: 15px;
  flex: 1;
  justify-content: flex-end;
}

.correlation-controls-container {
  display: flex;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.2);
  padding: 15px;
  border-radius: 6px;
  margin-bottom: 15px;
}

.correlation-axis-display {
  display: flex;
  align-items: center;
  gap: 15px;
  background: rgba(0, 0, 0, 0.15);
  padding: 10px 15px;
  border-radius: 6px;
}

.axis-labels p {
  margin: 5px 0;
  font-size: 0.95rem;
  color: #ecf0f1;
}

.axis-labels strong {
  color: #D18F3A;
}

.axis-labels strong {
  color: #D18F3A;
}

@media (max-width: 1000px) {
  .stats-correlation-controls {
    flex-direction: column;
    align-items: stretch;
  }
  
  .regression-selection {
    margin-bottom: 15px;
    flex-wrap: wrap;
  }
  
  .axes-display {
    justify-content: space-between;
  }
}

@media (max-width: 600px) {
  .regression-selection {
    flex-direction: column;
    align-items: stretch;
  }
  
  .axes-display {
    flex-direction: column;
    align-items: stretch;
  }
  
  .stats-apply-btn {
    width: 100%;
    margin-top: 10px;
  }
}