/* Portfolio styles */

/* Summary items */

.summary-item {
  padding: 10px;
  border-radius: 5px;
  background-color: #f8f9fa;
}

.summary-item h6 {
  color: #6c757d;
  font-size: 0.85rem;
  margin-bottom: 5px;
}

.summary-item .value {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 0;
}

/* Portfolio stats */

.portfolio-stat {
  margin-bottom: 5px;
}

.portfolio-stat strong {
  color: #495057;
}

/* Chart container */

.chart-container {
  height: 300px;
}

/* Performance metrics table */

.metrics-table td:first-child {
  font-weight: 500;
  color: #495057;
}

/* Holdings table styling */

.holdings-table th {
  font-size: 0.85rem;
  font-weight: 600;
}

.holdings-table .ticker-cell {
  font-weight: 600;
}

/* Dashboard cards */

.stat-box {
  padding: 15px;
  border-radius: 5px;
  background-color: #f8f9fa;
  height: 100%;
}

.stat-box h6 {
  color: #6c757d;
  font-size: 0.85rem;
  margin-bottom: 8px;
}

.stat-box .stat-value {
  font-size: 1.4rem;
  font-weight: 600;
  margin-bottom: 0;
}

/* News Carousel Styles */
.news-carousel-section {
  margin-bottom: 3rem;
}

.news-carousel-container {
  position: relative;
  overflow: hidden;
  border-radius: var(--border-radius);
  background: var(--card-bg);
  border: 1px solid var(--border-color);
}

.news-carousel {
  display: flex;
  transition: transform 0.3s ease;
  gap: 1rem;
  padding: 1.5rem;
  overflow-x: hidden;
  scroll-behavior: smooth;
}

.news-card {
  flex: 0 0 300px;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  overflow: hidden;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  position: relative;
}

.news-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  border-color: var(--primary);
}

.news-card-image {
  width: 100%;
  height: 160px;
  object-fit: cover;
  background: var(--bg-secondary);
}

.news-card-content {
  padding: 1rem;
}

.news-card-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-card-summary {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.news-card-date {
  flex: 1;
}

.news-card-tickers {
  display: flex;
  gap: 0.25rem;
}

.news-ticker-badge {
  background: var(--primary);
  color: white;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 500;
}

.news-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  z-index: 10;
}

.news-nav-prev {
  left: 1rem;
}

.news-nav-next {
  right: 1rem;
}

.news-nav-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-50%) scale(1.1);
}

.news-nav-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.news-loading {
  padding: 2rem;
  background: var(--card-bg);
}

/* News Popup Card */
.news-popup-card {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 400px;
  max-width: 90vw;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.news-popup-card.show {
  opacity: 1;
  visibility: visible;
}

.news-popup-card .popup-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.news-popup-card .popup-content {
  padding: 1.5rem;
}

.news-popup-card .popup-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
  line-height: 1.3;
}

.news-popup-card .popup-summary {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 1rem;
}

.news-popup-card .popup-meta {
  display: flex;
  justify-content: between;
  align-items: center;
  margin-bottom: 1rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.news-popup-card .popup-link {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1rem;
  background: var(--primary);
  color: white;
  text-decoration: none;
  border-radius: 5px;
  font-size: 0.9rem;
  transition: var(--transition);
}

.news-popup-card .popup-link:hover {
  background: var(--primary-dark);
  color: white;
  transform: translateY(-1px);
}

.news-popup-card .popup-close {
  position: absolute;
  top: 10px;
  right: 15px;
  background: rgba(0, 0, 0, 0.5);
  color: white;
  border: none;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.news-popup-card .popup-close:hover {
  background: rgba(0, 0, 0, 0.7);
}

.news-popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.news-popup-overlay.show {
  opacity: 1;
  visibility: visible;
}

/* Hover Tooltip */
.news-hover-tooltip {
  position: absolute;
  bottom: 105%;
  left: 50%;
  transform: translateX(-50%);
  width: 280px;
  max-width: 90vw;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
  padding: 1rem;
  z-index: 1001;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  pointer-events: none;
}

.news-hover-tooltip.show {
  opacity: 1;
  visibility: visible;
}

.news-hover-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 8px solid #fff;
}

.news-hover-tooltip .tooltip-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.news-hover-tooltip .tooltip-summary {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.4;
  margin-bottom: 0.5rem;
}

.news-hover-tooltip .tooltip-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Footer Styling - Make it smaller */
.footer {
  padding: 1.5rem 0 !important;
  font-size: 0.9rem;
}

@media (max-width: 768px) {
  .news-card {
    flex: 0 0 250px;
  }
  
  .news-carousel {
    padding: 1rem;
    gap: 0.75rem;
  }
  
  .footer {
    padding: 1rem 0 !important;
    font-size: 0.85rem;
  }
}
