/* talisman-strategy/css/style.css */

:root {
  --config-a-fill-muted: rgba(88, 101, 242, 0.18);
  --config-a-fill-hover: rgba(88, 101, 242, 0.24);
  --config-a-fill-solid: rgba(88, 101, 242, 0.9);
  --config-a-border-muted: rgba(88, 101, 242, 0.28);
  --config-a-border-strong: rgba(88, 101, 242, 0.4);

  --config-b-fill-muted: rgba(250, 166, 26, 0.18);
  --config-b-fill-hover: rgba(250, 166, 26, 0.24);
  --config-b-fill-solid: rgba(250, 166, 26, 0.9);
  --config-b-border-muted: rgba(250, 166, 26, 0.28);
  --config-b-border-strong: rgba(250, 166, 26, 0.4);

  --surface-muted-fill: rgba(255, 255, 255, 0.1);
  --surface-muted-fill-hover: rgba(255, 255, 255, 0.16);
  --surface-muted-fill-active: rgba(255, 255, 255, 0.14);
  --surface-muted-border: rgba(255, 255, 255, 0.12);

  --diff-positive-fill: rgba(237, 66, 69, 0.12);
  --diff-positive-text: #ffb3b5;
  --diff-negative-fill: rgba(59, 165, 92, 0.12);
  --diff-negative-text: #9de0af;
}

.config-table th,
.config-table td {
  text-align: center;
  vertical-align: middle;
  padding: 0.35rem 0.5rem;
  font-size: 1rem;
  line-height: 1.2;
}

.page-title {
  padding: 0;
}

.card {
  background: transparent;
  box-shadow: none;
  border-radius: 0;
  margin-bottom: 1.25rem;
  padding: 1rem 0;
}

.card.mb-3 {
  margin-bottom: 1.25rem;
}

.config-table input[type="number"],
.config-table select {
  width: 100%;
  margin-bottom: 0;
  padding: 0.2rem 0.35rem;
  font-size: 1rem;
  line-height: 1.2;
  text-align: center;
}

#configurationTable {
  table-layout: auto;
  width: 100%;
  min-width: 100%;
}

.config-table-wrap {
  margin-bottom: 1.1rem;
}

.config-table-wrap,
#comparisonResultsContainer {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.22) rgba(255, 255, 255, 0.06);
}

.config-table-wrap::-webkit-scrollbar,
#comparisonResultsContainer::-webkit-scrollbar {
  height: 10px;
}

.config-table-wrap::-webkit-scrollbar-track,
#comparisonResultsContainer::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 999px;
}

.config-table-wrap::-webkit-scrollbar-thumb,
#comparisonResultsContainer::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

.config-table-wrap::-webkit-scrollbar-thumb:hover,
#comparisonResultsContainer::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.32);
  background-clip: padding-box;
}

.config-controls-grid {
  gap: 0.75rem 1.5rem;
  margin-bottom: 0.75rem;
  align-items: end;
}

.config-controls-grid.grid-2 {
  grid-template-columns: 1fr;
}

.config-controls-grid .form-group {
  margin-bottom: 0;
}

.config-controls-grid label {
  margin-bottom: 0.35rem;
}

.config-controls-grid input[type="number"],
.config-controls-grid select {
  margin-bottom: 0;
}

.config-target-error {
  margin-top: -0.25rem;
  margin-bottom: 0.75rem;
}

.config-button-group {
  display: flex;
  flex-direction: column;
  justify-content: end;
}

.config-button-group button {
  width: 100%;
  height: 38px;
  padding-top: 0;
  padding-bottom: 0;
}

@media (min-width: 768px) {
  .config-controls-grid.grid-2 {
    grid-template-columns: 1fr 1fr 1fr 1fr;
  }

  .config-controls-grid .form-group {
    display: flex;
    flex-direction: column;
    justify-content: end;
  }
}

.config-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.config-tab {
  background-color: var(--surface-muted-fill);
  color: var(--text-primary);
  border-radius: 6px 6px 0 0;
  padding: 0.6rem 1rem;
  border: 1px solid transparent;
  border-bottom: 0;
}

.config-tab:hover {
  background-color: var(--surface-muted-fill-hover);
}

.config-tab.is-active {
  background-color: var(--surface-muted-fill-active);
  color: var(--text-primary);
  border-color: var(--surface-muted-border);
}

