:root {
  --chart-height-desktop: 85vh;
  --chart-height-mobile: 80vh;
}

body {
  background-color: var(--bs-dark);
  color: var(--bs-light);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

#header {
  background-color: var(--bs-dark);
  border-bottom: 1px solid var(--bs-border-color);
  padding: 0.75rem;
  text-align: center;
}

#header h1 {
  font-size: 2.5rem;
  margin: 0;
  color: #00ffd5;
  text-shadow: 0 0 7px #00ffd5,
               0 0 10px #00ffd5,
               0 0 21px #00ffd5,
               0 0 42px #0fa,
               0 0 82px #0fa,
               0 0 92px #0fa,
               0 0 102px #0fa,
               0 0 151px #0fa;
  font-family: "Trebuchet MS", sans-serif;
}

.container-fluid {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 1rem;
}

.chart-wrapper {
  background: var(--chart-bg); /* Updated for theming */
  border: 1px solid var(--bs-border-color);
  border-radius: var(--bs-border-radius);
  padding: 1rem;
  height: var(--chart-height-desktop);
  display: flex;
  flex-direction: column;
  margin: 1rem 0;
}

#candlestick_chart_div {
  width: 100%;
  height: 100%;
  flex-grow: 1;
}

.chat-window {
  display: none;
}

.input-group {
  background-color: var(--bs-dark);
  border: 1px solid var(--bs-border-color);
  border-radius: var(--bs-border-radius);
  padding: 0.25rem;
  margin-bottom: 0.5rem;
}

.input-group .form-control {
  border: none;
  background: transparent;
}

.input-group .btn {
  margin-left: 0.25rem;
  padding: 0.25rem 1rem;
}

.sma-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.5rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--bs-border-radius);
  margin: 0.5rem 0;
  width: 100%;
}

.form-check-inline {
  margin-right: 1rem;
}

.form-check-input:checked {
  background-color: var(--bs-primary);
  border-color: var(--bs-primary);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  #header h1 {
    font-size: 1.8rem;
  }

  .container-fluid {
    padding: 0.5rem;
  }

  .chart-wrapper {
    height: var(--chart-height-mobile);
    padding: 0.5rem;
    margin: 0.5rem 0;
  }

  .input-group {
    padding: 0.25rem;
  }

  .sma-selector {
    padding: 0.25rem;
    gap: 0.25rem;
  }

  .form-check-inline {
    margin-right: 0.5rem;
  }
}

/* Alert styles */
.alert {
  margin-bottom: 0.5rem;
  padding: 0.5rem;
}

.strategy-selector {
  display: flex;
  align-items: center;
  padding: 0.5rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--bs-border-radius);
  margin: 0.5rem;
}

.strategy-selector .form-check {
  margin: 0;
}

.strategy-selector .form-check-label {
  color: var(--bs-light);
  font-weight: 500;
}

@media (max-width: 768px) {
  .strategy-selector {
    width: 100%;
    margin: 0.25rem 0;
    padding: 0.25rem;
  }
}

/* Add theme toggle styles */
.theme-toggle {
  position: absolute;
  right: 1rem;
  top: 1rem;
}

/* Light mode styles */
[data-bs-theme="light"] {
  --chart-bg: #ffffff;
  --chart-text: #333333;
  --chart-grid: rgba(0, 0, 0, 0.1);
  --bs-dark: #ffffff; /* Add light background */
  --bs-light: #333333; /* Add light text color */

  #header h1 {
    color: #00806a;
    text-shadow: 0 0 7px #00806a,
                 0 0 10px #00806a,
                 0 0 21px #00806a,
                 0 0 42px #006a56,
                 0 0 82px #006a56,
                 0 0 92px #006a56,
                 0 0 102px #006a56,
                 0 0 151px #006a56;
  }
}

[data-bs-theme="dark"] {
  --chart-bg: transparent;
  --chart-text: var(--bs-light);
  --chart-grid: rgba(197, 203, 206, 0.2);
}

/* Add loading spinner styles */
.loading-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: none;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.5);
  padding: 2rem;
  border-radius: 1rem;
  backdrop-filter: blur(4px);
}

.loading-spinner.active {
  display: block;
  animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}