/* Modern News Section Styles */
.rss-feed {
  padding: 100px 0;
  background: linear-gradient(135deg, var(--bg-color) 0%, var(--card-bg) 100%);
  position: relative;
  overflow: hidden;
}

.rss-feed::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="50" cy="50" r="2" fill="rgba(0,122,255,0.1)"/></svg>')
    repeat;
  background-size: 50px 50px;
  pointer-events: none;
}

.rss-container {
  max-width: 1400px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.rss-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 50px;
  padding: 30px 40px;
  background: white;
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.rss-source {
  display: flex;
  align-items: center;
  gap: 15px;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-color);
}

.rss-source i {
  color: var(--primary-color);
  font-size: 1.8rem;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

.rss-status {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1rem;
  color: var(--text-muted);
  padding: 10px 20px;
  border-radius: 25px;
  background: rgba(0, 122, 255, 0.1);
  border: 1px solid rgba(0, 122, 255, 0.2);
}

.rss-status.success {
  color: #28a745;
  background: rgba(40, 167, 69, 0.1);
  border-color: rgba(40, 167, 69, 0.2);
}

.rss-status.error {
  color: #dc3545;
  background: rgba(220, 53, 69, 0.1);
  border-color: rgba(220, 53, 69, 0.2);
}

.rss-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  text-align: center;
}

.loading-spinner {
  font-size: 3rem;
  color: var(--primary-color);
  margin-bottom: 25px;
}

.loading-spinner i {
  animation: spin 1s linear infinite;
}

/* News Grid Layout */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
  gap: 35px;
  margin-bottom: 50px;
  padding: 20px;
}

/* News Card Styles */
.news-card {
  background: var(--card-bg);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  transition: all 0.1s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  border: 1px solid rgba(180, 180, 180, 0.15);
  backdrop-filter: blur(20px);
  position: relative;
  height: fit-content;
}

.news-card:hover {
  transform: translateY(-12px) scale(1.02);
  box-shadow: 0 30px 60px rgba(218, 218, 218, 0.25);
  border-color: rgba(170, 170, 170, 0.782);
}

.news-card:hover .news-overlay {
  opacity: 1;
}

.news-card:hover .news-image img {
  transform: scale(1.08);
}

.news-card:hover .news-title {
  color: var(--primary-color);
}

/* News Image */
.news-image {
  position: relative;
  height: 280px;
  overflow: hidden;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.news-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s ease;
  filter: contrast(1.1) saturate(1.1);
}

.news-category {
  position: absolute;
  top: 20px;
  left: 20px;
  background-color: #007aff;
  color: white;
  padding: 10px 18px;
  border-radius: 25px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  z-index: 3;
  box-shadow: 0 4px 10px rgba(0, 122, 255, 0.4);
}

.news-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    135deg,
    rgba(0, 122, 255, 0.85),
    rgba(88, 86, 214, 0.85)
  );
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.4s ease;
  z-index: 2;
}

.news-overlay i {
  font-size: 2.5rem;
  color: white;
  animation: bounce 2s infinite;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

/* News Content */
.news-content {
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.news-header {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.news-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-color);
  margin: 0;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.3s ease;
}

.news-meta {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.news-date,
.news-author {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 500;
}

.news-date i,
.news-author i {
  color: var(--primary-color);
  font-size: 1rem;
}

.news-description {
  color: var(--text-muted);
  line-height: 1.7;
  font-size: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex-grow: 1;
}

/* News Footer */
.news-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: auto;
  padding-top: 24px;
}

.read-more-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 14px 28px;
  background-color: #007aff;
  color: white;
  text-decoration: none;
  border-radius: 30px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.4s ease;
  box-shadow: 0 6px 10px rgba(0, 122, 255, 0.35);
  position: relative;
  overflow: hidden;
}

.read-more-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: left 0.5s ease;
}

.read-more-btn:hover::before {
  left: 100%;
}

.read-more-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(0, 122, 255, 0.45);
}

.read-more-btn i {
  transition: transform 0.3s ease;
}

.read-more-btn:hover i {
  transform: translateX(6px);
}

/* Error State */
.rss-error {
  text-align: center;
  padding: 80px 20px;
  background: var(--card-bg);
  border-radius: 20px;
  margin: 20px;
}

