.results-sidebar {
  background: var(--surface-color);
  border-radius: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  padding: 24px;
  position: sticky;
  top: 2rem;
}

.result-section {
  background-color: var(--bg-white);
}

.section-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.section-description {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 24px;
}

.result-card {
  background: rgba(42, 157, 143, 0.05);
  border-radius: 12px;
  padding: 24px;
}

.score-display {
  text-align: center;
  margin-bottom: 24px;
}

.score-label {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  font-weight: 500;
  font-size: 14px;
  margin-bottom: 12px;
}

.score-input {
  width: 100%;
  padding: 12px;
  font-size: 24px;
  text-align: center;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--surface-color);
  color: var(--text-primary);
  font-weight: 500;
  margin-bottom: 8px;
}

.help-text {
  color: var(--text-secondary);
  font-size: 12px;
}

.result-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 24px;
}

.btn {
  padding: 12px;
  border-radius: 8px;
  font-weight: 500;
  font-size: 14px;
  transition: all 0.2s ease;
  border: none;
  cursor: pointer;
  width: 100%;
  text-align: center;
}

.btn-submit {
  background: #2a9d8f;
  color: white;
}

.btn-submit:hover {
  background: #238276;
}

.btn-clear {
  background: transparent;
  color: var(--text-primary);
  border: none;
}

.btn-clear:hover {
  background: rgba(0, 0, 0, 0.05);
}

.btn-calculate {
  background: #2a9d8f;
  color: white;
}

.btn-calculate:hover {
  background: #238276;
}

@media (max-width: 768px) {
  .results-sidebar {
    position: static;
    margin-top: 16px;
    padding: 16px;
  }

  .result-card {
    padding: 16px;
  }

  .score-input {
    font-size: 20px;
  }
}

/* Add loading state */
.score-input.loading {
  background-image: linear-gradient(
    45deg,
    rgba(13, 148, 136, 0.1) 25%,
    transparent 25%,
    transparent 50%,
    rgba(13, 148, 136, 0.1) 50%,
    rgba(13, 148, 136, 0.1) 75%,
    transparent 75%,
    transparent
  );
  background-size: 40px 40px;
  animation: loading-stripes 1s linear infinite;
}

@keyframes loading-stripes {
  0% {
    background-position: 0 0;
  }
  100% {
    background-position: 40px 0;
  }
}

.history-section {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
}

.section-subtitle {
  color: var(--text-color);
  font-size: 1.1rem;
  font-weight: 500;
  margin-bottom: 1rem;
}

.info-display {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--border-primary);
  border-radius: 0.375rem;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--text-primary);
  background-color: var(--bg-light);
}

.graph-container {
  background: var(--bg-white);
  border: 1px solid var(--border-primary);
  border-radius: 0.5rem;
  padding: 1.5rem;
  height: 400px;
  margin-bottom: 1rem;
}

.graph-container + .help-text {
  text-align: center;
  display: block;
  margin-top: 0.5rem;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

/* History Viewer Styles */
#history-viewer {
  background-color: var(--bg-white);
  border-radius: 0.75rem;
  padding: 2rem;
  margin: 2rem 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

#history-viewer .history-header {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  align-items: center;
  justify-content: space-between;
}

#history-viewer .search-panel {
  flex: 0 1 400px; /* Limit width on desktop */
  min-width: 280px;
}

#history-viewer .input-group {
  display: flex;
  gap: 0.5rem;
  max-width: 100%;
}

#history-viewer .search-input {
  flex: 1;
  padding: 0.625rem 1rem;
  border: 1px solid var(--border-primary);
  border-radius: 0.375rem;
  font-size: 0.95rem;
  transition: all 0.2s ease;
}

#history-viewer .btn-search {
  padding: 0.625rem;
  min-width: 2.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--primary);
  color: white;
  border: none;
  border-radius: 0.375rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

#history-viewer .history-stats {
  display: flex;
  gap: 2rem;
  padding: 0.875rem 1.25rem;
  background-color: var(--bg-light);
  border-radius: 0.5rem;
  min-width: 280px;
  flex: 0 1 auto;
}

#history-viewer .stat-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

#history-viewer .stat-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

#history-viewer .stat-value {
  font-size: 1.125rem;
  font-weight: 500;
  color: var(--text-primary);
}

#history-viewer .graph-section {
  background-color: var(--bg-light);
  border-radius: 0.5rem;
  padding: 1.5rem;
}

#history-viewer .graph-container {
  background: var(--bg-white);
  border: 1px solid var(--border-primary);
  border-radius: 0.5rem;
  padding: 1.5rem;
  height: 400px;
  margin-bottom: 0.75rem;
}

#history-viewer .help-text {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

@media (max-width: 768px) {
  #history-viewer {
    padding: 1.5rem;
  }

  #history-viewer .history-header {
    gap: 1.5rem;
  }

  #history-viewer .search-panel {
    flex: 1 1 100%;
  }

  #history-viewer .history-stats {
    flex-direction: column;
    gap: 1rem;
    width: 100%;
  }

  #history-viewer .graph-container {
    height: 300px;
  }
}

#history-viewer .subsection-content {
  max-height: 1000px;
  opacity: 1;
  overflow: hidden;
  transition: all 0.3s ease-in-out;
}

#history-viewer.collapsed .subsection-content {
  max-height: 0;
  opacity: 0;
  padding-top: 0;
  padding-bottom: 0;
}

#history-viewer .section-header {
  cursor: pointer;
  user-select: none;
}

#history-viewer .subsection-icon {
  transition: transform 0.3s ease;
}

#history-viewer.collapsed .subsection-icon {
  transform: rotate(-90deg);
}
