/* Price section wrapper */
.price-section {
  padding: 80px 20px;
  background: linear-gradient(135deg, #0f172a, #111827);
  color: #ffffff;
}

.price-section .container {
  max-width: 1200px;
  margin: auto;
  padding: 0;
  text-align: left;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  backdrop-filter: none;
}

.price-section .price-card {
  padding: 30px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(14px);
}

.price-section .price-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 30px;
}

.price-section .badge {
  display: inline-block;
  margin-bottom: 12px;
  padding: 6px 14px;
  border: 1px solid rgba(34, 197, 94, 0.25);
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
  font-size: 13px;
}

.price-section .price-header h2 {
  margin: 0 0 8px;
  font-size: 32px;
}

.price-section .subtitle {
  margin: 0;
  color: #9ca3af;
}

.price-section .live-dot {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #22c55e;
  font-size: 14px;
  font-weight: 600;
}

.price-section .live-dot span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 10px #22c55e;
  animation: pricePulse 1.5s infinite;
}

.price-section .price-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 30px;
}

.price-section .stat-box {
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  text-align: center;
}

.price-section .stat-box p {
  margin: 0 0 10px;
  color: #9ca3af;
  font-size: 14px;
}

.price-section .stat-box h3 {
  margin: 0;
  color: #ffffff;
  font-size: 28px;
}

.price-section .protocol-chart {
  width: min(100%, 920px);
  margin: 0 auto;
}

.price-section .buy-coin-btn {
  display: block;
  margin: 24px auto 0;
}

.price-section .chart-wrap {
  height: 360px;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.03);
}

.price-section .chart-wrap canvas {
  width: 100% !important;
  height: 100% !important;
}

/* Buy modal */
.buy-coin-btn {
  margin-top: 18px;
  padding: 12px 24px;
  border: 0;
  border-radius: 10px;
  background: #22c55e;
  color: #ffffff;
  font-weight: 700;
  cursor: pointer;
}

.buy-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.75);
}

.buy-modal-box {
  width: min(420px, 90%);
  padding: 24px;
  border-radius: 16px;
  background: #111827;
  color: #ffffff;
  text-align: center;
}

.qty-box {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 18px 0;
}

.qty-box button,
.buy-modal-box button {
  padding: 10px 16px;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}

#coinQty {
  width: 90px;
  padding: 10px;
  border: 0;
  border-radius: 8px;
  text-align: center;
}

#buyMessage {
  margin-top: 12px;
}

#showQuantity {
  margin-top: 10px;
  color: #22c55e;
  font-size: 14px;
}

/* Main protocol chart */
.chart-wrap,
.protocol-chart {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}

.protocol-chart {
  position: relative;
  min-height: 500px;
  padding: 18px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 26px;
  background:
    radial-gradient(circle at 10% 0%, rgba(34, 197, 94, 0.18), transparent 34%),
    radial-gradient(
      circle at 90% 10%,
      rgba(0, 210, 255, 0.12),
      transparent 32%
    ),
    linear-gradient(180deg, #07111f 0%, #020617 100%);
  box-shadow:
    0 24px 70px rgba(2, 6, 23, 0.48),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.protocol-chart::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.65), transparent);
}

.chart-topline,
.chart-toolbar,
.chart-meta-row,
.coin-chart {
  position: relative;
  z-index: 1;
}

.chart-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding: 2px 2px 8px;
}

.chart-small-label {
  margin: 0 0 4px;
  color: #7dd3fc;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.chart-live-price {
  margin: 0;
  color: #f8fafc;
  font-size: clamp(24px, 4vw, 36px);
  font-weight: 900;
  letter-spacing: -0.04em;
}

.chart-range-label {
  padding: 7px 12px;
  border: 1px solid rgba(34, 197, 94, 0.32);
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.14);
  color: #bbf7d0;
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 8px 22px rgba(34, 197, 94, 0.12);
}

.chart-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 12px;
  padding: 10px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 18px;
  background: rgba(2, 6, 23, 0.42);
  backdrop-filter: blur(14px);
}

.chart-toolbar-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.chart-control {
  min-height: 36px;
  padding: 8px 15px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.82);
  color: #cbd5e1;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition:
    transform 0.2s ease,
    background 0.2s ease,
    border-color 0.2s ease;
}

.chart-control:hover {
  transform: translateY(-1px);
  background: rgba(30, 41, 59, 0.95);
  border-color: rgba(34, 197, 94, 0.5);
}

.chart-control.active {
  border-color: rgba(134, 239, 172, 0.8);
  background: linear-gradient(135deg, #22c55e, #86efac);
  color: #052e16;
  box-shadow:
    0 10px 26px rgba(34, 197, 94, 0.26),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.chart-select-group {
  min-width: 150px;
}

.chart-select-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.82);
}