#configStrategyTab {
  background-color: var(--config-a-fill-muted);
  color: var(--text-primary);
  border-color: var(--config-a-border-muted);
}

#configStrategyTab:hover {
  background-color: var(--config-a-fill-hover);
}

#configStrategyTab.is-active {
  background-color: var(--config-a-fill-solid);
  color: var(--text-primary);
  border-color: var(--config-a-border-strong);
}

.config-section {
  margin-bottom: 1rem;
}

.config-header-label {
  display: inline-block;
  max-width: 100%;
}

#serverConfigurationTable input[type="number"] {
  width: 110px;
}

#argateExchangeTable input[type="number"] {
  width: 110px;
}

.expected-results-table {
  margin-bottom: 1rem;
  width: 100%;
  table-layout: auto;
}

.expected-results-table:last-child {
  margin-bottom: 0;
}

.expected-results-table col.metric-col {
  width: 28%;
}

.expected-results-table col.value-col {
  width: 18%;
}

.comparison-results-table col.comparison-metric-col {
  width: 24%;
}

.comparison-results-table col.comparison-value-col,
.comparison-results-table col.comparison-diff-col,
.comparison-results-table col.comparison-ratio-col {
  width: 19%;
}

.expected-results-table th:first-child,
.expected-results-table td:first-child {
  text-align: left;
}

.expected-results-table th:not(:first-child),
.expected-results-table td:not(:first-child) {
  text-align: center;
}

.expected-results-table .results-section-row th {
  background-color: var(--background-tertiary);
  font-weight: 700;
}

.expected-results-table .results-section-row th:first-child {
  text-align: left;
}

.comparison-results-table thead .corner-spacer {
  background: transparent;
  border: none;
  padding: 0;
}

.comparison-results-table .results-section-row th:not(:first-child) {
  color: transparent;
}

.expected-results-table .resource-parent td:first-child {
  padding-top: 0.75rem;
  cursor: pointer;
}

.expected-results-table .resource-child td:first-child {
  padding-left: 1.5rem;
  color: var(--text-secondary);
}

.expected-results-table .resource-child.is-hidden {
  display: none;
}

.expected-results-table .resource-parent-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.expected-results-table .resource-parent-toggle::after {
  content: ">";
  font-size: 0.8rem;
  color: var(--text-secondary);
  transform: rotate(0deg);
  transition: transform 0.2s ease;
}

.expected-results-table .resource-parent.is-expanded .resource-parent-toggle::after {
  transform: rotate(90deg);
}

.results-footnote {
  font-size: 0.9rem;
  margin-top: 0.75rem;
}

.results-subsection-title {
  margin: 0.75rem 0 0.5rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.card-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  margin-bottom: 1rem;
}

.card-heading-row h2 {
  margin-bottom: 0;
}

.card-help-trigger {
  flex: 0 0 auto;
  width: 2rem;
  height: 2rem;
  min-width: 2rem;
  padding: 0;
  border-radius: 999px;
  border: 1px solid var(--surface-muted-border);
  background-color: var(--surface-muted-fill);
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1;
}

.card-help-trigger:hover,
.card-help-trigger:focus-visible {
  background-color: var(--surface-muted-fill-hover);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.22);
}

