/* Trending specific styles */

/* Trending Hero */
.trending-hero {
  background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
  color: white;
  padding: 3rem 0;
  text-align: center;
}

.trending-hero .hero-title {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.trending-hero .hero-description {
  font-size: 1.125rem;
  margin-bottom: 2rem;
  opacity: 0.9;
}

/* Trending Main Section */
.trending-main {
  padding: 3rem 0;
  background-color: var(--bg-secondary);
}

.trending-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 2rem;
  align-items: start;
}

/* Articles Section (reused from category.css, with minor adjustments) */
.articles-section {
  background-color: var(--bg-primary);
  border-radius: 1rem;
  padding: 2rem;
  box-shadow: var(--shadow-md);
}

/* Filter Bar */
.filter-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.filter-options {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.filter-btn {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 0.5rem 1rem;
  border-radius: 1rem;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.3s ease;
}

.filter-btn:hover,
.filter-btn.active {
  background-color: var(--accent-primary);
  color: white;
  border-color: var(--accent-primary);
}

.sort-options {
  display: flex;
  align-items: center;
  gap: 0.5rem;
    text-align: center;
    justify-content: center;  
}

.sort-select {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  cursor: pointer;
}

.sort-select:focus {
  outline: none;
  border-color: var(--accent-primary);
}

.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
}

.article-card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 1rem;
  overflow: hidden;
  transition: all 0.3s ease;
  text-decoration: none;
  color: inherit;
}

.article-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent-primary);
}

.article-image {
  position: relative;
  overflow: hidden;
}

.article-image img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.article-card:hover .article-image img {
  transform: scale(1.05);
}

.article-category {
  position: absolute;
  top: 1rem;
  left: 1rem;
  background-color: var(--accent-primary);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.875rem;
  font-weight: 600;
}

[dir="rtl"] .article-category {
  left: auto;
  right: 1rem;
}

.article-content {
  padding: 1.5rem;
}

.article-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  line-height: 1.4;
}

.article-title span {
  color: var(--text-primary);
  text-decoration: none;
}

.article-title span:hover {
  color: var(--accent-primary);
}

.article-excerpt {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
  line-height: 1.6;
}

.article-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.author-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.author-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
}

.author-name {
  font-weight: 500;
  color: var(--text-primary);
}

.article-stats {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Pagination (reused from category.css) */
.pagination {
  display: flex;
  justify-content: center;
  margin-top: 20px;
  gap: 8px;

}

.pagination button {
  padding: 6px 12px;
  border: 1px solid #ddd;
  background: #fff;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s ease;
  
}

.pagination button:hover {
  background: #f0f0f0;
}

.pagination button.active {
  background: #007bff;
  color: #fff;
  border-color: #007bff;
}


/* Trending Sidebar (reused and adapted from categories.css) */
.trending-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.sidebar-card {
  background-color: var(--bg-primary);
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
  margin-bottom: 2rem;
  width: 400px;
}


.tags-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem; 
}

.tags-cloud .tag {
  background-color: #e0e0e0;
  padding: 0.3rem 0.6rem;
  border-radius: 0.3rem;
  font-size: 0.9rem;
  white-space: nowrap; 
}

