/* Emerging Trends */
.emerging-trends {
  padding: 20px 0;
}

.trends-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  margin-top: 50px;
}

.trend-card {
  border-radius: 10px;
  overflow: hidden;
  transition: transform 0.3s ease;
  height: 482px;
}

.trend-card:hover {
  cursor: pointer;
  transform: translateY(-10px);
  box-shadow: 0 10px 20px rgba(0, 255, 136, 0.3);
}

.trend-image {
  height: 200px;
  background-size: cover;
  background-position: center;
}

.institutional-trend {
  background-image: url("../assets/imgs/nft_trend.jpg");
}

.blockchain-trend {
  background-image: url("../assets/imgs/defi_trend.jpg");
}

.regulation-trend {
  background-image: url("../assets/imgs/metaverse_trend.jpg");
}

.portfolio-trend {
  background-image: url("../assets/imgs/portfolio-trend.jpg");
}

.assets-trend {
  background-image: url("../assets/imgs/assets-trend.jpg");
}

.risk-trend {
  background-image: url("../assets/imgs/risk-trend.jpg");
}

.trend-content {
  padding: 25px;
  background: #27282a;
  height: 280px;
}

.trend-content h3 {
  margin-bottom: 15px;
  color: #1fd50a;
}

.trend-content p {
  color: #f0f8ff;
  margin-bottom: 20px;
  line-height: 1.6;
}

.learn-more {
  color: #00ff88;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  transition: all 0.3s ease;
}

.learn-more:hover {
  cursor: pointer;
  text-decoration: underline;
  cursor: pointer;
}

.learn-more:after {
  content: "→";
  margin-left: 5px;
  transition: transform 0.3s ease;
}

.learn-more:hover:after {
  cursor: pointer;
  transform: translateX(3px);
}

/* Ensure animated elements have proper stacking context */
.intro-card,
.strategy-card,
.trend-card,
.tool-card {
  will-change: transform, opacity;
}

/* Trend Modal Styles */
.trend-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  z-index: 1000;
  overflow-y: auto;
  padding: 20px;
  box-sizing: border-box;
}

.modal-content {
  background: #1a1f2b;
  margin: 2% auto;
  padding: 25px;
  width: 100%;
  max-width: 900px;
  border-radius: 10px;
  box-shadow: 0 5px 30px rgba(0, 0, 0, 0.3);
  color: #f0f8ff;
  position: relative;
}

.close-modal {
  position: absolute;
  top: 15px;
  right: 15px;
  font-size: 24px;
  font-weight: bold;
  cursor: pointer;
  color: #ccc;
  transition: all 0.3s ease;
  z-index: 1;
}

.close-modal:hover {
  color: #fff;
  cursor: pointer;
}

.modal-header {
  border-bottom: 1px solid #2a3547;
  padding-bottom: 15px;
  margin-bottom: 15px;
}

.modal-header h3 {
  font-size: clamp(20px, 2vw, 24px);
  margin: 0 0 10px 0;
  color: #1fd50a;
  line-height: 1.3;
}

.modal-tabs {
  display: flex;
  margin-top: 15px;
  gap: 8px;
  flex-wrap: wrap;
}

.modal-tab {
  background: none;
  border: none;
  padding: 8px 16px;
  cursor: pointer;
  color: #c4c4c4;
  border-radius: 5px;
  font-weight: 600;
  transition: all 0.3s;
  font-size: clamp(14px, 1.5vw, 16px);
}

.modal-tab.active {
  background: #2f6a27;
  color: #f0f8ff;
}

.modal-body {
  min-height: 200px;
  padding: 5px 0;
}

.modal-tab-content {
  display: none;
  animation: fadeIn 0.3s ease-out;
}

.modal-tab-content.active {
  display: block;
}

.modal-image {
  height: clamp(150px, 25vw, 200px);
  background-size: cover;
  background-position: center;
  border-radius: 8px;
  margin-bottom: 15px;
}

.modal-stats {
  display: flex;
  gap: 15px;
  margin-top: 20px;
  padding-top: 15px;
  border-top: 1px solid #2a3547;
  flex-wrap: wrap;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 160px;
  font-size: clamp(14px, 1.5vw, 16px);
}

.stat-item i {
  color: #1fd50a;
  font-size: clamp(16px, 1.8vw, 18px);
}

.news-loader {
  text-align: center;
  padding: 30px 0;
}

.spinner {
  border: 4px solid #2a3547;
  border-top: 4px solid #1fd50a;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 0 auto 15px;
}

.news-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 15px;
}

.news-item {
  background: #2a3547;
  padding: 15px;
  border-radius: 8px;
  transition: all 0.3s, box-shadow 0.3s;
}

.news-item:hover {
  cursor: pointer;
  transform: translateY(-3px);
  box-shadow: 0 10px 20px rgba(0, 255, 136, 0.3);
}

.news-item h4 {
  margin: 0 0 8px 0;
  color: #1fd50a;
  font-size: clamp(16px, 1.8vw, 18px);
  line-height: 1.4;
}

.news-meta {
  display: flex;
  gap: 12px;
  margin-bottom: 10px;
  font-size: clamp(12px, 1.2vw, 14px);
  color: #8a9bb1;
}

.news-item p {
  margin: 0 0 10px 0;
  font-size: clamp(14px, 1.5vw, 15px);
  color: #c4c4c4;
  line-height: 1.5;
}

.news-item a {
  color: #1fd50a;
  text-decoration: none;
  font-weight: 600;
  display: inline-block;
  margin-top: 8px;
  font-size: clamp(14px, 1.5vw, 15px);
  transition: color 0.2s;
}

.news-item a:hover {
  color: #18a809;
  cursor: pointer;
  text-decoration: underline;
}

.no-articles,
.news-error {
  text-align: center;
  padding: 30px 20px;
  color: #8a9bb1;
}

.no-articles i,
.news-error i {
  font-size: 40px;
  margin-bottom: 15px;
  display: block;
  color: #1fd50a;
}

.error-detail {
  font-size: 14px;
  margin: 10px 0;
  color: #ff6b6b;
}

.retry-btn {
  background: #2f6a27;
  color: white;
  border: none;
  padding: 8px 20px;
  border-radius: 5px;
  cursor: pointer;
  margin-top: 15px;
  transition: all 0.3s ease;
  font-size: 0.8rem;
}

.retry-btn:hover {
  background: #1fd50a;
  cursor: pointer;
}

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

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .modal-content {
    padding: 20px;
    margin: 5% auto;
  }

  .modal-header h3 {
    font-size: 20px;
  }

  .modal-tabs {
    flex-direction: row;
    gap: 6px;
  }

  .modal-tab {
    padding: 6px 12px;
    flex: 1;
    text-align: center;
  }

  .modal-image {
    height: 160px;
  }

  .news-container {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .modal-content {
    padding: 15px;
    margin: 10% auto;
  }

  .close-modal {
    top: 10px;
    right: 10px;
    font-size: 20px;
  }

  .modal-header h3 {
    font-size: 18px;
  }

  .modal-tabs {
    flex-direction: column;
    gap: 5px;
  }

  .modal-tab {
    padding: 8px;
  }

  .modal-image {
    height: 140px;
  }

  .stat-item {
    flex: 1 1 100%;
  }

  .news-item {
    padding: 12px;
  }
}
