/* Charts Page Styles */
/* Charts Hero Section */
.charts-hero {
  padding: 64px 0 24px;
  text-align: left;
}

.highcharts-exporting-group {
  display: none;
}

.charts-hero h1 {
  font-size: 48px;
  font-family: var(--font-family-title);
  font-weight: 550;
  margin: 0 0 40px;
}

/* Metal Tabs */
.metal-tabs {
  display: flex;
  gap: 16px;
  justify-content: flex-start;
  flex-wrap: wrap;
}

.metal-tab {
  font-size: 16px;
  font-weight: 400;
  color: var(--text-default-secondary);
  cursor: pointer;
  border: 0;
  background: none;
  text-decoration: none;
  display: inline-block;
  padding-bottom: 6px;
}

.metal-tab:hover,
.metal-tab.active {
  color: var(--text-default-primary);
  border-bottom: var(--border-default-brand);
}

/* Charts Main Section */
.charts-main {
  /* padding: 0 0 60px; */
  background: white;
}

.charts-main .container {
  position: relative;
}

.charts-grid {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 60px;
  align-items: start;
}

/* Left Column Styles */
.price-display {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 40px;
  position: absolute;
  top: 20px;
  left: 70px;
  z-index: 49;
}

.metal-icon {
  object-fit: contain;
  width: 58px;
}

.price-info .current-price,
#price-change-display {
  font-size: 40px;
  font-weight: 550;
  margin-bottom: 8px;
  font-family: var(--font-family-title)
}

.price-info .price-change {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 4px;
}

.price-change.positive {
  color: var(--icon-positive-default);
}

.price-change.negative {
  color: var(--icon-negative-default);
}

.price-extra-info {
  margin-left: 10px;
}

.price-period,
.per-ounce {
  font-weight: 400;
  font-size: 14px;
  line-height: 20px;
}

/* Chart Container */
.chart-container {
  margin-bottom: 64px;
  position: relative;
}

/* Chart Header and Controls */
.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 15px;
}

.chart-controls-header {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}

.value-sets {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  justify-content: flex-start;
}

.value-sets select,
.value-sets button.download-action {
  border: 1px solid #ccc;
  background-color: #ffffff;
  padding: 8px 15px;
  border-radius: 4px;
  font-weight: 600;
  color: #4E6883;
  cursor: pointer;
  height: 40px;
  font-size: 16px;
}

.currency-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23444444'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 0.8rem 0.5rem;
  width: 85px;
  padding-right: 30px;
}

.unit-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23444444'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 0.8rem 0.5rem;
  width: 140px;
  padding-right: 30px;
}

.download-action {
  width: 40px;
  height: 40px;
  border-radius: 4px;
  background: #f8f8f8;
  border: 1px solid #ddd;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #555;
}

.download-action:hover {
  background: #4E6883;
  border: 1px solid #CCCCCC;
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0px 0px 20px 0px rgba(0, 0, 0, 0.2);
}

.download-action:hover .download-icon {
  fill: #ffffff;
}

.download-icon {
  fill: #555;
}

/* Highcharts Container */
#price-chart {
  width: 100%;
  height: 500px;
  background: #ffffff;
  border-radius: 6px;
}

/* Override Highcharts label colors */
#price-chart .highcharts-axis-labels text {
  fill: #55535C !important;
}

/* X-axis labels padding */
#price-chart .highcharts-xaxis-labels text {
  transform: translateY(16px);
}

/* Y-axis labels padding */
#price-chart .highcharts-yaxis-labels text {
  transform: translateX(8px);
}

.chart-controls {
  display: flex;
  gap: 0;
  justify-content: center;
  margin-top: 24px;
  border: 1px solid #cccccc;
}

.chart-btn {
  font-weight: 600;
  padding: 6px 16px;
  font-size: 16px;
  color: #444444;
  background: #ededed;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  font-weight: 500;
  letter-spacing: 0.5px;
  border: none;
  border-right: 1px solid #ccc;
}

.chart-btn:last-child {
  border-right: none;
}

.chart-btn:hover {
  background: #f0f0f0;
}

.chart-btn.active {
  background: #ffffff;
  color: #4E6883;
  font-weight: 600;
  box-shadow: 0px 1px 4px 0px rgba(0, 0, 0, 0.12);
}

.charts-bottom-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  margin-top: 76px;
}

/* Performance Table */
.performance-section h3 {
  font-size: 20px;
  font-family: var(--font-family-title);
  font-weight: 550;
  margin: 0 0 8px;
}

