/* News Page Styles */

/* Hero Section */
.news-hero {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  min-height: 60vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.news-hero::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 1000 100" fill="%23ffffff" opacity="0.1"><polygon points="1000,100 1000,0 0,100"/></svg>') no-repeat center bottom;
  background-size: cover;
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.3);
}

.hero-content {
  position: relative;
  z-index: 2;
  color: white;
  text-align: center;
}

.hero-title {
  font-size: 3.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.hero-subtitle {
  font-size: 1.25rem;
  font-weight: 300;
  opacity: 0.9;
  max-width: 600px;
  margin: 0 auto;
}

/* Search and Filter Section */
.search-filter-section {
  background: #f8f9fa;
  border-bottom: 1px solid #e9ecef;
}

.search-box {
  position: relative;
}

.search-box input {
  padding-left: 45px;
  border: 2px solid #e9ecef;
  border-radius: 25px;
  transition: all 0.3s ease;
}

.search-box input:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 0.2rem rgba(99, 102, 241, 0.25);
}

.search-icon {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: #6c757d;
  z-index: 3;
}

.filter-options select {
  border: 2px solid #e9ecef;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.filter-options select:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 0.2rem rgba(99, 102, 241, 0.25);
}

/* News Section */
.news-section {
  background: #ffffff;
}

.news-card {
  background: white;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.news-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}

.news-image {
  position: relative;
  height: 250px;
  overflow: hidden;
}

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

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

.news-category {
  position: absolute;
  top: 15px;
  left: 15px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: white;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.news-content {
  padding: 25px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.news-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  font-size: 0.9rem;
  color: #6c757d;
}

.news-date {
  display: flex;
  align-items: center;
  gap: 5px;
}

.news-source {
  background: #f8f9fa;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 500;
}

.news-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 15px;
  line-height: 1.4;
  color: #312e81;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-excerpt {
  color: #6c757d;
  line-height: 1.6;
  margin-bottom: 20px;
  flex-grow: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-link {
  color: #6366f1;
  text-decoration: none;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s ease;
  margin-top: auto;
}

.news-link:hover {
  color: #8b5cf6;
  gap: 12px;
}

.news-link i {
  transition: transform 0.3s ease;
}

.news-link:hover i {
  transform: translateX(3px);
}

/* Load More Button */
#loadMoreBtn {
  border: 2px solid #6366f1;
  color: #6366f1;
  padding: 12px 30px;
  border-radius: 25px;
  font-weight: 600;
  transition: all 0.3s ease;
}

#loadMoreBtn:hover {
  background: #6366f1;
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(99, 102, 241, 0.3);
}

/* No Results */
.no-results {
  text-align: center;
  padding: 60px 20px;
  color: #6c757d;
}

.no-results i {
  color: #dee2e6;
  margin-bottom: 20px;
}

.no-results h4 {
  color: #495057;
  margin-bottom: 10px;
}

/* Animation Classes */
.fade-in {
  animation: fadeIn 0.5s ease-in;
}

.fade-out {
  animation: fadeOut 0.3s ease-out;
}

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

@keyframes fadeOut {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-20px);
  }
}

/* Loading Animation */
.loading {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 40px;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #6366f1;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* Responsive Design */
@media (max-width: 768px) {
  .hero-title {
    font-size: 2.5rem;
  }

  .hero-subtitle {
    font-size: 1.1rem;
  }

  .news-hero {
    min-height: 50vh;
  }

  .search-filter-section .row {
    flex-direction: column;
  }

  .filter-options {
    justify-content: center !important;
    margin-top: 15px;
  }

  .filter-options select {
    margin-bottom: 10px;
  }

  .news-image {
    height: 200px;
  }

  .news-content {
    padding: 20px;
  }

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

  .news-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}

@media (max-width: 576px) {
  .hero-title {
    font-size: 2rem;
  }

  .news-content {
    padding: 15px;
  }

  .filter-options {
    flex-direction: column;
  }

  .filter-options select {
    width: 100%;
    margin-right: 0 !important;
    margin-bottom: 10px;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .search-filter-section {
    background: #1a1a1a;
    border-color: #333;
  }

  .news-section {
    background: #121212;
  }

  .news-card {
    background: #1e1e1e;
    color: #ffffff;
  }

  .news-title {
    color: #ffffff;
  }

  .news-source {
    background: #333;
    color: #ffffff;
  }
}

/* Print styles */
@media print {
  .news-hero,
  .search-filter-section,
  #loadMoreBtn,
  .footer {
    display: none;
  }

  .news-card {
    break-inside: avoid;
    box-shadow: none;
    border: 1px solid #ddd;
    margin-bottom: 20px;
  }

  .news-link {
    color: #000;
  }
}

/* Accessibility improvements */
.news-card:focus-within {
  outline: 2px solid #6366f1;
  outline-offset: 2px;
}

.news-link:focus {
  outline: 2px solid #6366f1;
  outline-offset: 2px;
  border-radius: 4px;
}

/* High contrast mode */
@media (prefers-contrast: high) {
  .news-card {
    border: 2px solid #000;
  }

  .news-category {
    background: #000;
    color: #fff;
  }

  .news-link {
    color: #0000ee;
  }

  .news-link:visited {
    color: #551a8b;
  }
}
