

.news-card {
  background: linear-gradient(135deg, var(--card-bg) 0%, rgba(255, 255, 255, 0.02) 100%);
  border: 3px solid #667eea;
  border-radius: 12px;
  width: 100%;
  box-shadow: 0 4px 16px rgba(102, 126, 234, 0.15);
  padding: 10px 10px 10px 10px; /* Ensure equal padding on all sides */
  margin: 0 auto 24px auto;
  transition: all 0.3s ease;
  position: relative;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  z-index: 10; /* Higher z-index to ensure news cards appear above floating cards */
  box-sizing: border-box; /* Ensure padding is included in width calculation */
}

.news-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(102, 126, 234, 0.25);
  border-color: #764ba2;
  z-index: 20; /* Ensure hovered card is above everything including floating cards */
}

.news-card.highlight {
  border-color: var(--accent-color);
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(59, 130, 246, 0.2);
  z-index: 20; /* Ensure highlighted cards appear above floating cards */
  animation: cardHighlightPulse 2s ease-in-out;
}

@keyframes cardHighlightPulse {
  0%, 100% { 
    box-shadow: 0 12px 32px rgba(59, 130, 246, 0.2);
    transform: translateY(-3px);
  }
  50% { 
    box-shadow: 0 16px 40px rgba(59, 130, 246, 0.3);
    transform: translateY(-5px);
  }
}

/* HLC flash animation for real-time updates - impactful flash */
.hlc-flash {
  animation: hlcFlashImpact 0.6s ease-out;
}

@keyframes hlcFlashImpact {
  0% {
    background-color: rgba(59, 130, 246, 0.8);
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.8), 0 0 40px rgba(59, 130, 246, 0.4);
    color: #ffffff;
  }
  50% {
    background-color: rgba(59, 130, 246, 0.6);
    box-shadow: 0 0 25px rgba(59, 130, 246, 0.6), 0 0 50px rgba(59, 130, 246, 0.3);
    color: #ffffff;
  }
  100% {
    background-color: transparent;
    box-shadow: none;
    color: inherit;
  }
}

/* Ensure first news card has proper spacing and border visibility */
.news-card:first-child {
  z-index: 12; /* Slightly higher z-index for first card */
}

.news-card:first-child:hover {
  z-index: 21; /* Ensure first card hover state is above everything */
}
  
.news-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8em;
  margin-bottom: 6px;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