.comparison-controls {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.card-help-content {
  margin: -0.15rem 0 1rem;
  padding: 0.9rem 1rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.card-help-content[hidden] {
  display: none !important;
}

.comparison-heading-row {
  align-items: flex-start;
  margin-bottom: 1rem;
}

.comparison-mode-toggle {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  min-height: 2.35rem;
}

.comparison-mode-custom-slot {
  display: flex;
  width: 5.75rem;
  min-width: 5.75rem;
  height: 2.35rem;
  align-items: stretch;
}

.comparison-mode-button {
  background-color: var(--surface-muted-fill);
  color: var(--text-primary);
  min-width: 5.75rem;
  height: 2.35rem;
  padding: 0 1rem;
  box-sizing: border-box;
}

.comparison-mode-button:hover {
  background-color: var(--surface-muted-fill-hover);
  color: var(--text-primary);
}

.comparison-mode-button.is-active {
  background-color: var(--blurple);
  color: #fff;
}

.comparison-mode-custom-input {
  width: 100%;
  min-width: 0;
  height: 100%;
  padding: 0 0.6rem;
  margin-bottom: 0;
  text-align: center;
  background-color: var(--blurple);
  border: 1px solid rgba(88, 101, 242, 0.95);
  color: #fff;
  font-weight: 600;
  border-radius: 6px;
  box-sizing: border-box;
  line-height: 1;
  appearance: textfield;
  -moz-appearance: textfield;
  box-shadow: inset 0 0 0 999px var(--blurple);
  opacity: 1;
}

.comparison-mode-custom-input[hidden] {
  display: none !important;
}

.comparison-mode-custom-input::-webkit-outer-spin-button,
.comparison-mode-custom-input::-webkit-inner-spin-button {
  margin: 0;
}

.comparison-mode-custom-input:focus,
.comparison-mode-custom-input:focus-visible {
  outline: none;
  background-color: var(--blurple);
  border-color: rgba(255, 255, 255, 0.85);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.85);
}

.comparison-results-table td:nth-child(3),
.comparison-results-table td:nth-child(4),
.comparison-results-table td:nth-child(5) {
  background-color: transparent;
}

.comparison-results-table td.diff-positive {
  background-color: var(--diff-positive-fill);
  color: var(--diff-positive-text);
  font-weight: 700;
}

.comparison-results-table td.diff-negative {
  background-color: var(--diff-negative-fill);
  color: var(--diff-negative-text);
  font-weight: 700;
}

.comparison-results-table th:first-child,
.comparison-results-table td:first-child {
  width: auto;
  min-width: 7.5rem;
}

.comparison-results-table th:not(:first-child),
.comparison-results-table td:not(:first-child) {
  min-width: 6.75rem;
}

#comparisonResultsContainer {
  width: 100%;
}

#serverConfigurationTable input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--blurple);
}

.card-help-content p {
  margin: 0 0 0.75rem;
  color: var(--text-primary);
  line-height: 1.45;
}

.card-help-content ul {
  margin: 0 0 0.8rem 1rem;
  padding: 0;
  color: var(--text-secondary);
}

.card-help-content li {
  margin-bottom: 0.45rem;
  line-height: 1.45;
}

.card-info-note {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

body.content-compact {
  --mobile-section-gutter: 0.85rem;
}

body.content-compact body {
  width: 100%;
  overflow-x: hidden;
}

body.content-compact .config-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  width: 100%;
  margin-left: 0;
  margin-right: 0;
}

body.content-compact #configurationTable {
  width: 100%;
  min-width: max-content;
  table-layout: auto;
}

body.content-compact #configurationTable th,
body.content-compact #configurationTable td {
  padding-left: 0.3rem;
  padding-right: 0.3rem;
  overflow-wrap: normal;
  word-break: normal;
}

body.content-compact #configurationTable th {
  white-space: normal;
  hyphens: manual;
  line-height: 1.15;
}

body.content-compact #configurationTable .config-header-label {
  width: min-content;
  white-space: normal;
}

body.content-compact #configurationTable td {
  white-space: nowrap;
}

body.content-compact #configurationTable th:nth-child(1),
body.content-compact #configurationTable td:nth-child(1) {
  min-width: 2.7rem;
}

body.content-compact #configurationTable th:nth-child(2),
body.content-compact #configurationTable td:nth-child(2),
body.content-compact #configurationTable th:nth-child(4),
body.content-compact #configurationTable td:nth-child(4) {
  min-width: 3.7rem;
}

body.content-compact #configurationTable th:nth-child(3),
body.content-compact #configurationTable td:nth-child(3) {
  min-width: 4.5rem;
}

body.content-compact #configurationTable th:nth-child(5),
body.content-compact #configurationTable td:nth-child(5) {
  min-width: 4.9rem;
}

body.content-compact #configurationTable select {
  min-width: 0;
  width: 100%;
  max-width: 100%;
}

body.content-compact .expected-results-table {
  width: 100%;
  min-width: max-content;
  table-layout: auto;
}

body.content-compact #comparisonResultsContainer {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

body.content-compact .expected-results-table th,
body.content-compact .expected-results-table td {
  padding-left: 0.3rem;
  padding-right: 0.3rem;
  overflow-wrap: normal;
  word-break: normal;
}

body.content-compact .expected-results-table th {
  white-space: normal;
  line-height: 1.15;
}

body.content-compact .expected-results-table td {
  white-space: nowrap;
}

