body {
  background-color: #0d1117;
  color: #ffffff;
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0;
  scroll-behavior: smooth;
  line-height: 1.5;
  font-size: 16px;
}

/* Remove legacy nav styling that conflicts with Tailwind's navbar */
nav {
  all: unset;
  display: block;
  background: #0f141a;
  border-bottom: 1px solid #1f6f78;
}

nav a {
  all: unset;
  padding: 0.5rem 1rem;
  font-weight: bold;
  color: #ffffff;
  cursor: pointer;
  display: inline-block;
}

nav a:hover {
  text-decoration: underline;
}

/* Content layout for news and stock ticker */
.content-container {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin: 20px auto;
  gap: 20px;
  padding: 0 10px;
  /* Prevent wrapping on desktop */
  flex-wrap: wrap;
  max-width: 1200px;
}

/* Ensure news and stock sit side-by-side */
.news-container {
  flex: 3;
  min-width: 0; /* allows shrinking below content width */
}

.stock-sidebar {
  flex: 1;
  max-width: 300px;
  min-width: 200px;
}

@media (max-width: 768px) {
  .content-container {
    flex-direction: column;
  }
  .stock-sidebar,
  .served-news,
  .news-container {
    max-width: 100%;
    min-width: 0;
  }
}

@media (max-width: 768px) {
  .content-container {
    flex-direction: column;
  }
  .stock-sidebar,
  .served-news {
    max-width: 100%;
  }
}

/* Ticker style */
.ticker {
  overflow: hidden;
  white-space: nowrap;
  background: #1f6f78;
  font-size: 1.4rem;
  padding: 5px 0;
}

.ticker span {
  display: inline-block;
  padding-left: 100%;
  animation: ticker 15s linear infinite;
}

@keyframes ticker {
  0% { transform: translateX(0); }
  100% { transform: translateX(-100%); }
}

/* Stock Section & Controls */
.stock-sidebar {
  position: static;
  width: 100%;
  max-width: 320px;
  flex: 1;
  min-height: 500px;
}

.stock-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.stock-header h3 {
  font-size: 1.1rem;
  color: white;
  margin: 0;
  font-weight: bold;
}

.ticker-controls {
  display: flex;
  gap: 5px;
}

.ticker-btn {
  font-size: 0.9rem;
  background-color: #2a2a2a;
  border: none;
  border-radius: 4px;
  padding: 4px 8px;
  color: #ccc;
  cursor: pointer;
  transition: background-color 0.2s;
}

.ticker-btn:hover {
  background-color: #444;
}

.ticker-btn:active {
  background-color: #666;
}

.stock-section {
  width: 100%;
  height: 500px;
  overflow: hidden;
  background-color: #111;
  border: 1px solid #1f6f78;
  border-radius: 8px;
  padding: 10px;
  text-align: left;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.4);
  touch-action: pan-y;
  scroll-behavior: smooth;
}

.stock-section:hover {
  overflow-y: auto;
}

/* JS drives scroll; CSS animation removed */
.stock-section ul {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 100%;
  overflow-anchor: none;
}

.stock-section li {
  display: flex;
  align-items: center;
  padding: 6px 0;
  font-weight: bold;
  border-bottom: 1px solid #333;
  white-space: nowrap;
  gap: 6px;
}

.stock-section li.negative {
  color: #ff4c4c;
}

.stock-section img {
  vertical-align: middle;
  height: 16px;
  width: 16px;
  object-fit: contain;
  margin-right: 4px;
}

/* News Section with scroll by JS */
.news-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 1.1rem;
  font-weight: bold;
  color: white;
}

.served-news {
  max-height: 500px;
  overflow: hidden;
  background: #12171d;
  border: 1px solid #1f6f78;
  border-radius: 8px;
  padding: 10px;
  box-shadow: 0 0 10px rgba(0,0,0,0.3);
  flex: 3;
  touch-action: pan-y;
  scroll-behavior: smooth;
}

.served-news:hover {
  overflow-y: auto;
}

/* JS drives scroll; CSS animation removed */
#newsList {
  list-style: none;
  padding: 0;
  margin: 0;
}

#newsList li {
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid #2c3e50;
  background-color: transparent;
}

#newsList a {
  color: #ffcccc;
  font-weight: bold;
  text-decoration: none;
}

#newsList a:hover {
  text-decoration: underline;
}

#newsList small {
  display: block;
  color: #888;
  margin-top: 5px;
  font-size: 0.75rem;
}