/* Token container styles (replaces swiper deck) */
.token-container {
  position: relative;
  margin-bottom: 8px;
}
  
  .timestamp,
  .price{
    font-size: 1em;
    color: var(--secondary-text);
  }
  
  .bullishness{
    font-size: 0.85em;
    color: var(--accent-color);
    font-weight: bold;
  } 
  
  .news-card .token {
    font-size: 0.8em;
    font-weight: bold;
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    margin-bottom: 4px;
    padding: 4px 8px;
    background: var(--secondary-bg);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    flex-wrap: nowrap; /* Prevent wrapping to new line */
  }

  /* Light mode token border */
  html.light .news-card .token {
    border: 1px solid rgba(0, 0, 0, 0.15);
  }

  .news-card .token .token-info {
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    gap: 6px;
    flex: 1;
    min-width: 0; /* Allow shrinking */
  }

  .news-card .token .token-symbol {
    font-size: 0.85em;
    font-weight: 700;
    color: white !important;
    padding: 4px 10px !important;
    border-radius: 10px !important;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.9) 0%, rgba(217, 119, 6, 0.8) 100%) !important;
    border: none !important;
    box-shadow: 0 1px 3px rgba(34, 197, 94, 0.25) !important;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    flex-shrink: 0; /* Don't shrink */
  }

  .news-card .token .company-name {
    color: var(--text-color);
    padding: 3px 8px !important;
    border-radius: 12px !important;
    font-size: 0.8em;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.1);
    color: white !important;
    border: none !important;
    box-shadow: 0 1px 3px rgba(102, 126, 234, 0.2) !important;
    flex-shrink: 0; /* Don't shrink */
    width: fit-content; /* Only take space needed for content */
    max-width: 35%; /* Remove any width constraints */
  }

  /* Market Type Label (Stock/Crypto) - NEW separate label */
  .news-card .token .market-type-label {
    color: white !important;
    padding: 3px 8px !important;
    border-radius: 12px !important;
    font-size: 0.8em;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.1);
    border: none !important;
    flex-shrink: 0;
    width: fit-content;
    max-width: none;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    transition: all 0.2s ease;
    cursor: help;
  }

  /* Crypto market type label styling */
  .news-card .token .market-type-label.crypto-label {
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.25) 0%, rgba(234, 88, 12, 0.2) 100%) !important;
    color: rgba(249, 115, 22, 1) !important;
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(249, 115, 22, 0.2) !important;
    border: 1px solid rgba(249, 115, 22, 0.35) !important;
  }

  .news-card .token .market-type-label.crypto-label:hover {
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.3) 0%, rgba(234, 88, 12, 0.25) 100%) !important;
    box-shadow: 0 2px 4px rgba(249, 115, 22, 0.25) !important;
    transform: translateY(-1px);
  }

  /* Stock market type label styling */
  .news-card .token .market-type-label.stock-label {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.25) 0%, rgba(99, 102, 241, 0.2) 100%) !important;
    color: rgba(59, 130, 246, 1) !important;
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(59, 130, 246, 0.2) !important;
    border: 1px solid rgba(59, 130, 246, 0.35) !important;
  }

  .news-card .token .market-type-label.stock-label:hover {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.3) 0%, rgba(99, 102, 241, 0.25) 100%) !important;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.25) !important;
    transform: translateY(-1px);
  }

  .news-card .token .sector-industry-tag {
    color: white !important;
    padding: 3px 8px !important;
    border-radius: 12px !important;
    font-size: 0.8em;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.1);
    border: none !important;
    box-shadow: 0 1px 3px rgba(245, 158, 11, 0.25) !important;
    flex-shrink: 0; /* Don't shrink */
    width: fit-content; /* Only take space needed for content */
    max-width: none; /* Remove any width constraints */
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    transition: all 0.2s ease;
    cursor: help;
  }

  /* Remove old crypto/stock label styling from sector tag since we have separate market-type-label now */
  .news-card .token .sector-industry-tag.crypto-label,
  .news-card .token .sector-industry-tag.stock-label {
    /* Reset to default styling */
    background: rgba(255, 255, 255, 0.1);
    color: white !important;
    border: none !important;
    box-shadow: 0 1px 3px rgba(245, 158, 11, 0.25) !important;
  }

  .news-card .token .market-cap-label {
    display: inline-block; /* Ensure it's visible by default */
    color: white !important;
    padding: 3px 8px !important;
    border-radius: 12px !important;
    font-size: 0.8em;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.1);
    border: none !important;
    box-shadow: 0 1px 3px rgba(245, 158, 11, 0.25) !important;
    flex-shrink: 0; /* Don't shrink */
    width: fit-content; /* Only take space needed for content */
    max-width: none; /* Remove any width constraints */
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    transition: all 0.2s ease;
    cursor: help;
  }

  .news-card .token .market-cap-label:hover {
    background: rgba(255, 255, 255, 0.15) !important;
    box-shadow: 0 2px 4px rgba(245, 158, 11, 0.3) !important;
    transform: translateY(-1px);
  }



  /* HLC Values Styling */
  .hlc-values {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.65em;
    font-weight: 600;
    flex-shrink: 0; /* Prevent shrinking */
  }

  /* Medium screens - prevent overlap between company name and H,L,C */
  @media (max-width: 1200px) and (min-width: 769px) {
    .news-card .token {
      flex-direction: row;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      padding: 8px;
      flex-wrap: nowrap;
    }
    
    .news-card .token .token-info {
      display: flex;
      flex-direction: row;
      align-items: center;
      gap: 6px;
      flex: 0 1 auto; /* Don't expand to fill space */
      min-width: 0;
      max-width: 40%; /* Limit token info to 65% of width */
    }
    
    .news-card .token .token-symbol {
      font-size: 0.8em;
      padding: 4px 9px !important;
      border-radius: 10px !important;
      flex-shrink: 0;
      white-space: nowrap;
    }
    
    .news-card .token .company-name {
      font-size: 0.8em;
      padding: 3px 7px !important;
      flex-shrink: 1; /* Allow shrinking if needed */
      width: fit-content;
      max-width: 150px; /* Reduced max width to make room for sector tag */
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      min-width: 0; /* Allow shrinking */
    }
    
    .news-card .token .market-type-label {
      font-size: 0.8em;
      padding: 3px 6px !important;
      flex-shrink: 0;
      width: fit-content;
      white-space: nowrap;
    }
    
    .news-card .token .sector-industry-tag {
      font-size: 0.8em;
      padding: 3px 6px !important;
      width: fit-content;
      max-width: 120px; /* Limit width */
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      min-width: 0; /* Allow shrinking */
    }
    
    .news-card .token .market-cap-label {
      font-size: 0.8em;
      padding: 3px 6px !important;
      width: fit-content;
      max-width: 100px; /* Limit width */
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      min-width: 0; /* Allow shrinking */
    }
    
    .hlc-values {
      display: flex;
      align-items: center;
      gap: 4px;
      font-size: 0.65em;
      flex-shrink: 0;
      margin-left: auto; /* Push to right */
      min-width: 130px; /* Ensure minimum space for H,L,C */
    }
    
    .hlc-item {
      padding: 2px 4px;
      text-align: center;
      border-radius: 4px;
      white-space: nowrap;
      min-width: 38px;
    }
  }

  /* Tablet and small desktop - stack H,L,C below for very constrained widths */
  @media (max-width: 768px) and (min-width: 600px) {
    .news-card .token {
      flex-direction: column;
      align-items: stretch;
      gap: 6px;
      padding: 8px;
    }
    
    .news-card .token .token-info {
      display: flex;
      flex-direction: row;
      align-items: center;
      gap: 6px;
      width: 100%;
      flex-wrap: wrap; /* Allow wrapping if needed */
    }
    
    .news-card .token .company-name {
      font-size: 0.8em;
    }
    
    .news-card .token .sector-industry-tag {
      font-size: 0.8em;
      padding: 2px 5px !important;
      max-width: 140px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    
    .news-card .token .market-cap-label {
      font-size: 0.8em;
      padding: 2px 5px !important;
      max-width: 100px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    
    .news-card .token .market-type-label {
      font-size: 0.8em;
    }
    
    .hlc-values {
      display: flex;
      justify-content: space-between;
      gap: 6px;
      font-size: 0.7em;
      width: 100%;
      margin-top: 4px;
      padding: 4px 0;
      border-top: 1px solid rgba(255, 255, 255, 0.1);
    }

    /* Light mode hlc-values border */
    html.light .hlc-values {
      border-top: 1px solid rgba(0, 0, 0, 0.15);
    }
    
    .hlc-item {
      flex: 1;
      text-align: center;
      padding: 3px 6px;
    }
  }

  .hlc-item {
    position: relative;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    cursor: help;
    transition: all 0.2s ease;
  }

  /* Light mode hlc-item border */
  html.light .hlc-item {
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.15);
  }

  .hlc-item:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
  }

  /* Color coding for HLC values */
  .hlc-high.positive,
  .hlc-low.positive,
  .hlc-current.positive {
    color: #22c55e;
  }

  .hlc-high.negative,
  .hlc-low.negative,
  .hlc-current.negative {
    color: #ef4444;
  }

  .hlc-high.neutral,
  .hlc-low.neutral,
  .hlc-current.neutral {
    color: var(--text-color);
  }

  /* Tooltip styling */
  .hlc-item::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 6px 8px;
    border-radius: 4px;
    font-size: 11px;
    white-space: normal;
    max-width: 200px;
    word-wrap: break-word;
    text-align: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 1000;
    pointer-events: none;
    /* Prevent tooltip from extending beyond viewport */
    box-sizing: border-box;
  }

  /* Adjust tooltip position on smaller screens */
  @media (max-width: 768px) {
    .hlc-item::after {
      max-width: 150px;
      font-size: 10px;
      padding: 4px 6px;
    }
  }

  /* Ensure tooltip stays within viewport bounds */
  .hlc-item:first-child::after {
    left: 0;
    transform: translateX(0);
  }

  .hlc-item:last-child::after {
    left: auto;
    right: 0;
    transform: translateX(0);
  }

  .hlc-item::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(1px);
    border: 4px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.9);
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 1000;
  }

  /* Adjust arrow position for edge tooltips */
  .hlc-item:first-child::before {
    left: 12px;
    transform: translateX(0) translateY(1px);
  }

  .hlc-item:last-child::before {
    left: auto;
    right: 12px;
    transform: translateX(0) translateY(1px);
  }

  .hlc-item:hover::after,
  .hlc-item:hover::before {
    opacity: 1;
    visibility: visible;
  }

  /* Light theme adjustments for tooltips */
  html.light .hlc-item::after {
    background: rgba(0, 0, 0, 0.8);
    color: white;
  }

  html.light .hlc-item::before {
    border-top-color: rgba(0, 0, 0, 0.8);
  }

  /* Light theme adjustments for H/C/L borders */
  html.light .hlc-item {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.2);
    color: var(--text-color);
  }

  html.light .hlc-item:hover {
    background: rgba(255, 255, 255, 1);
    border: 1px solid rgba(0, 0, 0, 0.3);
  }

  /* Mobile responsive adjustments */
  @media (max-width: 600px) {
    .news-card .token {
      flex-direction: row; /* Keep horizontal layout on mobile */
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      padding: 8px;
      flex-wrap: nowrap; /* Prevent wrapping */
    }
    
    .news-card .token .token-info {
      display: flex;
      flex-direction: row;
      align-items: center;
      gap: 4px;
      flex: 0 1 auto; /* Don't expand to fill space */
      min-width: 0; /* Allow shrinking */
      justify-content: flex-start;
      flex-wrap: wrap; /* Allow wrapping on very small screens */
    }
    
    .news-card .token .token-symbol {
      font-size: 0.75em;
      padding: 3px 8px !important;
      border-radius: 10px !important;
      flex-shrink: 0;
      white-space: nowrap;
    }
    
    .news-card .token .company-name {
      font-size: 0.8em;
      padding: 3px 6px !important;
      flex-shrink: 0; /* Don't shrink */
      width: fit-content; /* Only take space needed */
      text-align: left;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      min-width: 0; /* Allow shrinking if absolutely necessary */
      max-width: 120px; /* Reduced max width for mobile */
    }
    
    .news-card .token .sector-industry-tag {
      font-size: 0.8em;
      padding: 3px 5px !important;
      flex-shrink: 0; /* Don't shrink */
      width: fit-content;
      max-width: 140px; /* Smaller max width for mobile */
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      min-width: 0;
    }
    
    .news-card .token .market-cap-label {
      font-size: 0.8em;
    }
    
    .news-card .token .market-type-label {
      font-size: 0.8em;
    }
    
    .hlc-values {
      display: flex;
      align-items: center;
      gap: 3px;
      font-size: 0.6em;
      flex-shrink: 0; /* Prevent shrinking */
      margin-left: auto; /* Push to right */
    }
    
    .hlc-item {
      padding: 2px 4px;
      text-align: center;
      min-width: 0;
      border-radius: 4px;
      white-space: nowrap;
    }
    
    .hlc-item::after {
      font-size: 9px;
      padding: 3px 5px;
    }
  }

  @media (max-width: 480px) {
    .news-card .token {
      padding: 6px;
      gap: 6px;
      flex-wrap: nowrap; /* Ensure no wrapping */
    }
    
    .news-card .token .token-info {
      gap: 3px;
      flex: 0 1 auto; /* Don't expand to fill space */
      min-width: 0;
      flex-wrap: wrap; /* Allow wrapping on very small screens */
    }
    
    .news-card .token .token-symbol {
      font-size: 0.7em;
      padding: 3px 7px !important;
      border-radius: 8px !important;
      flex-shrink: 0;
    }
    
    .news-card .token .company-name {
      font-size: 0.8em;
      padding: 3px 5px !important;
      min-width: 0; /* Allow shrinking */
      max-width: 140px; /* Smaller max width for very small screens */
      flex-shrink: 0;
      width: fit-content;
    }
    
    .news-card .token .sector-industry-tag {
      font-size: 0.8em;
      padding: 2px 4px !important;
      min-width: 0;
      max-width: 140px; /* Very small max width */
      flex-shrink: 0;
      width: fit-content;
    }
    
    .news-card .token .market-cap-label {
      font-size: 0.8em;
    }
    
    .news-card .token .market-type-label {
      font-size: 0.8em;
    }
    
    .hlc-values {
      font-size: 0.55em;
      gap: 2px;
      flex-shrink: 0;
    }
    
    .hlc-item {
      padding: 1px 3px;
      font-size: 0.9em;
      border-radius: 3px;
      min-width: 20px;
    }
  }

  /* Extra small screens - ensure no overlap */
  @media (max-width: 360px) {
    .news-card .token {
      padding: 4px;
      gap: 4px;
      flex-wrap: nowrap;
    }
    
    .news-card .token .token-info {
      gap: 2px;
      flex: 0 1 auto; /* Don't expand to fill space */
      min-width: 0;
      flex-wrap: wrap; /* Allow wrapping on very small screens */
    }
    
    .news-card .token .token-symbol {
      font-size: 0.65em;
      padding: 3px 6px !important;
      flex-shrink: 0;
    }
    
    .news-card .token .company-name {
      font-size: 0.8em;
      padding: 3px 5px !important;
      min-width: 0;
      max-width: 80px; /* Very small max width for very small screens */
      flex-shrink: 0;
      width: fit-content;
    }
    
    .news-card .token .sector-industry-tag {
      font-size: 0.8em;
      padding: 2px 3px !important;
      min-width: 0;
      max-width: 60px; /* Very small max width */
      flex-shrink: 0;
      width: fit-content;
    }
    
    .news-card .token .market-cap-label {
      font-size: 0.8em;
    }
    
    .news-card .token .market-type-label {
      font-size: 0.8em;
    }
      max-width: 60px; /* Very small max width */
      flex-shrink: 0;
      width: fit-content;
    }
    
    .hlc-values {
      font-size: 0.5em;
      gap: 1px;
      flex-shrink: 0;
    }
    
    .hlc-item {
      padding: 1px 2px;
      font-size: 0.9em;
      border-radius: 2px;
      min-width: 18px;
    }
  }

  /* Ultra small screens - stack H,L,C below if absolutely necessary */
  @media (max-width: 320px) {
    .news-card .token {
      flex-direction: column;
      align-items: stretch;
      gap: 4px;
    }
    
    .news-card .token .token-info {
      display: flex;
      flex-direction: row;
      align-items: center;
      gap: 3px;
      width: 100%;
      flex-wrap: wrap; /* Allow wrapping */
    }
    
    .news-card .token .company-name {
      font-size: 0.8em;
      max-width: 70px; /* Very small max width for ultra small screens */
      width: fit-content;
      flex-shrink: 0;
    }
    
    .news-card .token .sector-industry-tag {
      font-size: 0.8em;
      padding: 2px 3px !important;
      max-width: 50px; /* Very small max width */
      width: fit-content;
      flex-shrink: 0;
    }
    
    .news-card .token .market-cap-label {
      font-size: 0.8em;
    }
    
    .news-card .token .market-type-label {
      font-size: 0.8em;
    }
    
    .hlc-values {
      display: flex;
      justify-content: space-between;
      gap: 2px;
      font-size: 0.5em;
      width: 100%;
      margin-top: 2px;
      padding: 2px 0;
      border-top: 1px solid rgba(255, 255, 255, 0.1);
    }

    /* Light mode hlc-values border for small screens */
    html.light .hlc-values {
      border-top: 1px solid rgba(0, 0, 0, 0.15);
    }
    
    .hlc-item {
      flex: 1;
      text-align: center;
      padding: 1px 2px;
    }
  }

  [data-theme="dark"] .news-card .token .company-name {
    background: linear-gradient(135deg, var(--accent-color) 0%, rgba(102, 126, 234, 0.8) 100%) !important;
    color: white !important;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3) !important;
  }

  [data-theme="dark"] .news-card .token .token-symbol {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.9) 0%, rgba(22, 163, 74, 0.8) 100%) !important;
    color: white !important;
    box-shadow: 0 2px 4px rgba(34, 197, 94, 0.3) !important;
  }

  [data-theme="dark"] .news-card .token .sector-industry-tag {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.9) 0%, rgba(217, 119, 6, 0.8) 100%) !important;
    color: white !important;
    box-shadow: 0 2px 4px rgba(245, 158, 11, 0.3) !important;
  }

  [data-theme="dark"] .news-card .token .market-cap-label {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.9) 0%, rgba(124, 58, 237, 0.8) 100%) !important;
    color: white !important;
    box-shadow: 0 2px 4px rgba(139, 92, 246, 0.3) !important;
  }

  /* Light theme adjustments */
  [data-theme="light"] .news-card {
    background: linear-gradient(135deg, #ffffff 0%, #fafafa 100%);
    border: 2px solid #d1d5db;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  }

  [data-theme="light"] .news-card .token {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.06) 0%, rgba(0, 0, 0, 0.03) 100%);
    border-color: #e5e7eb;
  }

  [data-theme="light"] .news-card .token .token-symbol {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.85) 0%, rgba(22, 163, 74, 0.75) 100%) !important;
    color: white !important;
    box-shadow: 0 2px 4px rgba(34, 197, 94, 0.2) !important;
  }

  html.light .news-card .token .company-name {
    background: rgba(255, 255, 255, 0.9) !important;
    color: var(--text-color) !important;
    border: 1px solid rgba(0, 0, 0, 0.15) !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
  }

  html.light .news-card .token .sector-industry-tag {
    background: rgba(255, 255, 255, 0.9) !important;
    color: var(--text-color) !important;
    border: 1px solid rgba(0, 0, 0, 0.15) !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
  }

  html.light .news-card .token .market-cap-label {
    background: rgba(255, 255, 255, 0.9) !important;
    color: var(--text-color) !important;
    border: 1px solid rgba(0, 0, 0, 0.15) !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
  }

  html.light .news-card .token .market-cap-label:hover {
    background: rgba(255, 255, 255, 1) !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15) !important;
  }

  /* Light theme market-type-label */
  html.light .news-card .token .market-type-label.crypto-label {
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.15) 0%, rgba(234, 88, 12, 0.12) 100%) !important;
    color: rgba(234, 88, 12, 1) !important;
    border: 1px solid rgba(249, 115, 22, 0.3) !important;
    box-shadow: 0 1px 3px rgba(249, 115, 22, 0.15) !important;
  }

  html.light .news-card .token .market-type-label.crypto-label:hover {
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.2) 0%, rgba(234, 88, 12, 0.17) 100%) !important;
    box-shadow: 0 2px 4px rgba(249, 115, 22, 0.2) !important;
  }

  html.light .news-card .token .market-type-label.stock-label {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15) 0%, rgba(99, 102, 241, 0.12) 100%) !important;
    color: rgba(37, 99, 235, 1) !important;
    border: 1px solid rgba(59, 130, 246, 0.3) !important;
    box-shadow: 0 1px 3px rgba(59, 130, 246, 0.15) !important;
  }

  html.light .news-card .token .market-type-label.stock-label:hover {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2) 0%, rgba(99, 102, 241, 0.17) 100%) !important;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2) !important;
  }

  html.light .news-card .token .market-cap-label {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.15) 0%, rgba(124, 58, 237, 0.12) 100%) !important;
    color: rgba(109, 40, 217, 1) !important;
    border: 1px solid rgba(139, 92, 246, 0.3) !important;
    box-shadow: 0 1px 3px rgba(139, 92, 246, 0.15) !important;
  }

  html.light .news-card .token .market-cap-label:hover {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2) 0%, rgba(124, 58, 237, 0.17) 100%) !important;
    box-shadow: 0 2px 4px rgba(139, 92, 246, 0.2) !important;
  }

  [data-theme="light"] .report-container {
    background: var(--secondary-bg);
    border-color: rgba(148, 163, 184, 0.3);
  }

  /* Updated light mode report-container with proper selector */
  html.light .report-container {
    border-color: rgba(0, 0, 0, 0.2);
  }

  [data-theme="light"] .report-container::before {
    background: var(--secondary-bg);  
  }

  [data-theme="light"] .report-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.8) 0%, rgba(248, 250, 252, 0.6) 100%);
    border: 1px solid rgba(148, 163, 184, 0.2);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.8);
  }

  [data-theme="light"] .card-title {
    color: rgba(71, 85, 105, 0.8);
  }

  [data-theme="light"] .action-buttons {
    background: linear-gradient(135deg, rgba(248, 250, 252, 0.8) 0%, rgba(241, 245, 249, 0.6) 100%);
    border-color: rgba(148, 163, 184, 0.3);
  }

  [data-theme="light"] .action-buttons::before {
    background: linear-gradient(90deg, rgba(34, 197, 94, 0.6) 0%, rgba(16, 185, 129, 0.6) 50%, rgba(6, 182, 212, 0.6) 100%);
  }

  [data-theme="light"] .action-buttons button {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 250, 252, 0.9) 100%);
    border: 1px solid rgba(100, 116, 139, 0.4);
    color: #1e293b;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
  }

  [data-theme="light"] .action-buttons button:hover {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.9) 0%, rgba(16, 185, 129, 0.8) 100%);
    color: white;
    border-color: rgba(34, 197, 94, 0.7);
    box-shadow: 0 6px 20px rgba(34, 197, 94, 0.3);
  }

  [data-theme="light"] .action-buttons button.active {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.9) 0%, rgba(99, 102, 241, 0.8) 100%);
    color: white;
    border-color: rgba(59, 130, 246, 0.7);
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
  }

  [data-theme="light"] .action-buttons button.active:hover {
    background: linear-gradient(135deg, rgba(59, 130, 246, 1) 0%, rgba(99, 102, 241, 0.9) 100%);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
  }

  [data-theme="light"] .summary-container {
    background: var(--secondary-bg);
    border-color: rgba(148, 163, 184, 0.2);
  }

  [data-theme="light"] .icon-btn {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(248, 250, 252, 0.7) 100%);
    border-color: rgba(148, 163, 184, 0.2);
  }

  [data-theme="light"] .icon-btn:hover {
    background: linear-gradient(135deg, rgba(248, 250, 252, 0.9) 0%, rgba(241, 245, 249, 0.8) 100%);
  }

  /* Light theme AI Assessment cards */
  [data-theme="light"] .recommendation-buy .report-card.recommendation {
    background: rgba(34, 197, 94, 0.1);
    border-color: rgba(34, 197, 94, 0.6);
  }

  [data-theme="light"] .recommendation-neutral .report-card.recommendation {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.6);
  }

  [data-theme="light"] .recommendation-cautious .report-card.recommendation {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(239, 95, 38, 0.6);
  }
  
  .price-label {
    display: inline-flex;
    align-items: center;
  }

  /* Container - Redesigned for informative display */
  .report-container {
    display: grid;
    text-align: center;
    grid-template-columns: repeat(4, minmax(0, 2fr));
    gap: 8px;
    overflow: hidden;
    margin: 4px 0 8px 0;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid rgba(226, 232, 240, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    position: relative;
    background: var(--secondary-bg);
  }

  /* Add subtle informative indicator */
  .report-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: 16px 16px 0 0;
  }

  /* Cards - Redesigned for informative content */
  .report-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.06) 100%);
    border-radius: 8px;
    padding: 6px 4px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.1);

    /* KEY FIX: force title above content */
    display: grid;
    grid-template-rows: auto 1fr;
    row-gap: 2px;

    /* KEY FIX: allow shrinking inside grid */
    min-width: 0;
    
    /* Smooth transitions for informative styling */
    transition: all 0.2s ease;
  }

  /* Light mode report-card border */
  html.light .report-card {
    border: 1px solid rgba(0, 0, 0, 0.15);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08), inset 0 1px 0 rgba(0, 0, 0, 0.05);
  }

  /* AI Assessment Card - Dynamic Background Colors */
  .report-card.recommendation {
    position: relative;
    overflow: hidden;
  }

  .report-card.recommendation::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0.1;
    border-radius: 12px;
    transition: opacity 0.3s ease;
  }

  /* Buy Assessment - Enhanced Green */
  .recommendation-buy .report-card.recommendation {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.2) 0%, rgba(34, 197, 94, 0.1) 100%);
    border: 2px solid rgba(34, 197, 94, 0.7);
    color: var(--text-color);
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.15);
  }

  .recommendation-buy .report-card.recommendation .card-content {
    color: var(--text-color);
  }

  /* Hold Assessment - Enhanced Blue */
  .recommendation-neutral .report-card.recommendation {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2) 0%, rgba(59, 130, 246, 0.1) 100%);
    border: 2px solid rgba(59, 130, 246, 0.7);
    color: var(--text-color);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.15);
  }

  .recommendation-neutral .report-card.recommendation .card-content {
    color: var(--text-color);
  }

  /* Watch Assessment - Enhanced Orange */
  .recommendation-cautious .report-card.recommendation {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2) 0%, rgba(245, 158, 11, 0.1) 100%);
    border: 2px solid rgba(245, 38, 11, 0.676);
    color: var(--text-color);
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.15);
  }

  .recommendation-cautious .report-card.recommendation .card-content {
    color: var(--text-color);
  }

  /* Enhanced styling for other cards with modern gradients - Neutral background for non-AI Assessment cards */
  .report-card:not(.recommendation) {
    background: linear-gradient(135deg, rgba(148, 163, 184, 0.08) 0%, rgba(148, 163, 184, 0.05) 100%);
    border: 1px solid rgba(148, 163, 184, 0.2);
    box-shadow: 0 2px 8px rgba(148, 163, 184, 0.1);
  }

  /* Individual card type styling for better distinction - Neutral colors for focus on AI Assessment */
  .report-card.change {
    background: linear-gradient(135deg, 
      rgba(148, 163, 184, 0.12) 0%, 
      rgba(148, 163, 184, 0.08) 50%, 
      rgba(148, 163, 184, 0.06) 100%);
    border: 2px solid rgba(148, 163, 184, 0.3);
    box-shadow: 
      0 4px 16px rgba(148, 163, 184, 0.15),
      0 2px 8px rgba(148, 163, 184, 0.1),
      inset 0 1px 0 rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
  }

  /* Add subtle animated glow effect - Neutral colors */
  .report-card.change::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
      transparent 0%, 
      rgba(148, 163, 184, 0.08) 50%, 
      transparent 100%);
    transition: left 0.6s ease;
    pointer-events: none;
  }

  .report-card.change:hover::before {
    left: 100%;
  }

  /* Standardized content styling for all report cards */
  .report-card .card-title {
    font-weight: 600;
    font-size: clamp(5px, 1.2vw, 9px);
    letter-spacing: 0.3px;
    text-transform: uppercase;
    color: var(--text-color);
    opacity: 0.8;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    margin-bottom: 4px;
  }

  /* Responsive font sizes for card titles */
  @media (max-width: 1200px) {
    .report-card .card-title {
      font-size: clamp(4px, 1.1vw, 8px);
      letter-spacing: 0.2px;
    }
  }

  @media (max-width: 768px) {
    .report-card .card-title {
      font-size: clamp(8px, 1.4vw, 11px);
      letter-spacing: 0.1px;
    }
  }

  @media (max-width: 480px) {
    .report-card .card-title {
      font-size: clamp(7px, 1.2vw, 9px);
      letter-spacing: 0.1px;
    }
  }

  @media (max-width: 360px) {
    .report-card .card-title {
      font-size: clamp(6px, 1vw, 8px);
      letter-spacing: 0px;
    }
  }

  .report-card .card-content {
    font-weight: 700;
    font-size: clamp(8px, 1.8vw, 13px);
    color: var(--text-color);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 4px;
  }


  /* Specific styling for Trigger Reason values - Consistent with other tabs */
  .report-card.change .change-value {
    color: var(--text-color);
    font-weight: 400;
    font-size: clamp(8px, 1.8vw, 13px);
  }

  /* Color styling for positive and negative change values */
  .change-value.positive {
    color: #27ae60 !important; /* Green for positive changes */
  }

  .change-value.negative {
    color: #e74c3c !important; /* Red for negative changes */
  }

  /* Light theme adjustments */
  [data-theme="light"] .change-value.positive {
    color: #2ecc71 !important; /* Slightly brighter green for light theme */
  }

  [data-theme="light"] .change-value.negative {
    color: #c0392b !important; /* Slightly darker red for light theme */
  }

  /* History widget trigger value colors */
  .history-trigger-value.positive {
    color: #27ae60 !important; /* Green for positive changes */
  }

  .history-trigger-value.negative {
    color: #e74c3c !important; /* Red for negative changes */
  }

  [data-theme="light"] .history-trigger-value.positive {
    color: #2ecc71 !important; /* Slightly brighter green for light theme */
  }

  [data-theme="light"] .history-trigger-value.negative {
    color: #c0392b !important; /* Slightly darker red for light theme */
  }

  .report-card.change .duration-value {
    color: var(--text-color);
    font-weight: 400;
  }

  /* Light theme text adjustments */
  [data-theme="light"] .report-card .card-title {
    color: var(--text-color);
    opacity: 0.7;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5);
  }

  [data-theme="light"] .report-card.change .change-value {
    color: var(--text-color);
  }

  [data-theme="light"] .report-card.change .duration-value {
    color: var(--text-color);
  }

  .report-card.price {
    background: linear-gradient(135deg, rgba(148, 163, 184, 0.12) 0%, rgba(148, 163, 184, 0.08) 100%);
    border: 2px solid rgba(148, 163, 184, 0.3);
    box-shadow: 0 2px 8px rgba(148, 163, 184, 0.15);
  }

  .report-card.bullishness {
    background: linear-gradient(135deg, rgba(148, 163, 184, 0.12) 0%, rgba(148, 163, 184, 0.08) 100%);
    border: 2px solid rgba(148, 163, 184, 0.3);
    box-shadow: 0 2px 8px rgba(148, 163, 184, 0.15);
  }

  /* Sentiment Progress Bar Styles */
  .sentiment-progress-container {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
    align-items: center;
    position: relative;
  }

  .sentiment-progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
  }

  /* Light mode sentiment-progress-bar border */
  html.light .sentiment-progress-bar {
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.15);
  }

  .sentiment-progress-fill {
    height: 100%;
    width: 0%;
    border-radius: 4px;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    background: linear-gradient(90deg, #ef4444 0%, #f97316 25%, #eab308 50%, #84cc16 75%, #22c55e 100%);
    background-size: 100% 100%;
    background-position: 0% 0%;
  }

  /* Dynamic color based on value */
  .sentiment-progress-fill[data-value="0"] { background: #ef4444; }
  .sentiment-progress-fill[data-value="1"] { background: linear-gradient(90deg, #ef4444 0%, #f97316 100%); }
  .sentiment-progress-fill[data-value="2"] { background: linear-gradient(90deg, #f97316 0%, #eab308 100%); }
  .sentiment-progress-fill[data-value="3"] { background: linear-gradient(90deg, #eab308 0%, #84cc16 100%); }
  .sentiment-progress-fill[data-value="4"] { background: linear-gradient(90deg, #84cc16 0%, #22c55e 100%); }

  .sentiment-value-text {
    font-size: clamp(6px, 1.2vw, 9px);
    font-weight: 700;
    color: var(--text-color);
    opacity: 0;
    margin-top: 2px;
    transition: opacity 0.3s ease;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    padding: 2px 6px;
    border-radius: 4px;
    white-space: nowrap;
    pointer-events: none;
    z-index: 10;
  }

  /* Responsive font sizes for sentiment value text */
  @media (max-width: 768px) {
    .sentiment-value-text {
      font-size: clamp(7px, 1.2vw, 9px);
      padding: 1px 4px;
    }
  }

  @media (max-width: 480px) {
    .sentiment-value-text {
      font-size: clamp(6px, 1vw, 8px);
      padding: 1px 3px;
    }
  }

  /* Show value on hover */
  .report-card.bullishness:hover .sentiment-value-text {
    opacity: 1;
  }

  /* Light theme adjustments */
  [data-theme="light"] .sentiment-progress-bar {
    background: rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.15);
  }

  [data-theme="light"] .sentiment-value-text {
    background: rgba(255, 255, 255, 0.95);
    color: #1f2937;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  }

  /* Light theme adjustments for individual cards - Neutral colors */
  [data-theme="light"] .report-card.change {
    background: linear-gradient(135deg, 
      rgba(148, 163, 184, 0.08) 0%, 
      rgba(148, 163, 184, 0.06) 50%, 
      rgba(148, 163, 184, 0.04) 100%);
    border: 2px solid rgba(148, 163, 184, 0.25);
    box-shadow: 
      0 3px 12px rgba(148, 163, 184, 0.12),
      0 1px 6px rgba(148, 163, 184, 0.08),
      inset 0 1px 0 rgba(255, 255, 255, 0.4);
  }

  [data-theme="light"] .report-card.price {
    background: linear-gradient(135deg, rgba(148, 163, 184, 0.08) 0%, rgba(148, 163, 184, 0.04) 100%);
    border: 2px solid rgba(148, 163, 184, 0.25);
    box-shadow: 0 1px 6px rgba(148, 163, 184, 0.12);
  }

  [data-theme="light"] .report-card.bullishness {
    background: linear-gradient(135deg, rgba(148, 163, 184, 0.08) 0%, rgba(148, 163, 184, 0.04) 100%);
    border: 2px solid rgba(148, 163, 184, 0.25);
    box-shadow: 0 1px 6px rgba(148, 163, 184, 0.12);
  }

  /* Light theme sentiment progress bar */
  [data-theme="light"] .sentiment-progress-bar {
    background: rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.15);
  }

  .report-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
  }

  /* Enhanced hover effects for individual card types - Neutral colors */
  .report-card.change:hover {
    background: linear-gradient(135deg, 
      rgba(148, 163, 184, 0.18) 0%, 
      rgba(148, 163, 184, 0.15) 50%, 
      rgba(148, 163, 184, 0.12) 100%);
    border: 2px solid rgba(148, 163, 184, 0.4);
    box-shadow: 
      0 8px 24px rgba(148, 163, 184, 0.2),
      0 4px 16px rgba(148, 163, 184, 0.15),
      0 2px 8px rgba(148, 163, 184, 0.1),
      inset 0 1px 0 rgba(255, 255, 255, 0.3);
    transform: translateY(-3px) scale(1.02);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }

  /* Light theme hover effect - Neutral colors */
  [data-theme="light"] .report-card.change:hover {
    background: linear-gradient(135deg, 
      rgba(148, 163, 184, 0.15) 0%, 
      rgba(148, 163, 184, 0.12) 50%, 
      rgba(148, 163, 184, 0.08) 100%);
    border: 2px solid rgba(148, 163, 184, 0.35);
    box-shadow: 
      0 6px 20px rgba(148, 163, 184, 0.18),
      0 3px 12px rgba(148, 163, 184, 0.12),
      0 1px 6px rgba(148, 163, 184, 0.08),
      inset 0 1px 0 rgba(255, 255, 255, 0.5);
    transform: translateY(-3px) scale(1.02);
  }

  .report-card.price:hover {
    background: linear-gradient(135deg, rgba(148, 163, 184, 0.18) 0%, rgba(148, 163, 184, 0.12) 100%);
    box-shadow: 0 4px 12px rgba(148, 163, 184, 0.2);
    transform: translateY(-2px);
  }

  .report-card.bullishness:hover {
    background: linear-gradient(135deg, rgba(148, 163, 184, 0.18) 0%, rgba(148, 163, 184, 0.12) 100%);
    box-shadow: 0 4px 12px rgba(148, 163, 184, 0.2);
    transform: translateY(-2px);
  }

  .report-card.bullishness:hover .sentiment-progress-fill {
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
  }

  /* Enhanced hover effects for AI Assessment cards */
  .recommendation-buy .report-card.recommendation:hover {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.25) 0%, rgba(34, 197, 94, 0.15) 100%);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.2);
    transform: translateY(-2px);
  }

  .recommendation-neutral .report-card.recommendation:hover {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.25) 0%, rgba(59, 130, 246, 0.15) 100%);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
    transform: translateY(-2px);
  }

  .recommendation-cautious .report-card.recommendation:hover {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.25) 0%, rgba(245, 158, 11, 0.15) 100%);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.2);
    transform: translateY(-2px);
  }

  /* Title on top - Informative styling */
  .card-title {
    font-size: clamp(4px, 1vw, 6px);
    font-weight: 600;
    color: rgba(148, 163, 184, 0.9);
    line-height: 1.2;
    margin: 0;
    padding: 0;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    opacity: 0.8;
  }

  /* Additional responsive breakpoints for card titles */
  @media (max-width: 1024px) {
    .card-title {
      font-size: clamp(6px, 1.1vw, 8px);
      letter-spacing: 0.3px;
    }
  }

  @media (max-width: 768px) {
    .card-title {
      font-size: clamp(7px, 1.2vw, 9px);
      letter-spacing: 0.2px;
    }
  }

  @media (max-width: 480px) {
    .card-title {
      font-size: clamp(6px, 1vw, 8px);
      letter-spacing: 0.1px;
    }
  }

  @media (max-width: 360px) {
    .card-title {
      font-size: clamp(5px, 0.9vw, 7px);
      letter-spacing: 0px;
    }
  }

  /* Content below - Informative styling */
  .card-content {
    font-size: clamp(6px, 1.4vw, 9px);
    line-height: 1.35;
    color: var(--text-color);

    /* prevent weird side-by-side behavior if inherited styles exist */
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: normal;
    word-break: break-word;
    font-weight: 700;
  }


    
  /* Optional: green AI assessment value */
  .recommendation-value {
    color: var(--text-color);
  }

  /* Responsive */
  @media (max-width: 900px) {
    .report-container { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  }
  
  /* Keep 2x2 grid even on very small screens, only go to single column on extremely small screens */
  @media (max-width: 320px) {
    .report-container { grid-template-columns: 1fr; }
  }
  
  /* Make text smaller on screens 515px and below to fit 2x2 grid better */
  @media (max-width: 515px) {
    .report-container {
      gap: 4px;
      padding: 8px;
    }
    
    .report-card {
      padding: 3px 2px;
    }
    
    .card-title {
      font-size: 8px;
      letter-spacing: 0.1px;
    }
    
    .card-content {
      font-size: clamp(6px, 1.1vw, 8px);
    }
    
    /* Make sentiment progress bar smaller */
    .sentiment-progress-bar {
      height: 4px;
    }
    
    .sentiment-value-text {
      font-size: clamp(5px, 0.9vw, 7px);
      padding: 1px 2px;
    }

    .action-buttons {
      gap: 4px;
      padding: 6px;
    }

    .action-buttons button {
      padding: 4px 6px;
      font-size: 0.75em;
      min-height: 28px;
    }
  }

  
  .summary-container {
    position: relative;
    font-size: 0.9em; /* Reduced from 1.0em for better compactness */
    margin-bottom: 8px;
    margin-top: 8px;
    padding: 8px;
    background: var(--secondary-bg);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    line-height: 1.4;
  }

  /* Light mode summary container */
  html.light .summary-container {
    border: 1px solid rgba(0, 0, 0, 0.15);
  }

  .news-title {
    font-size: 0.9em;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 6px;
    line-height: 1.25;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  }

  .summary {
    font-size: 0.9em;
    line-height: 1.4;
    color: var(--secondary-text);
    opacity: 0.9;
  }
  
  .recommendation {
    font-weight: bold;
  }
  .recommendation.recommendation-buy {
    color: var(--buy-color);
  }
  .recommendation.recommendation-neutral {
    color: var(--neutral-color);
  }
  .recommendation.recommendation-cautious {
    color: var(--cautious-color);
  }
  
  .recommendation-strong-buy {
    border-color: rgba(80,130,255,.35);
    background-color: rgba(80,130,255,.35);
  }
  .recommendation-buy {
    border-color: rgba(80,130,255,.35);
  }
  .recommendation-neutral {
    border-color: rgba(80,130,255,.35);
  }
  .recommendation-cautious {
    border-color: rgba(80,130,255,.35);
  }
  
  .down-arrow-icon {
    position: absolute;
    bottom: 0px;     
    right: 10px;     
    font-size: 0.4em;
    color: var(--text-color);
    cursor: pointer;
    padding: 0;
    z-index: 2;      /* Make sure it's above the canvas */
    background-color: var(--down-arrow-color); /* semi-transparent background */
    border: var(--secondary-text);
    /* border-radius: 20%;  */
    padding: 3px;
    opacity: 0.8;
    transition: background-color 0.3s ease;
  }
  
  
  .chart-inner {
    position: relative;
    margin-top: 4px;
    margin-bottom: 1px;
    height: 210px; /* Optimized height for chart with labels */
    position: relative;
    touch-action: pan-y;
    display: flex;
    flex-direction: column;
    overflow: visible; /* Allow labels to show */
  }
  
  .chart-caption {
    display: none;
    font-size: 0.85em;
    color: var(--secondary-text);
    margin-top: 4px;
    text-align: center;
    padding: 0 16px;
  }
  
  
  canvas {
    touch-action: manipulation;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
  }

  
  .chart-inner canvas {
    aspect-ratio: 16 / 4;
    max-width: 100%;
    max-height: 170px !important; /* Optimized height for better fit */
    margin: 0 auto;
    display: block;
    width: 100% !important;
  }
  .chart-placeholder {
    text-align: center;
    color: var(--secondary-text);
    font-size: 0.9em;
  }
  
  .icon-btn {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);
    border: 2px solid rgba(102, 126, 234, 0.15);
    padding: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-color);
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
  }
  
  .icon-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(102, 126, 234, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.4s ease, height 0.4s ease;
  }
  
  .icon-btn:hover::before {
    width: 100%;
    height: 100%;
  }
  
  .icon-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    border-color: rgba(102, 126, 234, 0.4);
  }
  
  .icon-btn:active {
    transform: translateY(0);
  }
  
  .icon-btn svg {
    position: relative;
    z-index: 1;
    transition: all 0.3s ease;
  }
  
  .lucide {
    stroke: currentColor;
  }

  .notification-btn {
    color: #667eea;
  }
  
  .notification-btn:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.15) 100%);
    border-color: rgba(102, 126, 234, 0.5);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
  }
  
  .notification-btn:hover svg {
    animation: bellRing 0.5s ease;
  }
  
  .notification-btn.active {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.25) 0%, rgba(118, 75, 162, 0.2) 100%);
    border-color: #667eea;
    color: #667eea;
  }
  
  .notification-btn.active svg {
    animation: bellRing 0.5s ease infinite;
  }
  
  @keyframes bellRing {
    0%, 100% { transform: rotate(0deg); }
    10%, 30% { transform: rotate(-10deg); }
    20%, 40% { transform: rotate(10deg); }
    50% { transform: rotate(0deg); }
  }

  .share-btn {
    color: #3498db;
  }
  
  .share-btn:hover {
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.15) 0%, rgba(52, 152, 219, 0.08) 100%);
    border-color: rgba(52, 152, 219, 0.4);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
  }
  
  .share-btn:hover svg {
    transform: scale(1.1) rotate(5deg);
  }
  
  .share-btn.active {
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.25) 0%, rgba(52, 152, 219, 0.15) 100%);
    border-color: #3498db;
  }
  
  .sources-widget {
    display: none;
    background: var(--card-bg);
    border: 1px solid var(--secondary-border-color);
    border-radius: 8px;
    padding: 12px;
    margin-top: 4px;
    margin-bottom: 1px;
    height: 210px; /* Match chart-inner height */
    overflow-y: auto;
    overflow-x: hidden; /* Prevent horizontal overflow */
    position: relative;
    word-wrap: break-word; /* Ensure long text wraps */
  }

  .sources-widget .sources-header {
    font-size: 0.9em;
    font-weight: bold;
    color: var(--text-color);
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--secondary-border-color);
  }

  .sources-widget .close-btn {
    position: absolute;
    top: 8px;
    right: 12px;
    background: none;
    border: none;
    font-size: 1.2em;
    font-weight: bold;
    color: var(--accent-color);
    cursor: pointer;
    z-index: 10000;
  }
  .sources-widget .close-btn:hover {
    color: var(--text-color);
  }
  
  
  .source-row {
    margin-bottom: 8px;
    padding: 8px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.04) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
  }

  /* Light mode source-row border */
  html.light .source-row {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.03) 0%, rgba(0, 0, 0, 0.01) 100%);
    border: 1px solid rgba(0, 0, 0, 0.15);
  }

  .source-row:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.08) 100%);
    border-color: var(--accent-color);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  }

  /* Light theme adjustments for source rows */
  [data-theme="light"] .source-row {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.04) 0%, rgba(0, 0, 0, 0.02) 100%);
    border: 1px solid #e5e7eb;
  }

  [data-theme="light"] .source-row:hover {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.08) 0%, rgba(0, 0, 0, 0.04) 100%);
    border-color: var(--accent-color);
  }
  .source-row a {
    color: var(--text-color);
    text-decoration: none;
    display: flex;
    align-items: center;
    width: 100%;
    line-height: 1.4;
    gap: 8px;
  }

  .source-row .source-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
  }

  .source-row .source-main {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
  }

  .source-row .source-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0; /* Allow text truncation */
  }
  .source-row img {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    flex-shrink: 0;
  }

  .source-row .source-domain {
    font-weight: 600;
    color: var(--accent-color);
    font-size: 0.9em;
  }

  .source-row .source-title {
    color: var(--text-color);
    font-size: 0.85em;
    line-height: 1.3;
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2; /* Allow 2 lines */
    -webkit-box-orient: vertical;
    word-break: break-word; /* Break long words */
  }

  .source-time {
    font-size: 0.75em;
    color: var(--secondary-text);
    font-weight: 500;
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    white-space: nowrap;
  }

  [data-theme="light"] .source-time {
    background: rgba(0, 0, 0, 0.08);
  }
  
  .ask-ai-section {
    display: none;
    margin-top: 4px;
    border-top: 1px solid var(--secondary-border-color);
    padding-top: 4px;
  }
  .ask-input {
    width: 100%;
    padding: 4px;
    border-radius: 6px;
    border: 1px solid var(--secondary-border-color);
    background: var(--bg-color);
    color: var(--text-color);
    margin-bottom: 4px;
  }

  /* Placeholder text styling for regular ask-input */
  .ask-input::placeholder {
    font-size: 13px;
    color: var(--secondary-text);
    opacity: 0.6;
  }

  /* Light theme placeholder for regular ask-input */
  html.light .ask-input::placeholder {
    color: var(--secondary-text);
    opacity: 0.5;
  }
  .ask-responses {
    margin-top: 6px;
  }
  .ask-responses .response {
    border-left: 3px solid var(--accent-color);
    padding-left: 8px;
    margin-bottom: 6px;
    color: var(--secondary-text);
  }

  /* History Widget Styles */
  .history-widget {
    display: none;
    background: var(--card-bg);
    border: 1px solid var(--secondary-border-color);
    border-radius: 8px;
    padding: 12px;
    margin-top: 4px;
    margin-bottom: 1px;
    height: 200px;
    overflow-y: auto;
    position: relative;
  }

  .history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9em;
    font-weight: bold;
    color: var(--text-color);
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--secondary-border-color);
  }

  .back-to-latest-btn {
    display: none;
    align-items: center;
    gap: 4px;
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8em;
    cursor: pointer;
    transition: all 0.3s ease;
  }

  .back-to-latest-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
  }

  .history-container {
    display: flex;
    flex-direction: column;
    gap: 6px;
  }

  .history-item {
    background: var(--shadow-color);
    border: 1px solid var(--secondary-border-color);
    border-radius: 6px;
    padding: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
  }

  .history-item:hover {
    background: var(--accent-color);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  }

  .history-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
  }

  .history-date {
    font-size: 0.8em;
    font-weight: 600;
    color: var(--text-color);
  }

  .history-item:hover .history-date {
    color: white;
  }

  .history-price {
    font-size: 0.85em;
    font-weight: bold;
    color: var(--text-color);
  }

  .history-item:hover .history-price {
    color: white;
  }

  .history-item-content {
    display: flex;
    flex-direction: column;
    gap: 3px;
  }

  .history-trigger,
  .history-sentiment,
  .history-assessment {
    display: flex;
    justify-content: space-between;
    font-size: 0.75em;
  }

  .history-trigger-label,
  .history-sentiment-label,
  .history-assessment-label {
    color: var(--secondary-text);
    font-weight: 500;
  }

  .history-item:hover .history-trigger-label,
  .history-item:hover .history-sentiment-label,
  .history-item:hover .history-assessment-label {
    color: rgba(255, 255, 255, 0.8);
  }

  .history-trigger-value,
  .history-sentiment-value,
  .history-assessment-value {
    font-weight: 600;
    color: var(--text-color);
  }

  .history-item:hover .history-trigger-value,
  .history-item:hover .history-sentiment-value,
  .history-item:hover .history-assessment-value {
    color: white;
  }

  .history-assessment-value.recommendation-buy {
    color: var(--buy-color);
  }

  .history-assessment-value.recommendation-neutral {
    color: var(--neutral-color);
  }

  .history-assessment-value.recommendation-cautious {
    color: var(--cautious-color);
  }

  .history-item:hover .history-assessment-value.recommendation-buy,
  .history-item:hover .history-assessment-value.recommendation-neutral,
  .history-item:hover .history-assessment-value.recommendation-cautious {
    color: white;
  }

  .history-loading,
  .history-empty,
  .history-error {
    text-align: center;
    color: var(--secondary-text);
    font-size: 0.9em;
    padding: 20px;
  }

  .history-error {
    color: #ef4444;
  }

  .sources-empty {
    text-align: center;
    color: var(--secondary-text);
    font-size: 0.9em;
    padding: 20px;
  }