.chart-select-wrap span {
  color: #94a3b8;
  font-size: 12px;
  font-weight: 800;
}

.chart-select {
  min-width: 82px;
  border: 0;
  outline: 0;
  background: transparent;
  color: #ffffff;
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
}

.chart-select option {
  color: #0f172a;
}

.chart-meta-row {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.chart-meta-row div {
  padding: 11px 12px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.58);
}

.chart-meta-row span {
  display: block;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.chart-meta-row strong {
  display: block;
  margin-top: 4px;
  color: #f8fafc;
  font-size: 14px;
  font-weight: 900;
}

.chart-meta-row strong.positive {
  color: #86efac;
}

.chart-meta-row strong.negative {
  color: #fca5a5;
}

.coin-chart {
  width: 100%;
  height: 360px;
  min-height: 360px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 20px;
  background: #050816;
  overflow: hidden;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 18px 42px rgba(2, 6, 23, 0.36);
}

.chart-tooltip {
  position: absolute;
  z-index: 10;
  display: none;
  min-width: 132px;
  padding: 10px 12px;
  border: 1px solid rgba(125, 211, 252, 0.24);
  border-radius: 14px;
  background: rgba(2, 6, 23, 0.94);
  color: #f8fafc;
  font-size: 12px;
  pointer-events: none;
  box-shadow: 0 18px 40px rgba(2, 6, 23, 0.46);
  backdrop-filter: blur(16px);
}

.chart-tooltip strong {
  display: block;
  color: #86efac;
  font-size: 14px;
}

.chart-tooltip span {
  display: block;
  margin-top: 4px;
  color: #cbd5e1;
  font-size: 12px;
}

.chart-state {
  display: grid;
  place-items: center;
  min-height: 330px;
  height: 100%;
  color: #cbd5e1;
  text-align: center;
}

.chart-state-icon {
  margin-bottom: 10px;
  font-size: 28px;
}

.chart-state p {
  margin: 0;
  font-weight: 800;
}

.hidden-current-price {
  display: none;
}

/* Light theme */
.protocol-chart.light-theme {
  border-color: rgba(15, 23, 42, 0.12);
  background:
    radial-gradient(circle at 10% 0%, rgba(34, 197, 94, 0.16), transparent 34%),
    radial-gradient(
      circle at 90% 10%,
      rgba(14, 165, 233, 0.12),
      transparent 32%
    ),
    linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.protocol-chart.light-theme .chart-toolbar,
.protocol-chart.light-theme .chart-meta-row div {
  border-color: rgba(15, 23, 42, 0.1);
  background: rgba(255, 255, 255, 0.72);
}

.protocol-chart.light-theme .chart-live-price,
.protocol-chart.light-theme .chart-meta-row strong {
  color: #0f172a;
}

.protocol-chart.light-theme .chart-control,
.protocol-chart.light-theme .chart-select-wrap {
  border-color: rgba(15, 23, 42, 0.12);
  background: rgba(255, 255, 255, 0.85);
  color: #334155;
}

.protocol-chart.light-theme .chart-select {
  color: #0f172a;
}

.protocol-chart.light-theme .coin-chart {
  border-color: rgba(15, 23, 42, 0.1);
  background: #ffffff;
}

/* Page-specific chart sizing */
.home-page .protocol-chart {
  min-height: auto;
}

.home-page .chart-meta-row {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

/* Responsive */
.chart-type-mobile-wrap {
  display: none;
}

@media (max-width: 768px) {
  .price-section {
    padding: 36px 10px;
  }

  .price-section .price-card {
    padding: 12px;
    border-radius: 16px;
  }

  .home-chart-card {
    padding: 8px;
    border-radius: 16px;
    overflow: hidden;
  }

  .chart-wrap,
  .protocol-chart {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding: 10px;
    border-radius: 16px;
    box-sizing: border-box;
    overflow: hidden;
  }

  .protocol-chart {
    min-height: auto;
  }

  .protocol-chart::before {
    background-size: 24px 24px;
  }

  .chart-topline {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
  }

  .chart-small-label {
    margin-bottom: 4px;
    font-size: 10px;
    letter-spacing: 0.12em;
  }

  .chart-live-price {
    font-size: 24px;
    line-height: 1;
    overflow-wrap: anywhere;
  }

  .chart-range-label {
    min-width: 44px;
    min-height: 34px;
    padding: 7px 10px;
    font-size: 12px;
    flex-shrink: 0;
  }

  .chart-toolbar {
    display: grid;
    grid-template-columns: 1fr 0.9fr 0.9fr;
    align-items: center;
    gap: 6px;
    width: 100%;
    padding: 8px;
    margin-bottom: 10px;
    border-radius: 14px;
    box-sizing: border-box;
  }

  .chart-toolbar-group:not(.chart-select-group) {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-column: 1 / -1;
    gap: 6px;
    width: 100%;
  }

  .chart-select-group {
    grid-column: auto;
  }

  .chart-control {
    width: 100%;
    min-width: 0;
    min-height: 34px;
    padding: 7px 8px;
    border-radius: 999px;
    font-size: 12px;
    line-height: 1;
    white-space: nowrap;
  }

  .chart-select-group,
  .chart-select-wrap {
    min-width: 0;
    width: 100%;
  }

  .chart-select-wrap {
    min-height: 36px;
    padding: 6px 8px;
    border-radius: 12px;
    gap: 4px;
  }

  .chart-select-wrap span {
    font-size: 11px;
  }

  .chart-select {
    width: 100%;
    min-width: 0;
    font-size: 13px;
  }

  #chartThemeToggle {
    width: 100%;
    min-height: 36px;
    padding: 7px 8px;
    font-size: 12px;
  }

  .chart-meta-row,
  .home-page .chart-meta-row,
  .zrm-dashboard .chart-meta-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    margin-bottom: 10px;
  }

  .chart-meta-row div {
    min-width: 0;
    min-height: 54px;
    padding: 8px;
    border-radius: 12px;
  }

  .chart-meta-row span {
    font-size: 10px;
    line-height: 1.1;
  }

  .chart-meta-row strong {
    font-size: 13px;
    line-height: 1.15;
    overflow-wrap: anywhere;
  }

  .coin-chart,
  .zrm-dashboard .coin-chart {
    width: 100%;
    height: 340px;
    min-height: 340px;
    border-radius: 14px;
  }

  .price-section .chart-wrap {
    height: auto;
  }
}

@media (max-width: 560px) {
  .chart-toolbar {
    grid-template-columns: 1fr 0.8fr 0.8fr;
    gap: 5px;
    padding: 7px;
  }

  .chart-toolbar {
    grid-template-columns: minmax(0, 1fr) minmax(86px, 0.55fr);
  }

  .chart-toolbar-group:not(.chart-select-group) {
    display: none;
  }

  .chart-select-group {
    display: none;
  }

  .chart-type-mobile-wrap {
    display: flex;
  }

  .chart-type-mobile-wrap,
  .chart-select-wrap {
    min-height: 34px;
  }

  .chart-type-mobile-wrap span,
  .chart-select-wrap span {
    display: none;
  }

  .chart-live-price {
    font-size: 22px;
  }

  .chart-range-label {
    min-width: 40px;
    min-height: 30px;
    padding: 6px 9px;
    font-size: 11px;
  }

  .chart-select,
  .chart-type-mobile-select {
    width: 100%;
    border: 0;
    outline: none;
    background: transparent;
    color: #e5e7eb;
    font-size: 12px;
    font-weight: 900;
    cursor: pointer;
  }

  .chart-select option,
  .chart-type-mobile-select option {
    color: #0f172a;
    background: #ffffff;
  }

  #chartThemeToggle {
    min-height: 34px;
    padding: 6px;
    font-size: 11px;
  }

  .chart-meta-row,
  .home-page .chart-meta-row,
  .zrm-dashboard .chart-meta-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .chart-meta-row div {
    min-height: 48px;
    padding: 7px;
  }

  .chart-meta-row span {
    font-size: 9px;
  }

  .chart-meta-row strong {
    font-size: 12px;
  }

  .coin-chart,
  .zrm-dashboard .coin-chart {
    height: 320px;
    min-height: 320px;
  }
}

@media (max-width: 400px) {
  .price-section {
    padding: 28px 6px;
  }

  .home-chart-card {
    padding: 6px;
  }

  .chart-wrap,
  .protocol-chart {
    padding: 7px;
    border-radius: 14px;
  }

  .chart-topline {
    margin-bottom: 6px;
  }

  .chart-live-price {
    font-size: 20px;
  }

  .chart-toolbar {
    gap: 4px;
    padding: 6px;
    margin-bottom: 8px;
  }

  .chart-select-wrap,
  .chart-type-mobile-wrap,
  #chartThemeToggle {
    min-height: 32px;
    border-radius: 10px;
  }

  .chart-select,
  .chart-type-mobile-select {
    font-size: 11px;
  }

  .chart-meta-row {
    gap: 5px;
  }

  .chart-meta-row div {
    min-height: 44px;
    padding: 6px;
  }

  .coin-chart,
  .zrm-dashboard .coin-chart {
    height: 300px;
    min-height: 300px;
  }
}

@keyframes pricePulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }

  50% {
    transform: scale(1.3);
    opacity: 0.6;
  }
}
