/* CSS Variables for theming and consistency */
:root {
    --bg-light: #ffffff;
    --bg-dark: #fff;
    --body-bg-light: #f0f2f5;
    --text-primary-light: #000;
	  --text-primary-light-: #181616;
    --text-primary-dark: #181616  ;
    --text-secondary-light: #002A77;
    --text-secondary-dark: #f3ede3;
    --border-light: #ccc;
    --border-dark: #374151;
    --black: #444646;
    --white: #fff;
  
    /* State Colors */
    --positive-color: #002554;
    --positive-bg-light: #f2f4f6;
    --positive-bg-dark: rgba(34, 197, 94, 0.2);
    --negative-color: #002554;
    --negative-bg-light: #f2f4f6;
    --negative-bg-dark: rgba(239, 68, 68, 0.2);
    --neutral-color: #002554;
    --neutral-bg-light: #f2f4f6;
    --neutral-bg-dark: rgba(107, 114, 128, 0.2);
  
    --brand-color: #000;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --shadow-hover-color: rgba(228, 225, 225, 0.2);
  }
  

  
  /* Keyframe animation for the 'ping' effect */
  @keyframes ping {
    75%,
    100% {
      transform: scale(2);
      opacity: 0;
    }
  }
  
  /* General Body Styles */
  body {
    font-family: "Inter", sans-serif;
    /* background-color: rgba(255, 255, 255, 0.7); */
    display: flex;
    flex-direction: column;
    /* align-items: center; */
    justify-content: center;
    margin: 0;
    padding: 2rem 1rem;
    gap: 2rem;
    align-items: center;
  }
  
  /* Main Stock Card Container */
  .stock-card {
    width: 100%;
    max-width: 1100px;
    background-color: var(--bg-light);
    border-radius: 0px;
    padding: 1.5rem;
    border: 1px solid var(--lines);
    /* box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1),
      0 4px 6px -4px rgba(0, 0, 0, 0.1),
      0 -6px 12px -4px rgba(0, 0, 0, 0.1); */
    /* transition: box-shadow 0.3s ease-in-out; */
  }
  
  /* .stock-card:hover {
    box-shadow: 0 0 25px var(--shadow-hover-color);
  } */
  
  /* Card Header */
  .card-header {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-start;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--lines);
  }
  .card-header .status {
    display: flex;
    align-items: center;
    gap: 0.75rem;
  }
  .card-header .status-indicator {
    position: relative;
    display: flex;
    height: 0.75rem;
    width: 0.75rem;
  }
  .card-header .status-ping {
    animation: ping 1s cubic-bezier(0, 0, 0.2, 1) infinite;
    position: absolute;
    height: 100%;
    width: 100%;
    border-radius: 9999px;
    opacity: 0.75;
  }
  .card-header .status-dot {
    position: relative;
    display: inline-flex;
    border-radius: 9999px;
    height: 0.75rem;
    width: 0.75rem;
  }
  .card-header .status-text {
    font-size: 1.125rem;
    line-height: 150%;
    font-weight: 500;
    color: var(--primary);
  }
  
  .header-details {
    margin-top: 0.5rem;
  }
  .header-details .last-trade {
    font-size: 16px;
    line-height: 150%;
    color: var(--primary);
    font-weight: 500; /* Made this bold */
  }
  .header-details .last-close {
    font-size: 16px;
    line-height: 1.25rem;
    color: var(--primary);
    margin-top: 0.25rem;
    font-weight: 500;
  }
  
  /* Market Status Styles */
  .status .status-word.open {
    color: #22c55e;
  }
  .status .status-ping,
  .status .status-dot {
    background-color: #22c55e;
  }
  
  .status.closed .status-word.closed {
    color: var(--negative-color);
  }
  .status.closed .status-ping {
    display: none;
  } /* Hide ping animation when closed */
  .status.closed .status-dot {
    background-color: #ef4444;
  }
  
  /* Main Price Display Section */
  .price-display {
    margin: 0 0;
    margin-bottom: 40px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-start;
  }
  .price-display .current-price {
    font-size: 58px;
    line-height: 1;
    font-weight: 600;
    color: var(--secondary);
    margin-top: 0;
    margin-bottom: 10px; 
    
  }

  .price-display .current-price  small {
    font-size: 20px;
    color: var(--primary);
  }

  .price-display .price-change {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    line-height: 2rem;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 0px;
    margin-top: 1rem;
  }
  .price-display .price-change svg {
    height: 1.5rem;
    width: 1.5rem;
    stroke-width: 3;
  }
  
  #last-close-price
  {
	  font-weight:600;
  }
  
  /* DYNAMIC STATE STYLES */
  .price-change.positive {
    color: var(--positive-color);
    background-color: var(--positive-bg-light);
  }
  .price-change.negative {
    color: var(--negative-color);
    background-color: var(--negative-bg-light);
  }
  .price-change.neutral {
    color: var(--neutral-color);
    background-color: var(--neutral-bg-light);
  }

  .price-change.positive svg {
    color: #22c55e;
    background-color: var(--positive-bg-light);
  }
  .price-change.negative svg {
    color: #ef4444;
    background-color: var(--negative-bg-light);
  }
  .price-change.neutral svg {
    color: #6b7280;
    background-color: var(--neutral-bg-light);
  }
  
  /* Day's Range Visualizer */
  .range-visualizer {
    margin: 1.5rem;
  }
  .range-visualizer .labels,
  .range-visualizer .values {
    display: flex;
    justify-content: space-between;
    align-items: center;
    
  }
  .range-visualizer .labels {
    font-size: 16px;
    line-height: 150%;
    font-weight: 400;
    color: var(--primary);
    margin-bottom: 0.5rem;
  }
  .range-visualizer .values {
    font-size: 16px;
    line-height: 150%;
    font-weight: 500;
    color: var(--primary);
    margin-top: 0.5rem;
  }
  .range-visualizer .range-bar {
    position: relative;
    height: 0.5rem;
    width: 100%;
    background-color: #e5e7eb;
    border-radius: 9999px;
  }
  .range-visualizer .range-gradient {
    height: 100%;
    background-image: linear-gradient(to right, #667c98, var(--primary));
    border-radius: 9999px;
  }
  .range-visualizer .range-thumb {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 1rem;
    height: 1rem;
    background-color: var(--bg-light);
    border: 2px solid var(--primary);
    border-radius: 9999px;
    box-shadow: 0 4px 6px -1px var(--shadow-color),
      0 2px 4px -2px var(--shadow-color);
    transition: left 0.3s ease-in-out;
	transition: left 0.6s cubic-bezier(0.34, 1.56, 0.64, 1); /* Bouncy, noticeable slide */
  }
  
  /* Pulse animation for UP movement (GREEN) */
@keyframes thumbPriceChangeUp {
    0% {
        box-shadow: 0 4px 6px -1px var(--shadow-color);
        transform: translateY(-50%) scale(1);
        border-color: var(--brand-color);
    }
    30% {
        box-shadow: 0 0 20px #22c55e;
        transform: translateY(-50%) scale(1.2);
        border-color: #22c55e;
    }
    70% {
        box-shadow: 0 0 10px #22c55e;
        transform: translateY(-50%) scale(1.1);
        border-color: #22c55e;
    }
    100% {
        box-shadow: 0 4px 6px -1px var(--shadow-color);
        transform: translateY(-50%) scale(1);
        border-color: var(--brand-color);
    }
}

/* Pulse animation for DOWN movement (RED) */
@keyframes thumbPriceChangeDown {
    0% {
        box-shadow: 0 4px 6px -1px var(--shadow-color);
        transform: translateY(-50%) scale(1);
        border-color: var(--brand-color);
    }
    30% {
        box-shadow: 0 0 20px var(--negative-color);
        transform: translateY(-50%) scale(1.2);
        border-color: #ef4444;
    }
    70% {
        box-shadow: 0 0 10px #ef4444;
        transform: translateY(-50%) scale(1.1);
        border-color: #ef4444;
    }
    100% {
        box-shadow: 0 4px 6px -1px var(--shadow-color);
        transform: translateY(-50%) scale(1);
        border-color: var(--brand-color);
    }
}

.range-thumb-price-change-up {
    animation: thumbPriceChangeUp 3s ease-out;
}

.range-thumb-price-change-down {
    animation: thumbPriceChangeDown 3s ease-out;
}

  
  /* Detailed Information Grid */
  .details-grid {
    padding-top: 1.5rem;
    border-top: 1px solid var(--lines);
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem 1rem;
  }
  .details-grid .detail-item {
    display: flex;
    flex-direction: column;
  }
  .details-grid .detail-item .label {
    font-size: 16px;
    line-height: 1.25rem;
    color: var(--primary);
    font-weight: 400;
  }
  .details-grid .detail-item .value {
    font-size: 16px;
    line-height: 1.5rem;
    font-weight: 500;
    color: var(--primary);
  }
  
  .detail-item {
    /* background-color: var(--text-secondary-dark); */
    padding: 1rem;
    border-radius: 0px;
    border-bottom: 1px solid var(--lines);
  }
  
  .code {
      margin-bottom: 0;
      margin-top: 50px;
      font-size: 22px;
      color: var(--primary);
      font-weight: 600;
  }
  
  /* --- Card Footer --- */
  .card-footer {
      text-align: right;
      margin-top: 2rem; /* 32px */
      font-size: 12px; /* 12px */
      color: var(--color-text-subtle);
      display: flex;
      justify-content: flex-end;
      align-items: center;
  }
  
  .poweredby img {
      height: 10px;
  }
  
  /* Responsive Design Breakpoints */
  @media (min-width: 640px) {
    .card-header {
      flex-direction: row;
      align-items: center;
      justify-content: space-between;
    }
    .header-details {
      margin-top: 0;
      text-align: right;
    }
    .price-display {
      flex-direction: row;
      align-items: center;
      margin-bottom: 0;
    }
    .price-display .price-change {
      margin-top: 0;
    }
    .details-grid {
      grid-template-columns: repeat(3, minmax(0, 1fr));
    }
  
    
  .price-display .current-price {
      margin-bottom: 40px;
      margin-top:0;
  }
  }
  @media (min-width: 768px) {
    .price-display .current-price {
      font-size: 58px;
      margin-top: 0;
    }
    .details-grid {
      grid-template-columns: repeat(3, minmax(0, 1fr));
    }
  }
  
/* animation */

.price-flash {
    animation: priceFlash 3s ease-in-out; /* Changed from 0.5s to 3s */
}

.price-up {
    animation: priceUpPulse 3s ease-in-out; /* Changed from 0.5s to 3s */
}

.price-down {
    animation: priceDownPulse 3s ease-in-out; /* Changed from 0.5s to 3s */
}

/* Update the keyframe animations to be more gradual */
@keyframes priceFlash {
    0% { background-color: transparent; }
    15% { background-color: rgba(255, 255, 0, 0.3); } /* Adjusted timing */
    50% { background-color: rgba(255, 255, 0, 0.2); }
    85% { background-color: rgba(255, 255, 0, 0.1); }
    100% { background-color: transparent; }
}

@keyframes priceUpPulse {
    0% { color: var(--secondary); transform: scale(1); }
    20% { color: #22c55e; transform: scale(1.02); }
    80% { color: #22c55e; transform: scale(1.01); }
    100% { color: var(--secondary); transform: scale(1); }
}

@keyframes priceDownPulse {
    0% { color: var(--secondary); transform: scale(1); }
    20% { color: #ef4444; transform: scale(0.98); }
    80% { color: #ef4444; transform: scale(0.99); }
    100% { color: var(--secondary); transform: scale(1); }
}

/* Grey text animation for no price change */
@keyframes priceGreyText {
    0% { color: inherit; }
    30% { color: #6b7280; } /* Grey color */
    70% { color: #6b7280; }
    100% { color: var(--secondary); }
}

.price-grey {
    animation: priceGreyText 1s ease-in-out;
}
 