/* Additional responsive breakpoints for action buttons */
@media (max-width: 1200px) and (min-width: 993px) {
  .action-buttons button {
    font-size: clamp(0.6em, 1.3vw, 0.75em);
    padding: 6px 9px;
  }
}

@media (max-width: 768px) and (min-width: 516px) {
  .action-buttons button {
    font-size: 0.8em;
    padding: 5px 6px;
  }
}

@media (max-width: 480px) and (min-width: 361px) {
  .action-buttons button {
    font-size: 0.75em;
    padding: 4px 5px;
    min-height: 30px;
  }
}

@media (max-width: 360px) {
  .action-buttons button {
    font-size: 0.7em;
    padding: 3px 4px;
    min-height: 26px;
    gap: 2px;
  }
}

@media (max-width: 992px) {
    .chart-caption {
    font-size: 0.65em;
    }
    .news-card {
      width: 100%; /* Changed from 90% to ensure full width */
      padding: 8px; /* Simplified to use shorthand for equal padding */
      margin: 0 auto 20px auto; /* Increased margin for better spacing */
      box-sizing: border-box; /* Ensure padding is included in width */
    }

    .report-container {
      gap: 6px;
      padding: 10px;
      margin: 3px 0 8px 0;
    }

    .report-card {
      padding: 5px 6px 6px;
    }

    .card-title {
      font-size: 10px;
    }

    .card-content {
      font-size: clamp(8px, 1.5vw, 12px);
    }

    /* Mobile sentiment progress bar adjustments */
    .sentiment-progress-bar {
      height: 5px;
    }

    .sentiment-value-text {
      font-size: clamp(6px, 1vw, 8px);
      margin-top: 1px;
      padding: 1px 3px;
    }

    .summary-container {
      padding: 6px;
      font-size: 0.85em; /* Reduced for mobile */
      margin-top: 6px;
    }

    .action-buttons {
      gap: 6px;
      padding: 8px;
      margin-top: 10px;
      /* Create 2x2 grid layout for mobile */
      display: grid !important;
      grid-template-columns: 1fr 1fr;
      grid-template-rows: 1fr 1fr;
      flex-direction: unset !important;
    }

    .action-buttons button {
      padding: 5px 7px;
      font-size: 1em;
      min-height: 32px;
      /* Ensure buttons fill their grid cells */
      width: 100%;
    }

    .chart-container {
      position: relative;
    }
  
    .down-arrow-icon {
      position: absolute;
      bottom: 4px;
      right: 10px;
      transform: translate(0%, 0%);
      z-index: 20;
    }

    .content-wrapper {
        padding: 0 4px;
      }
    
      .chart-inner {
        height: 130px; /* Optimized for mobile */
      }
    
      .sources-widget {
        height: 130px; /* Match mobile chart-inner height */
      }
    
      .chart-inner canvas {
        aspect-ratio: 16 / 6;
      }
}