.performance-table {
  background: transparent;
  border-radius: 0;
  overflow: hidden;
}

.performance-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 32px;
  padding: 8px 0;
  border-bottom: 1px solid #E0DFE5;
  align-items: center;
}

.performance-row:last-child {
  border-bottom: none;
}

.performance-row .performance-cell:nth-child(2) {
  text-align: center;
}

.performance-row.header {
  background: transparent;
  font-weight: 600;
  color: #111;
  border-bottom: 2px solid #e5e7eb;
}

.performance-cell {
  font-size: 12px;
  font-weight: 400;
}

.performance-cell.term {
  color: var(--text-default-tertiary);
}

.performance-cell:nth-child(2),
.performance-cell:nth-child(3) {
  text-align: right;
}

.performance-row.header .performance-cell {
  color: #111;
  font-weight: 600;
  font-size: 14px;
}

.performance-cell.positive {
  color: var(--icon-positive-default);
  font-weight: 600;
}

.performance-cell.negative {
  color: var(--icon-negative-default);
  font-weight: 600;
}

/* Right Column Styles */
.market-info {
  background: transparent;
  padding: 0;
  border-radius: 0;
  position: static;
}

#metal-name-label {
  margin-top: 40px;
  margin-bottom: 7px;
}

.market-info h3 {
  font-size: 20px;
  font-weight: 550;
  font-family: var(--font-family-title);
  margin: 0 0 12px;
}

/* Range Display */
.range-display {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 12px 0;
}

.range-low,
.range-high {
  font-size: 12px;
  font-weight: 500;
  flex-shrink: 0;
}

.range-bar {
  position: relative;
  height: 10px;
  background: var(--background-default-tertiary);
  flex: 1;
}

.range-indicator {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%) rotate(45deg);
  width: 8px;
  height: 8px;
  background: #AF7D44;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.range-values {
  display: flex;
  justify-content: space-between;
  font-size: 16px;
  font-weight: 600;
  color: #111;
}

/* Market Stats */
.market-stats {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 43px;
}

.market-stats .performance-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid #e5e7eb;
}

.market-stats .performance-row:last-child {
  border-bottom: none;
}

.market-stats .performance-cell.positive {
  color: var(--icon-positive-default);
}

.market-stats .performance-cell.negative {
  color: var(--icon-negative-default);
}

.last-updated {
  font-size: 16px;
  color: var(--text-default-tertiary);
  text-align: left;
}

/* Investing Section */
.investing-section {
  padding: 80px 0;
  background: white;
}

.investing-content {}

.investing-text h2 {
  font-size: 48px;
  font-weight: 400;
  line-height: 1.1;
  margin: 0 0 24px;
  color: #111;
}