.error-content {
  max-width: 500px;
  margin: 0 auto;
}

.error-content i {
  font-size: 4rem;
  color: #dc3545;
  margin-bottom: 25px;
  animation: shake 0.5s infinite;
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-5px);
  }
  75% {
    transform: translateX(5px);
  }
}

.error-content h3 {
  color: var(--text-color);
  margin-bottom: 15px;
  font-size: 1.6rem;
}

.error-content p {
  color: var(--text-muted);
  margin-bottom: 30px;
  line-height: 1.6;
}

.retry-btn {
  background: linear-gradient(135deg, #dc3545, #c82333);
  color: white;
  border: none;
  padding: 15px 30px;
  border-radius: 25px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 5px 15px rgba(220, 53, 69, 0.3);
}

.retry-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(220, 53, 69, 0.4);
}

/* Pagination */
.rss-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  margin-top: 50px;
  padding: 30px 30px 30px;
  background: white;
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.pagination-btn {
  background-color: #007aff;
  color: white;
  border: none;
  padding: 12px 25px;
  border-radius: 25px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pagination-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #007aff, #0056b3);
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(0, 122, 255, 0.3);
}

.pagination-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: var(--text-muted);
}

.pagination-info {
  color: var(--text-color);
  font-weight: 600;
  padding: 12px 20px;
  background: rgba(0, 122, 255, 0.1);
  border-radius: 20px;
  border: 1px solid rgba(0, 122, 255, 0.2);
}

/* RSS Search and Filter Controls */
.rss-controls {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 40px;
  margin-bottom: 30px;
}

.search-container {
  display: flex;
  justify-content: center;
}

.search-input-wrapper {
  position: relative;
  width: 100%;
  max-width: 400px;
}

.rss-search {
  width: 100%;
  padding: 15px 50px 15px 50px;
  border: 2px solid #e5e5e5;
  border-radius: 25px;
  font-size: 16px;
  background: white;
  transition: all 0.3s ease;
  outline: none;
}

.rss-search:focus {
  border-color: #007aff;
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

.search-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: #86868b;
  font-size: 16px;
  pointer-events: none;
}

.clear-search {
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #86868b;
  font-size: 14px;
  cursor: pointer;
  padding: 5px;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.clear-search:hover {
  background: #f5f5f7;
  color: #1d1d1f;
}

.filter-container {
  display: flex;
  justify-content: center;
}

.filter-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.filter-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: white;
  border: 2px solid #e5e5e5;
  border-radius: 25px;
  color: #1d1d1f;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.filter-btn:hover {
  border-color: #007aff;
  color: #007aff;
  transform: translateY(-2px);
}

.filter-btn.active {
  background: #007aff;
  border-color: #007aff;
  color: white;
  box-shadow: 0 4px 15px rgba(0, 122, 255, 0.3);
}

.filter-btn i {
  font-size: 14px;
}

/* RSS Count */
.rss-count {
  text-align: center;
  margin-bottom: 20px;
}

.rss-count span {
  color: #86868b;
  font-size: 14px;
  background: white;
  padding: 8px 16px;
  border-radius: 20px;
  border: 1px solid #e5e5e5;
}

/* No Results */
.no-results {
  text-align: center;
  padding: 60px 20px;
  background: white;
  border-radius: 20px;
  border: 2px dashed #e5e5e5;
  margin: 20px 0;
}

.no-results-content i {
  font-size: 3rem;
  color: #86868b;
  margin-bottom: 20px;
}

.no-results-content h3 {
  font-size: 1.5rem;
  color: #1d1d1f;
  margin-bottom: 10px;
}

.no-results-content p {
  color: #86868b;
  font-size: 16px;
  line-height: 1.5;
}

/* Dark Mode Support for RSS Controls */
.dark-mode .rss-search,
.dark-mode .filter-btn {
  background: var(--card-bg);
  border-color: rgba(255, 255, 255, 0.1);
  color: var(--text-color);
}