.sidebar-title {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

/* Popular Categories (reused from categories.css) */
.popular-categories {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.popular-category {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background-color: var(--bg-secondary);
  border-radius: 0.5rem;
  text-decoration: none;
  color: var(--text-primary);
  transition: all 0.3s ease;
}

.popular-category:hover {
  background-color:  var(--accent-hover-lighter);
  color: white;
}

.category-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.category-name {
  font-weight: 600;
}

.category-count {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.popular-category:hover .category-count {
  color: rgba(255, 255, 255, 0.8);
}

.category-trend {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
}

.category-trend.up {
  color: var(--accent-secondary);
}

.category-trend.down {
  color: #ff6b6b;
}

/* Tags Cloud (reused from category.css) */
.tags-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag-link {
  background-color: var(--bg-secondary);
  color: var(--text-secondary);
  padding: 0.5rem 1rem;
  border-radius: 1rem;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid var(--border-color);
  transition: all 0.3s ease;
}

.tag-link:hover {
  background-color: var(--accent-primary);
  color: white;
  border-color: var(--accent-primary);
}

.tag-link.popular {
  background-color: var(--accent-primary);
  color: white;
  border-color: var(--accent-primary);
}

/* Newsletter Card (reused from category.css) */
.newsletter-card {
  background: var(--hero-bg);
  color: white;
  font-weight: bold;
}

.newsletter-card .sidebar-title {
  color: var(--text-primary);
}

.newsletter-description {
  color:var(--accent-primary);
  margin-bottom: 1rem;
  line-height: 1.5;
}

.newsletter-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%; 
  max-width: 100%; 
}

.newsletter-form input,
.newsletter-form button {
  width: 100%; 
  box-sizing: border-box; 
    color: white;

}


.newsletter-input {
  padding: 0.75rem;
  border: none;
  border-radius: 0.5rem;
  background-color:white;
  color: white;
}

.newsletter-input::placeholder {
  color: var(--accent-primary);
  font-size: small;
}

.newsletter-input:focus {
  outline: none;
    caret-color: var(--accent-primary)
}

.newsletter-btn {
  background-color: white;
  color: var(--accent-primary);
  border: none;
  padding: 0.75rem;
  border-radius: 0.5rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  background-color: var(--accent-primary);
}

.newsletter-btn:hover {
  background-color: rgba(255, 255, 255, 0.9);
}

/* Responsive Design */
@media (max-width: 1024px) {
  .trending-layout {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .trending-sidebar {
    order: 1; /* Move sidebar above articles on smaller screens */
  }

  .articles-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  }
}

@media (max-width: 768px) {
  .trending-hero {
    padding: 2rem 0;
  }

  .trending-hero .hero-title {
    font-size: 2rem;
  }

  .articles-section {
    padding: 1rem;
  }

  .filter-bar {
    flex-direction: column;
    gap: 1rem;
    align-items: stretch;
  }

  .filter-options {
    justify-content: center;
  }

  .articles-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .pagination {
    flex-wrap: wrap;
  }

  .pagination-numbers {
    order: -1;
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .trending-main {
    padding: 1.5rem 0;
  }

  .articles-section {
    padding: 1rem;
  }

  .filter-options {
    flex-direction: column;
    align-items: center;
  }

  .filter-btn {
    width: 100%;
    max-width: 200px;

  }
.sort-options{
    text-align: center;
    justify-content: center;
}
  .article-card .article-content {
    padding: 1rem;
  }

  .tags-cloud {
    justify-content: center;
  }
}

/* Animation for article cards */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.article-card {
  animation: fadeInUp 0.6s ease forwards;
}

.article-card:nth-child(1) {
  animation-delay: 0.1s;
}
.article-card:nth-child(2) {
  animation-delay: 0.2s;
}
.article-card:nth-child(3) {
  animation-delay: 0.3s;
}
.article-card:nth-child(4) {
  animation-delay: 0.4s;
}
.article-card:nth-child(5) {
  animation-delay: 0.5s;
}
.article-card:nth-child(6) {
  animation-delay: 0.6s;
}


/* High Contrast Mode */
@media (prefers-contrast: high) {
  .article-card {
    border-width: 2px;
  }

  .article-category,
  .tag-link {
    border: 1px solid;
  }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  .article-card,
  .filter-btn,
  .popular-category,
  .tag-link {
    transition: none;
  }

  .article-card {
    animation: none;
  }
}
.pagination {
  display: flex;
  justify-content: center;
  margin-top: 20px;
  gap: 8px;
}

.pagination .page-link {
  padding: 6px 12px;
  border: 1px solid #ccc;
  border-radius: 4px;
  text-decoration: none;
      color:  var(--accent-primary);
  cursor: pointer;
  transition: 0.2s;
}

.pagination .page-link:hover {
  background-color: #f0f0f0;
}

.pagination .page-link.active {
  background-color: #2563eb;
  color: #fff;
  border-color: #2563eb;
}