.investing-text .highlight {
  background: linear-gradient(135deg, #D4B062 0%, #C9A961 50%, #B8975A 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.investing-text p {
  font-size: 18px;
  line-height: 1.6;
  color: #666;
  margin: 0;
}

/* Brand Carousel Modifications for Charts Page */
.investing-brands .container {
  padding: 0;
}

.investing-brands .service-content {
  margin-top: 0;
}

.investing-brands .swiper-slide {
  height: auto;
}

.investing-brands .card {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.investing-brands .card .content {
  flex: 1;
}

/* Wholesale Section */
.wholesale-section {
  padding: 64px 0 108px 0;
}

.wholesale-grid {
  display: flex;
  gap: 126px;
}

.wholesale-image {
  position: relative;
  background: #f0f0f0;
  width: 532px;
  min-width: 532px;
  height: 677px;
  overflow: hidden;
  align-self: stretch;
  display: flex;
}

.wholesale-image img {
  width: 532px;
  min-width: 532px;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
}

.wholesale-content h2 {
  font-size: 54px;
  font-weight: 550;
  margin: 0 0 38px;
  font-family: var(--font-family-title);
}

/* Accordion Styles */
.wholesale-accordion {
  display: flex;
  flex-direction: column;
}

.accordion-item {
  border-bottom: 1px solid #E0DFE5;
}

.accordion-header {
  width: 100%;
  display: flex;
  gap: 20px;
  font-family: var(--font-family-title);
  border: none;
  cursor: pointer;
  text-align: left;
  background: white;
}

.accordion-icon {
  font-size: 24px;
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  margin-top: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.accordion-icon img {
  width: 26px;
  height: 26px;
  object-fit: contain;
}

.accordion-title {
  flex: 1;
  padding: 32px 0;
  background: white;
  font-size: 26px;
  font-weight: 550;
}

.accordion-toggle {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 34px;
  transition: transform 0.3s ease;
}

.accordion-item.active .accordion-toggle {
  transform: rotate(180deg);
}

.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.9s ease;
}

.accordion-item.active .accordion-content {
  max-height: 500px;
}

.accordion-item.active .accordion-title {
  padding-bottom: 16px;
}

.accordion-item:last-child {
  border-bottom: none;
}

.accordion-body {
  padding: 0 24px 24px 58px;
  line-height: 1.6;
}

.accordion-body p {
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 400;
}

.accordion-body p:last-child {
  margin-bottom: 0;
}

/* Responsive */
@media screen and (max-width: 1040px) {
  .charts-hero h1 {
    font-size: 34px;
    margin-bottom: 24px;
  }

  .investing-section {
    padding: 0;
  }

  .charts-bottom-grid {
    margin-top: 48px;
  }

  .price-info .current-price,
  #price-change-display {
    font-size: 30px;
  }

  .charts-hero {
    padding-bottom: 52px;
  }

  .metal-tabs {
    gap: 12px;
  }

  .metal-tab {
    font-size: 14px;
    font-weight: 500;
    line-height: 20px;
  }

  .wholesale-image,
  .wholesale-image img {
    width: 314px;
    height: 390px;
    min-width: 314px;
  }

  .wholesale-grid {
    gap: 40px;
  }

  .wholesale-content h2 {
    font-size: 34px;
    margin-bottom: 52px;
  }

  /* Accordion: icon + chevron on first line, title below */
  .accordion-item {
    padding: 28px 0;
  }

  .accordion-body p {
    font-size: 14px;
    line-height: 20px;
  }

  .accordion-item:first-child {
    padding-top: 0;
  }

  .accordion-icon,
  .accordion-toggle {
    margin-top: 0;
  }

  .accordion-header {
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-areas:
      "icon . toggle"
      "title title title";
    align-items: start;
    gap: 8px;
    padding: 0;
  }

  .accordion-icon {
    grid-area: icon;
    align-self: center;
  }

  .accordion-toggle {
    grid-area: toggle;
    justify-self: end;
    align-self: center;
  }

  .accordion-item.active .accordion-title {
    padding-bottom: 12px;
  }

  .accordion-title {
    grid-area: title;
    padding: 0;
    font-size: 22px;
    line-height: 32px;
    width: 90%;
  }

  .accordion-body {
    padding: 0;
    font-size: 14px;
    font-weight: 400;
    line-height: 20px;
  }
}

@media (max-width: 640px) {
  .metal-tabs {
    flex-wrap: nowrap;
    overflow-x: scroll;
  }

  .charts-hero {
    padding-top: 30px;
    padding-bottom: 36px;
  }

  .price-display {
    top: 0;
    left: 20px;
  }

  #price-chart {
    height: 418px !important;
  }

  /* Hide Y-axis completely for Highcharts on mobile */
  #price-chart .highcharts-yaxis .highcharts-axis-line,
  #price-chart .highcharts-yaxis .highcharts-tick,
  #price-chart .highcharts-yaxis-labels {
    display: none;
  }

  .charts-bottom-grid {
    margin-top: 40px;
    gap: 40px;
    grid-template-columns: 1fr;
  }

  #metal-name-label {
    margin-top: 36px;
  }

  .market-stats {
    margin-bottom: 51px;
  }

  .last-updated {
    margin-bottom: 27px;
  }

  .wholesale-grid > .wholesale-image {
    display: none;
  }

  .wholesale-section {
    padding: 40px 0;
  }

  .wholesale-content h2 {
    margin-bottom: 32px;
  }

  .wholesale-image,
  .wholesale-image img {
    width: 100%;
    height: auto;
    min-width: unset;
    max-height: unset;
  }

  .wholesale-accordion {
    margin-top: 32px;
  }

  .investing-brands .container {
    padding: 0 20px !important;
  }
}

@media (min-width: 640px) {
  .wholesale-content .wholesale-image {
    display: none;
  }
}

.cta-section {
  /* background: linear-gradient(to top,
      var(--background-default-brand-dark) 0%,
      var(--background-default-brand-dark) 50%,
      #000 50%,
      #000 100%) !important; */
}

/* Hide bottom grid (performance table and market stats) for ratio charts */
.charts-bottom-grid[data-metal="btc"],
.charts-bottom-grid[data-metal="gold-silver"] {
  display: none;
}