/* ==============================
   Wrapper
============================== */

.admat-metal-chart-wrap{
  background:#FBFBFB;
  border:1px solid rgba(0,0,0,0.06);
  border-radius:16px;
  overflow:hidden;
}

/* ==============================
   Header
============================== */

.admat-metal-chart-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
  padding:16px;
}

@media(min-width:640px){
  .admat-metal-chart-head{ padding:32px; }
}

.admat-metal-chart-title{
  font-size:16px;
  font-weight:600;
  color:#1E1E1E;
}

@media(min-width:640px){
  .admat-metal-chart-title{ 
	  font-size:30px; }
}

.admat-metal-chart-subtitle{
  margin-top:6px;
  font-size:12px;
  color:#A8AAAE;
}

/* ==============================
   Metal toggle (Gold / Silver)
============================== */

.admat-metal-toggle{
  display:flex;
  gap:8px;
  align-items:center;
}

/* Inactive buttons inherit theme color */
.admat-metal-btn{
	width: 100%;          /* 🔑 THIS makes it smaller */
   padding: 6px 14px!important;
  font-size: 12px;
  line-height: 1;
  border-radius: 999px;
  border: 1px solid currentColor;
  background: transparent;
  font-family: inherit;
  appearance: none;
  cursor: pointer;
  color:var(--e-global-color-text, currentColor);
  opacity:.55;
  transition:all .15s ease;
  -webkit-appearance: none;
}

.admat-metal-btn:hover{
  opacity:.85;
}

/* Active = solid */
.admat-metal-btn.is-active{
  background:#333;
  color:#fff;
  border-color:currentColor;
  opacity:1;
}

@media (max-width: 480px){
  .admat-metal-btn{
    padding: 4px 8px;
    font-size: 11px;
  }
}

/* ==============================
   Price display
============================== */

.admat-metal-price{
  padding:0 16px;
  margin-top:4px;
}

@media(min-width:640px){
  .admat-metal-price{
    padding:0 32px;
    margin-top:6px;
  }
}

.price-value{
  font-size:20px;
  font-weight:700;
  line-height:1.2;
  color:inherit;
}

.price-meta{
  margin-top:2px;
  font-size:12px;
  color:var(--e-global-color-text, #666);
}

/* ==============================
   Range filters (1d / 1w / 1m / 6m / 1y)
============================== */

.admat-metal-ranges{
  display:flex;
  gap:6px;
  margin-top:8px;
  margin-left:16px;
  padding-bottom: 12px;
}

@media(min-width:640px){
  .admat-metal-ranges{
    margin-left:32px;
    margin-top:12px;
	padding-bottom: 12px;

  }
}

@media(max-width:480px){
  .admat-metal-ranges{
    gap:4px;
    margin-left:12px;
  }
}

/* Inactive range buttons inherit theme */
.admat-metal-ranges button{
  appearance:none;
  background:transparent;
  color:var(--e-global-color-text, currentColor);
  border:1px solid currentColor;
  padding:4px 10px;
  font-size:12px;
  border-radius:999px;
  cursor:pointer;
  line-height:1;
  opacity:.55;
  transition:all .15s ease;
}

@media(max-width:480px){
  .admat-metal-ranges button{
    padding:3px 8px;
    font-size:11px;
  }
}

.admat-metal-ranges button:hover{
  opacity:.8;
}

/* Active range */
.admat-metal-ranges button.is-active{
  background:#333;
  color:#fff;
  border-color:currentColor;
  opacity:1;
}

/* ==============================
   Chart canvas
============================== */

.admat-metal-chart-canvas {
  position: relative;
  width: 100%;
  height: 280px;          /* MOBILE FIX */
  padding: 0 8px 16px;
}

/* Tablet */
@media (min-width: 640px) {
  .admat-metal-chart-canvas {
    height: 420px;
    padding: 0 24px 24px;
  }
}

/* Desktop */
@media (min-width: 1024px) {
  .admat-metal-chart-canvas {
    height: 170px;
  }
}

#stockChart{
  width:100%;
  height:720px;
  display:block;
}