@media (min-width: 993px) {
    .content-wrapper {
    margin: 25px auto 0;
    /* Ensure content stays within viewport */
    box-sizing: border-box;
    overflow-x: hidden; /* Prevent horizontal overflow */
  }  
}

/* Add this to your news-card.css file */

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.back-to-latest-header-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-color);
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 12px;
  font-size: 0.8em;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  opacity: 0.9;
}

.back-to-latest-header-btn:hover {
  transform: translateY(-1px);
  opacity: 1;
}

.back-to-latest-header-btn:active {
  transform: translateY(0);
}

.back-to-latest-header-btn svg {
  width: 14px;
  height: 14px;
}

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

.chart-toggle-container {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 4px;
  pointer-events: none; /* Allow clicks to pass through container */
}

.chart-toggle-container .icon-btn {
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.5) 100%);
  border: 1px solid rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  pointer-events: auto; /* Re-enable clicks on the button */
}

.chart-toggle-container .icon-btn:hover {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.9) 0%, rgba(99, 102, 241, 0.8) 100%);
  border-color: rgba(59, 130, 246, 0.6);
  transform: translateY(-1px);
}

/* Light mode styles for chart toggle */
html.light .chart-toggle-container .icon-btn {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(248, 250, 252, 0.8) 100%);
  border: 1px solid rgba(0, 0, 0, 0.2);
  color: #374151;
}

