body {
  margin: 0;
  font-family: 'Roboto', sans-serif;
  background-color: #121212;
  color: #f1f1f1;
}

.tab-content {
  display: none;
  padding: 20px;
}

.tab-content.active {
  display: block;
}

.tab-bar {
  display: flex;
  justify-content: flex-start;
  overflow-x: auto;
  white-space: nowrap;
  background-color: #1e1e1e;
  padding: 10px 16px;
  gap: 10px;
  scrollbar-width: none; /* Firefox */
}

.tab-bar::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}

@media (min-width: 768px) {
  .tab-bar {
    justify-content: center;
    overflow-x: visible;
    padding: 10px 0;
  }
}

.tab-button {
  flex: 0 0 auto;
  padding: 8px 16px;
  background-color: #333;
  border: none;
  border-radius: 6px;
  color: #f1f1f1;
  font-size: 14px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.tab-button:hover {
  background-color: #555;
}

.tab-button.active {
  background-color: #222;
  border: 1px solid #00bcd4;
  color: #00bcd4;
  font-weight: bold;
  box-shadow: 0 0 8px rgba(0, 188, 212, 0.3);
}

.sub-tab-bar {
  display: flex;
  justify-content: center;
  overflow-x: auto;
  overflow-y: hidden;                    /* ✅ Prevent vertical scroll inside bar */
  white-space: nowrap;
  background-color: #1e1e1e;
  padding: 10px 16px;
  gap: 10px;
  scrollbar-width: none;                /* ✅ Hide scrollbar on Firefox */
  -webkit-overflow-scrolling: touch;    /* ✅ Enable momentum scroll on iOS */
  touch-action: pan-x;                  /* ✅ Allow horizontal swipes */
  overscroll-behavior-x: contain;       /* ✅ Prevent scroll chaining to body */
  -webkit-touch-callout: none;       /* Prevent long-tap text selection */
  user-select: none;                 /* Prevent selection */
}

.sub-tab-bar::-webkit-scrollbar {
  display: none; /* ✅ Hide scrollbar in Safari/Chrome */
}

@media (max-width: 1024px) {
  .sub-tab-bar {
    justify-content: flex-start;
    overflow-x: visible;
    padding: 10px 0;
  }
}

.sub-tab-button {
  padding: 8px 16px;
  background-color: #2c2c2c;
  border: none;
  border-radius: 6px;
  color: #f1f1f1;
  font-size: 13px;
  cursor: pointer;
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.sub-tab-button:hover {
  background-color: #444;
}

.sub-tab-button.active {
  background-color: #1a1a1a;
  border: 1px solid #00bcd4;
  color: #00bcd4;
  font-weight: bold;
  box-shadow: 0 0 6px rgba(0, 188, 212, 0.3);
}

.tab-button,
.sub-tab-button {
  text-decoration: none;
}

.btn {
  flex: 0 0 auto;
  padding: 8px 16px;
  background-color: #333;
  border: none;
  border-radius: 6px;
  color: #f1f1f1;
  font-size: 14px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}
.btn:hover {
  background-color: #555;
}
.btn.correct {
  background-color: #4caf50 !important;
  color: #fff;
}
.btn.wrong {
  background-color: #f44336 !important;
  color: #fff;
}




.tickers-list {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
  padding: 20px;
}

.tickers-list .chart-wrapper {
  background: #2c2c2c;
  border-radius: 8px;
  padding: 10px;
  width: 100%;
  max-width: 300px;
  box-sizing: border-box;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.2);
}

.ticker-card {
  background: #2a2a2a;
  padding: 14px;
  border-radius: 8px;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.2);
  width: 100%;
  max-width: 300px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ticker-card h3 {
  margin: 0 0 6px;
  font-size: 14px;
  color: #f1f1f1;
}

.ticker-card iframe {
  border-radius: 6px;
  overflow: hidden;
}

.ticker-card a {
  text-align: right;
  font-size: 12px;
  text-decoration: none;
  color: #00bcd4;
}

.remove-btn {
  background: #b34747; /* toned-down red */
  color: white;
  border: none;
  padding: 6px 10px;
  font-size: 12px;
  border-radius: 4px;
  cursor: pointer;
  align-self: flex-start; /* left-align within flex column */
  transition: background 0.2s ease;
  margin-top: 5px;
}

.remove-btn:hover {
  background: #cc5c5c;
}

/* Add Ticker Form */
form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  margin: 20px auto;
  max-width: 600px;
  padding: 10px;
}

form input[type="text"] {
  padding: 8px 12px;
  background: #1f1f1f;
  color: #f1f1f1;
  border: 1px solid #444;
  border-radius: 4px;
  font-size: 14px;
  flex: 1 1 200px;
}

form button {
  background: #00bcd4;
  color: #fff;
  border: none;
  padding: 8px 14px;
  font-size: 14px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s ease;
}

form button:hover {
  background: #0097a7;
}



.weather-card {
  background: #333;
  border-radius: 10px;
  padding: 20px;
  max-width: 360px;
  margin: 0 auto;
  color: #f1f1f1;
  box-shadow: 0 0 10px rgba(0,0,0,0.3);
  display: flex;
  flex-direction: column;
  text-align: center;
}
.weather-forecast {
  display: flex;
  justify-content: space-around;
  margin-top: 15px;
  font-size: 14px;
}
.weather-forecast div {
  text-align: center;
}


.trending-section h2 {
  text-align: center;
  margin-bottom: 20px;
  font-size: 1.5em;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.trending-list {
  list-style: none;
  padding: 0;
  margin: 0 auto;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.trending-list li {
  background: #1e1e1e;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  color: #ccc;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.trending-list a {
  color: #00acc1;
  text-decoration: none;
  font-weight: 500;
  font-size: 13px;
}

.trending-list a:hover {
  text-decoration: underline;
}

.trending-item {
  background: #1e1e1e;
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 13px;
  color: #ddd;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.2);
}

.trending-item h3 {
  margin: 0;
  font-size: 14px;
}

.trending-item a {
  color: #00bcd4;
  text-decoration: none;
  font-weight: 500;
}

.trending-item a:hover {
  text-decoration: underline;
}

.trending-item p {
  font-size: 12px;
  color: #aaa;
  margin: 0;
}

.styled-select {
  background-color: #1f1f1f;
  color: #f1f1f1;
  border: 1px solid #333;
  padding: 8px 12px;
  border-radius: 5px;
  font-size: 14px;
  cursor: pointer;
  transition: border 0.2s;
}

.styled-select:hover,
.styled-select:focus {
  border-color: #00bcd4;
  outline: none;
}

.center-wrap {
  text-align: center;
}

.quiz-box {
  display: inline-block;
  background: #222;
  padding: 12px 16px;
  border-radius: 8px;
  color: #f1f1f1;
  margin: 10px auto;
  text-align: center;
  box-shadow: 0 0 8px rgba(0,0,0,0.2);
}

.options-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 500px;
  margin: 0 auto;
}

.feedback-text {
  margin-top: 15px;
  font-size: 1.1em;
  display: flex;
  justify-content: center;
}

.btn-wrapper {
  margin-top: 20px;
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}


#loading {
  text-align: center;
  margin: 30px 0;
  font-style: italic;
  color: #aaa;
}

.centered {
  text-align: center;
  padding: 40px 0;
  font-size: 1.2em;
  color: #aaa;
}

@media (max-width: 768px) {
  .news-item {
    width: 45%;
  }
}

@media (max-width: 480px) {
  .news-item {
    width: 100%;
  }
}