body.content-compact .expected-results-table .results-section-row th {
  white-space: normal;
  line-height: 1.15;
}

body.content-compact .comparison-heading-row {
  flex-direction: column;
  align-items: stretch;
}

body.content-compact .comparison-controls {
  width: 100%;
  justify-content: space-between;
  align-items: flex-start;
}

body.content-compact .expected-results-table th:first-child,
body.content-compact .expected-results-table td:first-child {
  min-width: 5rem;
}

body.content-compact .expected-results-table th:not(:first-child),
body.content-compact .expected-results-table td:not(:first-child) {
  min-width: 4rem;
  text-align: center;
}

body.content-compact .container {
  padding: 0 !important;
  margin: 0;
  max-width: none;
  width: 100vw;
  min-width: 100vw;
}

body.content-compact .page-title {
  padding: 0 var(--mobile-section-gutter);
}

body.content-compact .card {
  background: transparent;
  box-shadow: none;
  border-radius: 0;
  margin-bottom: 1rem;
  margin-left: 0;
  margin-right: 0;
  padding: 1rem var(--mobile-section-gutter);
  width: 100%;
}

body.content-compact .card.mb-3 {
  margin-bottom: 1.25rem;
}

@media (max-width: 767px) {
  :root {
    --mobile-section-gutter: 0.85rem;
  }

  html,
  body {
    width: 100%;
    overflow-x: hidden;
  }

  .config-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    margin-left: 0;
    margin-right: 0;
  }

  #configurationTable {
    width: 100%;
    min-width: max-content;
    table-layout: auto;
  }

  #configurationTable th,
  #configurationTable td {
    padding-left: 0.3rem;
    padding-right: 0.3rem;
    overflow-wrap: normal;
    word-break: normal;
  }

  #configurationTable th {
    white-space: normal;
    hyphens: manual;
    line-height: 1.15;
  }

  #configurationTable .config-header-label {
    width: min-content;
    white-space: normal;
  }

  #configurationTable td {
    white-space: nowrap;
  }

  #configurationTable th:nth-child(1),
  #configurationTable td:nth-child(1) {
    min-width: 2.7rem;
  }

  #configurationTable th:nth-child(2),
  #configurationTable td:nth-child(2),
  #configurationTable th:nth-child(4),
  #configurationTable td:nth-child(4) {
    min-width: 3.7rem;
  }

  #configurationTable th:nth-child(3),
  #configurationTable td:nth-child(3) {
    min-width: 4.5rem;
  }

  #configurationTable th:nth-child(5),
  #configurationTable td:nth-child(5) {
    min-width: 4.9rem;
  }

  #configurationTable select {
    min-width: 0;
    width: 100%;
    max-width: 100%;
  }

  .expected-results-table {
    width: 100%;
    min-width: max-content;
    table-layout: auto;
  }

  #comparisonResultsContainer {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .expected-results-table th,
  .expected-results-table td {
    padding-left: 0.3rem;
    padding-right: 0.3rem;
    overflow-wrap: normal;
    word-break: normal;
  }

  .expected-results-table th {
    white-space: normal;
    line-height: 1.15;
  }

  .expected-results-table td {
    white-space: nowrap;
  }

  .expected-results-table .results-section-row th {
    white-space: normal;
    line-height: 1.15;
  }

  .comparison-heading-row {
    flex-direction: column;
    align-items: stretch;
  }

  .comparison-controls {
    width: 100%;
    justify-content: space-between;
    align-items: flex-start;
  }

  .expected-results-table th:first-child,
  .expected-results-table td:first-child {
    min-width: 5rem;
  }

  .expected-results-table th:not(:first-child),
  .expected-results-table td:not(:first-child) {
    min-width: 4rem;
    text-align: center;
  }

  .container {
    padding: 0 !important;
    margin: 0;
    max-width: none;
    width: 100vw;
    min-width: 100vw;
  }

  .page-title {
    padding: 0 var(--mobile-section-gutter);
  }

  .card {
    background: transparent;
    box-shadow: none;
    border-radius: 0;
    margin-bottom: 1rem;
    margin-left: 0;
    margin-right: 0;
    padding: 1rem var(--mobile-section-gutter);
    width: 100%;
  }

  .card.mb-3 {
    margin-bottom: 1.25rem;
  }
}