html.light .chart-toggle-container .icon-btn:hover {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.9) 0%, rgba(99, 102, 241, 0.8) 100%);
  border-color: rgba(59, 130, 246, 0.6);
  color: white;
  transform: translateY(-1px);
}

/* Responsive adjustments for chart toggle */
@media (max-width: 768px) {
  .chart-toggle-container {
    top: 6px;
    right: 6px;
  }
}

@media (max-width: 480px) {
  .chart-toggle-container {
    top: 4px;
    right: 4px;
  }
  
  .chart-toggle-container .icon-btn {
    padding: 5px;
  }
}


/* Action Buttons - Redesigned for clear actionable appearance */
.action-buttons {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  position: relative;
  background: var(--secondary-bg);
}

/* Add actionable indicator */
.action-buttons::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  border-radius: 12px 12px 0 0;
}

.action-buttons button {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
  border: 1px solid rgba(148, 163, 184, 0.3);
  color: var(--text-color);
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: clamp(0.5em, 1.2vw, 0.8em);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  flex: 1;
  min-height: 32px;
  white-space: nowrap;
  font-weight: 600;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  position: relative;
  overflow: hidden;
}

/* Add subtle glow effect on hover */
.action-buttons button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  transition: left 0.5s;
}

.action-buttons button:hover::before {
  left: 100%;
}

