/* General Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', sans-serif;
  background: linear-gradient(135deg, #0f2027, #203a43, #2c5364);
  color: white;
  line-height: 1.6;
  padding-top: 60px;
  text-align: center;
  min-height: 100vh;
}

main {
  padding: 20px;
  max-width: 960px;
  margin: 0 auto;
  margin-top: 60px;
}

.form-container {
  background-color: rgba(0, 0, 0, 0.25);
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0, 198, 255, 0.14);
  border: 1px solid rgba(255,255,255,0.05);
  backdrop-filter: blur(6px);
}

.form-container h2 {
  margin-bottom: 20px;
  font-size: 1.8rem;
  text-align: center;
  color: #00d9ff;
}

#stock-form {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}

#stock-symbol {
  padding: 10px;
  font-size: 1rem;
  width: 200px;
  border-radius: 5px;
  border: 1px solid #00c6ff;
  background: rgba(255,255,255,0.08);
  color: white;
}

button {
  padding: 10px 20px;
  background-color: #00c6ff;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.3s ease;
  box-shadow: none;
}

button:hover {
  background-color: #0072ff;
  transform: translateY(-1px);
  box-shadow: 0 1px 3px rgba(0, 198, 255, 0.08);
}

#prediction-results {
  background-color: rgba(0, 0, 0, 0.25);
  padding: 20px;
  border-radius: 12px;
  margin-top: 30px;
  box-shadow: 0 4px 24px rgba(0, 198, 255, 0.14);
  backdrop-filter: blur(6px);
}

#prediction-results h3 {
  font-size: 1.8rem;
  margin-bottom: 20px;
  color: #00d9ff;
}

#buySellRecommendation, #buyAmountRecommendation {
  margin-top: 20px;
  font-size: 1.2rem;
  color: #b8d9ff;
}

.chart-controls {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-bottom: 15px;
  flex-wrap: wrap;
}

#chart-wrapper {
  margin-top: 20px;
  background-color: rgba(0, 0, 0, 0.25);
  padding: 15px;
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0, 198, 255, 0.14);
  border: 1px solid rgba(255,255,255,0.05);
  backdrop-filter: blur(6px);
}

#predictionChart {
  width: 100% !important;
  height: 400px !important;
  max-height: 600px;
  display: block;
  background-color: #111;
  border-radius: 8px;
}

footer {
  text-align: center;
  margin-top: 30px;
  font-size: 1rem;
  color: #888;
  user-select: none;
}

footer p {
  margin: 20px 0;
}

#nextDayButton {
  margin-top: 20px;
  padding: 10px 20px;
  background-color: #00c6ff;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  display: inline-block;
  transition: all 0.3s ease;
  box-shadow: none;
}

#nextDayButton:hover {
  background-color: #0072ff;
  transform: translateY(-1px);
  box-shadow: 0 1px 3px rgba(0, 198, 255, 0.08);
}

/* Spinner Styles */
#loading-spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 9999;
  background-color: rgba(0, 0, 0, 0.5);
  width: 100%;
  height: 100%;
}

.spinner {
  border: 8px solid #f3f3f3;
  border-top: 8px solid #00c6ff;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: spin 2s linear infinite;
}

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

#loading-spinner p {
  color: #fff;
  margin-top: 10px;
  font-size: 1.2rem;
}

@media (max-width: 720px) {
  #stock-form {
    flex-direction: column;
  }
  #stock-symbol {
    margin-bottom: 10px;
    width: 100%;
  }
  .chart-controls {
    flex-direction: column;
    gap: 10px;
  }
  #predictionChart {
    height: auto !important;
    max-height: 90vw;
    aspect-ratio: 16 / 9;
  }
  #predictionChart .chartjs-render-monitor {
    font-size: 0.7rem;
  }
}
#aiInsights {
  position: relative;
  z-index: 2;
  font-size: 1.2rem;
  font-weight: 500;
  color: #b8d9ff;
  text-shadow: 0 2px 6px rgba(0, 198, 255, 0.2);
  backdrop-filter: blur(4px);
  background: rgba(0, 0, 0, 0.25);
  padding: 16px;
  margin-top: 24px;
  border-radius: 10px;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  text-align: left;
  line-height: 1.5;
}

@media (max-width: 720px) {
  #aiInsights {
    font-size: 1rem;
    padding: 14px;
  }
}

.settings-container {
  position: absolute;
  top: 16px;
  right: 16px;
  cursor: pointer;
  z-index: 10;
}

.settings-container img {
  width: 28px;
  height: 28px;
  filter: invert(1); /* for dark mode icons */
}
