/* chart-popup.css — TradingView widget popup styles */
/* Matches news popup glassmorphism style */

.chart-popup {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1100;
  overflow-y: auto;
  padding: 20px;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);

  opacity: 0;
  transition: opacity 300ms cubic-bezier(.22,1,.36,1);
}

.chart-popup.open {
  display: block;
  opacity: 1;
}

.chart-popup.closing {
  opacity: 0;
}

.chart-content {
  position: relative;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  max-width: 800px;
  width: 100%;
  margin: 2vh auto;
  padding: 32px;
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.25),
    0 8px 20px rgba(0, 0, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  transform: translateY(40px) scale(0.96);
  opacity: 0;
  transition:
    transform 350ms cubic-bezier(.22,1,.36,1),
    opacity 300ms ease;
}

.chart-popup.open .chart-content {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.chart-popup.closing .chart-content {
  transform: translateY(20px) scale(0.97);
  opacity: 0;
}

.chart-popup .close-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  color: rgba(0, 0, 0, 0.6);
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    0 6px 18px rgba(0, 0, 0, 0.15);
  transition: all 0.2s ease;
}

.chart-popup .close-btn:hover {
  background: rgba(255, 255, 255, 0.9);
  color: #d32f2f;
  transform: translateY(-2px);
}

.chart-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin: 0 0 16px 0;
  padding-right: 40px;
  color: #1a1a2e;
}

.chart-section {
  margin-bottom: 20px;
}

.chart-section-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0 0 8px 0;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.chart-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.chart-col {
  min-width: 0;
}

.chart-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.chart-grid-item {
  border-radius: 8px;
  overflow: hidden;
  min-height: 200px;
  border: 1px solid #e5e7eb;
}

.chart-content .tradingview-widget-container {
  border-radius: 8px;
  overflow: hidden;
}

.chart-content .tradingview-widget-container iframe {
  display: block;
}

#tv-ta-widget {
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  background: #fff;
}

#tv-advanced-chart {
  height: 460px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
}

.chart-popup::-webkit-scrollbar {
  width: 6px;
}

.chart-popup::-webkit-scrollbar-track {
  background: transparent;
}

.chart-popup::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 3px;
}

.chart-popup::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.35);
}
/* =========================
   📰 NEWS HEADER
   ========================= */

.news-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

/* =========================
   🔘 SMALL BUTTON (TOP RIGHT)
   ========================= */

.news-more-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  min-width: 100px;
  height: 30px;
  padding: 0 12px;

  font-size: 12px;
  font-weight: 500;

  border-radius: 10px;
  border: 1px solid rgba(25,195,125,0.5);

  background: linear-gradient(
    to bottom,
    #19c37d,
    #12a76c
  );

  color: #fff;

  cursor: pointer;

  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.3),
    0 4px 10px rgba(16,185,129,0.25);

  transition: all 0.2s ease;
}

.news-more-btn:hover {
  transform: translateY(-1px);

  background: linear-gradient(
    to bottom,
    #1dd389,
    #14b874
  );

  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.4),
    0 6px 16px rgba(16,185,129,0.35);
}

.news-more-btn:active {
  transform: translateY(0);

  box-shadow:
    inset 0 2px 4px rgba(0,0,0,0.15),
    0 2px 6px rgba(16,185,129,0.2);
}
.news-more-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 12px;
  pointer-events: none;

  box-shadow:
    0 -6px 18px rgba(255,255,255,0.35),
    0 -2px 8px rgba(255,255,255,0.25);
}

.news-more-btn:hover {
  transform: translateY(-1px);

  background: linear-gradient(
    to bottom,
    #1dd389,
    #14b874 60%,
    #0f8f5b
  );

  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.5),
    0 10px 26px rgba(16,185,129,0.35);
}

.news-more-btn:active {
  transform: translateY(0);

  box-shadow:
    inset 0 2px 4px rgba(0,0,0,0.15),
    0 4px 10px rgba(16,185,129,0.25);
}

.hidden-news {
  display: none;
}

/* Responsive */
@media (max-width: 768px) {
  .chart-popup {
    padding: 10px;
  }

  .chart-content {
    width: 100%;
    padding: 16px;
    margin: 1vh auto;
    border-radius: 16px;
  }

  .chart-row {
    grid-template-columns: 1fr;
  }

  .chart-grid {
    grid-template-columns: 1fr;
  }

  .chart-title {
    font-size: 1.1rem;
  }

  #tv-advanced-chart {
    height: 350px;
  }

    .news-more-btn {
    min-width: 70px;
    height: 26px;
    font-size: 11px;
  }
}

/* === Dark theme === */

body.dark .chart-popup {
  background: rgba(0, 0, 0, 0.55);
}

body.dark .chart-content {
  background: rgba(20, 30, 44, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.55),
    0 10px 24px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

body.dark .chart-popup .close-btn {
  color: rgba(255, 255, 255, 0.78);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.10);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 10px 24px rgba(0, 0, 0, 0.35);
}

body.dark .chart-popup .close-btn:hover {
  color: #ff6b6b;
  background: rgba(255, 255, 255, 0.10);
}

body.dark .chart-title {
  color: #e0e0e0;
}

body.dark .chart-section-title {
  color: #8b949e;
}

body.dark .chart-grid-item {
  border-color: #30363d;
}

body.dark #tv-advanced-chart {
  border-color: #30363d;
}

body.dark #tv-ta-widget {
  border-color: #30363d;
  background: #161b22;
}

body.dark .chart-popup::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
}

body.dark .chart-popup::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

body.dark .sentiment-badge {
    background: rgba(255, 255, 255, 0.08) !important;
    color: #e0e0e0 !important;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

body.dark .badge-neutral {
    background: rgba(144, 144, 144, 0.2) !important;
    color: #b0b0b0 !important;
}

body.dark .badge-bullish {
    background: rgba(25, 195, 125, 0.2) !important;
    color: #2ecc71 !important;
}

body.dark .badge-bearish {
    background: rgba(211, 47, 47, 0.2) !important;
    color: #ff6b6b !important;
}

body.dark .news-item-title {
    color: #e0e0e0 !important;
}

body.dark .news-item-meta {
    color: #8b949e;
}

body.dark .sentiment-score-small {
    color: #8b949e;
}

body.dark .chart-grid-item {
  filter: invert(0) hue-rotate(0deg) brightness(1.1);
    background: #111827 !important; 
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

body.dark .tradingview-widget-container {
    background-color: transparent !important;
}

body.dark .chart-section-title {
    color: #9ca3af !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 5px;
}

body.dark .news-more-btn {
  background: linear-gradient(
    to bottom,
    #16a34a,
    #15803d
  );

  border: 1px solid rgba(34,197,94,0.5);

  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.08),
    0 6px 18px rgba(16,185,129,0.25);
}

body.dark .news-more-btn:hover {
  background: linear-gradient(
    to bottom,
    #22c55e,
    #16a34a
  );
}

body.dark .news-more-btn::after {
  box-shadow:
    0 -6px 18px rgba(255,255,255,0.08),
    0 -2px 8px rgba(255,255,255,0.06);
}