/* .action-buttons button:hover {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.9) 0%, rgba(16, 185, 129, 0.8) 100%);
  color: white;
  border-color: rgba(34, 197, 94, 0.6);
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 8px 25px rgba(34, 197, 94, 0.4), 0 0 0 1px rgba(34, 197, 94, 0.2);
} */

.action-buttons button.active {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.9) 0%, rgba(99, 102, 241, 0.8) 100%);
  color: white;
  border-color: rgba(59, 130, 246, 0.6);
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4), 0 0 0 1px rgba(59, 130, 246, 0.3);
  transform: translateY(-1px);
}

.action-buttons button.active:hover {
  background: linear-gradient(135deg, rgba(59, 130, 246, 1) 0%, rgba(99, 102, 241, 0.9) 100%);
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 8px 25px rgba(59, 130, 246, 0.5), 0 0 0 1px rgba(59, 130, 246, 0.4);
}
/* Ask AI Bottom Panel Styles for Desktop */
@media (min-width: 993px) {
  .ask-ai-section {
    background: var(--card-bg);
    border: 1px solid var(--secondary-border-color);
    border-radius: 8px;
    margin-top: 4px;
    display: flex;
    flex-direction: column;
    height: 200px; /* Reduced from 240px */
    overflow: hidden; /* Ensure content stays within bounds */
    /* Prevent the section from going outside its container */
    max-width: 100%;
    box-sizing: border-box;
    position: relative;
  }

  .ask-ai-messages {
    height: calc(200px - 50px); /* Adjusted for new total height */
    overflow-y: auto;
    overflow-x: hidden;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: var(--card-bg);
    color: var(--text-color);
    scrollbar-width: thin;
    scrollbar-color: var(--secondary-border-color) transparent;
    flex-shrink: 0; /* Prevent shrinking */
  }

  .ask-ai-messages::-webkit-scrollbar {
    width: 6px;
  }

  .ask-ai-messages::-webkit-scrollbar-track {
    background: transparent;
  }

  .ask-ai-messages::-webkit-scrollbar-thumb {
    background: var(--secondary-border-color);
    border-radius: 3px;
  }

  .ask-ai-input-container {
    padding: 8px 12px;
    border-top: 1px solid var(--secondary-border-color);
    background: var(--card-bg);
    border-radius: 0 0 8px 8px;
    display: flex;
    gap: 8px;
    align-items: center; /* Center align for proper vertical alignment */
    flex-shrink: 0; /* Prevent input container from shrinking */
    height: 50px; /* Reduced height */
    box-sizing: border-box;
    position: relative; /* Ensure it stays in place */
  }

  .ask-ai-section .ask-input {
    flex: 1;
    border: 1px solid var(--secondary-border-color);
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 16px;
    resize: none;
    outline: none;
    transition: border-color 0.2s;
    font-family: inherit;
    height: 36px; /* Match button height */
    background: var(--card-bg);
    color: var(--text-color);
    box-sizing: border-box;
    line-height: 1.4;
  }

  .ask-ai-section .ask-input:focus {
    border-color: var(--primary-color, #2563eb);
  }

  /* Placeholder text styling for ask-ai input */
  .ask-ai-section .ask-input::placeholder {
    font-size: 13px;
    color: var(--secondary-text);
    opacity: 0.6;
  }

  /* Light theme placeholder for ask-ai input */
  html.light .ask-ai-section .ask-input::placeholder {
    color: var(--secondary-text);
    opacity: 0.5;
  }

  /* AI Welcome Message Styling */
  .ai-welcome-message {
    margin-bottom: 12px;
  }

  .ai-message-content {
    color: var(--secondary-text);
    font-size: 13px;
    line-height: 1.4;
    opacity: 0.8;
  }

  .ai-message-content p {
    margin: 0 0 8px 0;
    font-size: 13px;
  }

  .ai-message-content p:last-child {
    margin-bottom: 0;
  }

  .ai-message-content ul {
    margin: 8px 0 0 0;
    padding-left: 16px;
    font-size: 12px;
  }

  .ai-message-content li {
    margin-bottom: 4px;
    color: var(--secondary-text);
    opacity: 0.7;
  }

  .ai-message-content strong {
    font-weight: 600;
    color: var(--text-color);
  }

  /* Light theme AI welcome message */
  html.light .ai-message-content {
    color: var(--secondary-text);
    opacity: 0.7;
  }

  html.light .ai-message-content li {
    opacity: 0.6;
  }

  .ask-ai-section .ask-submit-btn {
    background: var(--primary-color, #2563eb);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0;
    cursor: pointer;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px; /* Reduced width */
    height: 36px; /* Reduced height to match input better */
    flex-shrink: 0;
    min-width: 36px; /* Ensure minimum width */
  }

  .ask-ai-section .ask-submit-btn svg {
    width: 16px; /* Reduced icon size */
    height: 16px; /* Reduced icon size */
    stroke-width: 2;
  }

  .ask-ai-section .ask-submit-btn:hover {
    background: var(--primary-hover, #1d4ed8);
  }

  /* Message styles for bottom panel */
  .ask-ai-messages .chat-message {
    max-width: 85%;
    margin-bottom: 6px;
  }

  .ask-ai-messages .chat-message.user-message {
    align-self: flex-end;
  }

  .ask-ai-messages .chat-message.ai-message {
    align-self: flex-start;
  }

  .ask-ai-messages .message-content {
    padding: 8px 12px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
  }

  .ask-ai-messages .user-message .message-content {
    background: var(--primary-color, #2563eb);
    color: white;
    border-bottom-right-radius: 4px;
  }

  .ask-ai-messages .ai-message .message-content {
    background: var(--secondary-bg, #374151);
    color: var(--text-color, #d1d5db);
    border-bottom-left-radius: 4px;
    border: 1px solid var(--secondary-border-color, #4b5563);
  }

  html.light .ask-ai-messages .ai-message .message-content {
    background: var(--secondary-bg, #f8fafc);
    color: var(--text-color, #334155);
    border: 1px solid var(--secondary-border-color, #e0e0e0);
  }

  .ask-ai-messages .ai-message.error .message-content {
    background: #fef2f2;
    color: #dc2626;
    border-color: #fca5a5;
  }
}

/* Mobile - keep existing widget behavior */
@media (max-width: 992px) {
  .ask-ai-section {
    /* Hide the panel on mobile - use widget instead */
    display: none !important;
  }
  
  /* Match mobile height with other widgets */
  .ask-ai-section {
    height: 160px;
  }
  
  /* Ensure mobile news cards don't overflow */
  .news-card {
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden; /* Prevent horizontal overflow */
  }
}
/* Typing animation for Ask AI panel */
@media (min-width: 993px) {
  .ask-ai-messages .typing-dots {
    display: inline-flex;
    align-items: center;
    gap: 4px;
  }

  .ask-ai-messages .typing-dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-color);
    opacity: 0.4;
    animation: typing 1.4s infinite;
  }

  .ask-ai-messages .typing-dots span:nth-child(1) {
    animation-delay: 0s;
  }

  .ask-ai-messages .typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
  }

  .ask-ai-messages .typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
  }

  @keyframes typing {
    0%, 60%, 100% {
      transform: scale(1);
      opacity: 0.4;
    }
    30% {
      transform: scale(1.2);
      opacity: 1;
    }
  }

  /* Ensure proper text wrapping in panel messages */
  .ask-ai-messages .message-content {
    word-break: break-word;
    overflow-wrap: break-word;
  }

  /* Style for code blocks if AI returns code */
  .ask-ai-messages .message-content code {
    background: rgba(0, 0, 0, 0.1);
    padding: 2px 4px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
  }

  .ask-ai-messages .message-content pre {
    background: rgba(0, 0, 0, 0.1);
    padding: 8px;
    border-radius: 6px;
    overflow-x: auto;
    margin: 8px 0;
  }

  .ask-ai-messages .message-content pre code {
    background: none;
    padding: 0;
  }
}
/* Ensure Ask AI panel stays within news card bounds */
@media (min-width: 993px) {
  .news-card {
    overflow: visible; /* Allow panel to show */
    position: relative; /* Establish positioning context */
  }
  
  .ask-ai-section {
    /* Ensure panel doesn't overflow the card */
    max-width: 100%;
    box-sizing: border-box;
    /* Ensure the panel is fully visible */
    margin-bottom: 0;
    /* Prevent the panel from going outside viewport */
    position: relative;
    left: 0;
    right: 0;
  }
  
  /* Ensure messages container has proper scrolling */
  .ask-ai-messages {
    overflow-x: hidden; /* Prevent horizontal scroll */
    overflow-y: auto; /* Allow vertical scroll */
  }
  
  /* Ensure input container is always visible and properly contained */
  .ask-ai-input-container {
    position: relative;
    z-index: 1;
    /* Ensure it doesn't overflow */
    max-width: 100%;
    box-sizing: border-box;
  }
  
  /* Ensure input and button stay within bounds */
  .ask-ai-section .ask-input {
    max-width: calc(100% - 48px); /* Account for button width and gap */
  }
  
  .ask-ai-section .ask-submit-btn {
    flex-shrink: 0; /* Prevent button from shrinking */
  }
}

/* HLC Data Display Styles */
.hlc-data {
    margin-top: 10px;
    padding: 8px;
    border-radius: 4px;
    font-size: 0.9em;
}

.hlc-data.loading {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
}

.hlc-data.loaded {
    background-color: transparent;
    border: none;
}

.hlc-data.unavailable {
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
}

.hlc-values {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.hlc-values span {
    font-weight: 500;
    padding: 2px 6px;
    border-radius: 3px;
    background-color: transparent;
    color: var(--text-color);
}

.hlc-high {
    color: var(--text-color);
}

.hlc-low {
    color: var(--text-color);
}

.hlc-current {
    color: var(--text-color);
}

.hlc-loading {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #6c757d;
}

.loading-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.hlc-unavailable {
    color: #856404;
    font-style: italic;
}

/* Responsive HLC display */
@media (max-width: 768px) {
    .hlc-values {
        gap: 8px;
    }
    
    .hlc-values span {
        font-size: 0.85em;
        padding: 1px 4px;
    }
}