@media(min-width:640px){
  #stockChart{ height:570px; }
}

/* ==============================
   Tooltip
============================== */

.progressive-tooltip{
  position:absolute;
  transform:translate(-50%, -100%);
  pointer-events:none;
  opacity:0;
  z-index:20;
}

.tooltip-table{
  background:transparent;
  border-collapse:collapse;
}

.tooltip-table th{
  font-size:16px;
  font-weight:700;
  padding:0;
}

.tooltip-table td{
  padding:2px 0 0;
}

.dotted-line{
  margin-top:8px;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:6px;
}

/* ==============================
   Unit selector (Gram / Kg / Oz)
   Compact + responsive
============================== */

.admat-metal-unit {
  position: relative;
  display: inline-block;
  width: auto;
  padding-top: 8px;
  padding-bottom:8px;
  margin-left: 12px;
}

@media (min-width: 640px) {
  .admat-metal-unit {
    margin-left: 32px; /* aligns with header + ranges */
  }
}

.admat-metal-unit select {
	width: 100%;          /* 🔑 THIS makes it smaller */
   padding: 6px 14px 6px 14px;
  font-size: 12px;
  line-height: 1;
  border-radius: 999px;
  border: 1px solid currentColor;
  background: transparent;
  font-family: inherit;
  appearance: none;
  cursor: pointer;
  color:var(--e-global-color-text, currentColor);
  opacity:.55;
  transition:all .15s ease;
  -webkit-appearance: none;
}

/* Chevron */
.admat-metal-unit::after {
  content: "▾";
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  pointer-events: none;
  opacity: 0.7;
}


/* Mobile */
@media (max-width: 480px) {
  .admat-metal-unit {
    width: 150px;
  }
 .admat-metal-unit select {
    font-size: 12px;
  }
}

/* =========================================
   Gold / Silver toggle – override Elementor
========================================= */

.admat-metal-chart-wrap .admat-metal-toggle button {
  padding: 6px 12px;
  font-size: 12px;
  line-height: 1;
  border-radius: 999px;

  border: 1px solid currentColor;
  background: transparent;
  color: currentColor;

  font-family: inherit;
  cursor: pointer;
  transition: all .15s ease;
}

/* Hover (optional) */
.admat-metal-chart-wrap .admat-metal-toggle button:hover {
  opacity: 0.85;
}

/* Active state (JS toggles .is-active) */
.admat-metal-chart-wrap .admat-metal-toggle button.is-active {
  background: #333;
  color: #fff;
  border-color: #333;
}

.admat-metal-price {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.price-meta {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.2;
}

.price-growth {
  font-size: 12px;
  font-weight: 600;
  margin-top: 4px;
  display: inline-block;
}

.price-growth.up {
  color: #16a34a; /* green */
}

.price-growth.down {
  color: #dc2626; /* red */
}

/* ==============================
   Skeleton loader
============================== */

.admat-metal-chart-canvas {
  position: relative;
}

.admat-metal-skeleton {
  position: absolute;
  inset: 0;
  border-radius: 12px;
  background: linear-gradient(
    100deg,
    #f2f2f2 30%,
    #e6e6e6 50%,
    #f2f2f2 70%
  );
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite linear;
  z-index: 2;
}

@keyframes shimmer {
  to {
    background-position: -200% 0;
  }
}

/* Hidden once data is ready */
.admat-metal-chart-canvas.is-loaded .admat-metal-skeleton {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.admat-metal-chart-canvas canvas {
  opacity: 0;
  transition: opacity 0.4s ease;
	  width: 100% !important;
  height: 100% !important;
  display: block;
}

.admat-metal-chart-canvas.is-loaded canvas {
  opacity: 1;
}

.admat-metal-disclaimer {
  font-size: 11px;
  color: #9aa0a6;
  margin: 8px 16px 16px;
  line-height: 1.4;
}