.dark-mode .rss-search:focus {
  border-color: #007aff;
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

.dark-mode .filter-btn:hover {
  border-color: #007aff;
  color: #007aff;
}

.dark-mode .filter-btn.active {
  background: #007aff;
  border-color: #007aff;
  color: white;
}

.dark-mode .rss-count span {
  background: var(--card-bg);
  border-color: rgba(255, 255, 255, 0.1);
  color: var(--text-color);
}

.dark-mode .no-results {
  background: var(--card-bg);
  border-color: rgba(255, 255, 255, 0.1);
}

.dark-mode .no-results-content h3 {
  color: var(--text-color);
}

.dark-mode .clear-search:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-color);
}

/* Show More Categories Feature */
.show-more-categories {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: #007aff;
  border: 2px solid #007aff;
  border-radius: 25px;
  color: #ffffff;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.show-more-categories:hover {
  background: white;
  color: #007aff;
  border-color: #007aff;
}

.show-more-categories i {
  font-size: 12px;
  transition: transform 0.3s ease;
}

.show-more-categories.expanded i {
  transform: rotate(180deg);
}

.dark-mode .show-more-categories {
  background: var(--card-bg);
  border-color: rgba(255, 255, 255, 0.1);
  color: #007aff;
}

.dark-mode .show-more-categories:hover {
  background: #007aff;
  color: white;
  border-color: #007aff;
}
/* Hide categories beyond first 6 on mobile (including "All Articles") */
.filter-btn:nth-child(n + 7) {
  display: none;
}

.filter-buttons.show-all .filter-btn {
  display: flex;
}

.show-more-categories {
  padding: 8px 14px;
  font-size: 12px;
}
/* Responsive Design for RSS Controls */
@media (max-width: 768px) {
  .rss-controls {
    margin-top: 20px;
    margin-bottom: 20px;
  }

  .search-input-wrapper {
    max-width: 100%;
  }

  .filter-btn {
    padding: 10px 16px;
    font-size: 13px;
  }

  .filter-buttons {
    gap: 8px;
    position: relative;
  }

  /* Hide categories beyond first 6 on mobile (including "All Articles") */
  .filter-btn:nth-child(n + 7) {
    display: none;
  }

  .filter-buttons.show-all .filter-btn {
    display: flex;
  }

  .show-more-categories {
    padding: 8px 14px;
    font-size: 12px;
  }

  /* Always show "Show More" button on mobile */
  .show-more-categories {
    display: flex;
  }
}

/* Hide "Show More" button on desktop */
@media (min-width: 769px) {
  .show-more-categories {
    /* display: none; */
  }
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .rss-feed {
    padding: 80px 0;
  }

  .rss-container {
    padding: 0 5px;
  }

  .rss-header {
    flex-direction: column;
    gap: 20px;
    text-align: center;
    padding: 25px 10px;
  }

  .rss-source {
    font-size: 1.2rem;
  }

  .news-grid {
    grid-template-columns: 1fr;
    gap: 25px;
    padding: 0;
  }

  .news-card {
    width: 100%;
    margin: 0;
    border-radius: 20px;
    min-height: 450px;
  }

  .news-image {
    height: 260px;
  }

  .news-content {
    padding: 28px;
    gap: 18px;
  }

  .news-title {
    font-size: 1.4rem;
    line-height: 1.4;
  }

  .news-meta {
    flex-direction: row;
    gap: 16px;
    align-items: center;
    justify-content: space-between;
  }

  .news-date,
  .news-author {
    font-size: 0.9rem;
  }

  .news-description {
    font-size: 1rem;
    line-height: 1.6;
  }

  .read-more-btn {
    padding: 14px 26px;
    font-size: 0.95rem;
  }

  .rss-pagination {
    flex-direction: column;
    gap: 15px;
    padding: 20px;
  }

  .pagination-btn {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .rss-feed {
    padding: 60px 0;
  }

  .rss-container {
    padding: 0 5px;
  }

  .rss-header {
    padding: 20px 8px;
  }

  .news-grid {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 0;
  }

  .news-card {
    border-radius: 18px;
    min-height: 420px;
  }

  .news-image {
    height: 220px;
  }

  .news-category {
    top: 12px;
    left: 12px;
    padding: 8px 14px;
    font-size: 0.75rem;
  }

  .news-content {
    padding: 24px;
    gap: 16px;
  }

  .news-title {
    font-size: 1.25rem;
    line-height: 1.3;
  }

  .news-meta {
    gap: 12px;
    flex-direction: row;
    justify-content: space-between;
  }

  .news-date,
  .news-author {
    font-size: 0.85rem;
  }

  .news-description {
    font-size: 0.95rem;
    line-height: 1.5;
  }

  .read-more-btn {
    padding: 12px 22px;
    font-size: 0.9rem;
    gap: 10px;
  }
}

/* Large screens optimization */
@media (min-width: 1400px) {
  .news-grid {
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 40px;
  }

  .news-card {
    border-radius: 28px;
  }

  .news-image {
    height: 320px;
  }

  .news-content {
    padding: 40px;
  }

  .news-title {
    font-size: 1.6rem;
  }

  .news-description {
    font-size: 1.1rem;
  }
}

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

.rss-articles {
  display: grid;
  gap: 25px;
}

.rss-article {
  background: var(--bg-color);
  border-radius: 15px;
  padding: 25px;
  border: 1px solid var(--border-color);
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.rss-article:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 40px rgba(0, 122, 255, 0.1);
  border-color: var(--primary-color);
}

.rss-article::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(
    90deg,
    var(--primary-color),
    var(--secondary-color)
  );
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.rss-article:hover::before {
  transform: scaleX(1);
}

.article-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 15px;
  gap: 20px;
}

.article-title {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text-color);
  margin: 0;
  line-height: 1.4;
  flex: 1;
}

.article-date {
  font-size: 0.85rem;
  color: var(--text-muted);
  white-space: nowrap;
  background: var(--card-bg);
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid var(--border-color);
}

.article-description {
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 15px;
  font-size: 0.95rem;
}

.article-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
  padding-top: 15px;
  border-top: 1px solid var(--border-color);
}

.article-author {
  font-size: 0.9rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 5px;
}

.article-author i {
  color: var(--primary-color);
}

.read-more {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.9rem;
  transition: all 0.3s ease;
}

.read-more:hover {
  color: var(--secondary-color);
  transform: translateX(5px);
}

.rss-error {
  text-align: center;
  padding: 60px 20px;
}

.error-content {
  max-width: 400px;
  margin: 0 auto;
}

.error-content i {
  font-size: 3rem;
  color: #dc3545;
  margin-bottom: 20px;
}

.error-content h3 {
  color: var(--text-color);
  margin-bottom: 10px;
  font-size: 1.5rem;
}

.error-content p {
  color: var(--text-muted);
  margin-bottom: 25px;
  line-height: 1.6;
}

.retry-btn {
  background: #ffffff;
  color: rgb(255, 0, 0);
  border: none;
  padding: 12px 25px;
  border-radius: 25px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.retry-btn:hover {
  background: var(--secondary-color);
  transform: translateY(-2px);
}

.rss-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 15px;
  margin-top: 30px;
  /* padding-top: 20px; */
  border: 1px solid rgb(225, 225, 225);
}

.pagination-btn {
  background: var(--card-bg);
  color: var(--text-color);
  border: 1px solid var(--border-color);
  padding: 10px 20px;
  border-radius: 25px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 500;
}

.pagination-btn:hover:not(:disabled) {
  background: #007aff;
  color: white;
  border-color: #5dabff;
}

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

.pagination-info {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Dark mode adjustments */
.dark-mode .rss-container {
  background: var(--card-bg-dark);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.dark-mode .rss-article {
  background: var(--bg-color-dark);
  border-color: var(--border-color-dark);
}

.dark-mode .article-date {
  background: var(--card-bg-dark);
  border-color: var(--border-color-dark);
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .rss-feed {
    padding: 60px 0;
  }

  .rss-container {
    padding: 0 5px;
  }

  .rss-header {
    flex-direction: column;
    gap: 15px;
    text-align: center;
  }

  .article-header {
    flex-direction: column;
    gap: 10px;
  }

  .article-title {
    font-size: 1.1rem;
  }

  .article-footer {
    flex-direction: column;
    gap: 10px;
    text-align: center;
  }

  .rss-pagination {
    flex-direction: column;
    gap: 10px;
  }
}

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

.rss-article {
  animation: fadeInUp 0.5s ease forwards;
}

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