/* ملف news.css - تصميم متقدم لصفحة الأخبار */
:root {
  --primary-color: #a8c45b;
  --secondary-color: #00c4cc;
  --accent-color: #579192;
  --dark-color: #2c3e50;
  --light-color: #f8f9fa;
  --text-color: #333;
  --text-light: #6c757d;
  --border-color: #e9ecef;
  --shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  --shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.15);
  --transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ========== NEWS HEADER SECTION ========== */
.news-header {
  background: linear-gradient(
      135deg,
      rgba(168, 196, 91, 0.9) 0%,
      rgba(0, 196, 204, 0.8) 50%,
      rgba(87, 145, 146, 0.9) 100%
    ),
    url("../images/news-bg.jpg") center/cover;
  padding: 100px 0 80px;
  position: relative;
  overflow: hidden;
  animation: slideInFromTop 0.8s ease-out;
}

@keyframes slideInFromTop {
  from {
    opacity: 0;
    transform: translateY(-50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.news-header::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 100%;
  height: 100%;
  background: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 60c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z' fill='%23ffffff' fill-opacity='0.1' fill-rule='evenodd'/%3E%3C/svg%3E");
  animation: float 20s infinite linear;
}

@keyframes float {
  0% {
    transform: translateY(0) translateX(0);
  }
  50% {
    transform: translateY(-20px) translateX(10px);
  }
  100% {
    transform: translateY(0) translateX(0);
  }
}

.news-header-content {
  text-align: center;
  color: white;
  position: relative;
  z-index: 2;
  animation: fadeInUp 0.8s ease-out 0.3s both;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.news-header-content h1 {
  font-size: 3.5rem;
  font-weight: 700;
  margin-bottom: 20px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  background: linear-gradient(135deg, #fff 0%, #f0f0f0 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.news-header-content p {
  font-size: 1.3rem;
  opacity: 0.9;
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
  text-shadow: 0 1px 5px rgba(0, 0, 0, 0.2);
}

/* ========== NEWS SECTION ========== */
.news-section {
  padding: 80px 0;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  min-height: 60vh;
  animation: fadeIn 0.8s ease-out 0.5s both;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Error and No News Messages */
.error-message,
.no-news {
  background: white;
  padding: 30px;
  border-radius: 15px;
  text-align: center;
  box-shadow: var(--shadow);
  border-left: 4px solid #dc3545;
  animation: shake 0.5s ease-in-out;
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-5px);
  }
  75% {
    transform: translateX(5px);
  }
}

.no-news {
  border-left-color: var(--primary-color);
}

.error-message p,
.no-news p {
  font-size: 1.2rem;
  color: var(--dark-color);
  margin: 0;
  font-weight: 500;
}

/* News Grid */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: 30px;
  margin-top: 40px;
}

/* News Cards */
.news-card {
  background: white;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
  text-decoration: none;
  display: block;
  position: relative;
  animation: slideInUp 0.6s ease-out;
  animation-fill-mode: both;
}

.news-card:nth-child(1) {
  animation-delay: 0.1s;
}
.news-card:nth-child(2) {
  animation-delay: 0.2s;
}
.news-card:nth-child(3) {
  animation-delay: 0.3s;
}
.news-card:nth-child(4) {
  animation-delay: 0.4s;
}
.news-card:nth-child(5) {
  animation-delay: 0.5s;
}
.news-card:nth-child(6) {
  animation-delay: 0.6s;
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.news-card:hover {
  transform: translateY(-10px) scale(1.02);
  box-shadow: var(--shadow-hover);
}

.news-card:hover::before {
  opacity: 1;
}

/* News Image */
.news-image {
  width: 100%;
  height: 250px;
  object-fit: cover;
  transition: var(--transition);
  position: relative;
  z-index: 0;
}

/* News Content */
.news-content {
  padding: 25px;
  position: relative;
  z-index: 2;
  background: white;
}

.news-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--dark-color);
  margin-bottom: 15px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: var(--transition);
}

.news-card:hover .news-title {
  color: var(--primary-color);
}

.news-date {
  display: inline-block;
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--secondary-color)
  );
  color: white;
  padding: 6px 15px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 15px;
  box-shadow: 0 2px 8px rgba(168, 196, 91, 0.3);
}

.news-description {
  color: var(--text-light);
  line-height: 1.6;
  margin-bottom: 20px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 0.95rem;
}

.read-more {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--primary-color);
  font-weight: 600;
  font-size: 0.95rem;
  transition: var(--transition);
  position: relative;
}

.read-more::after {
  content: "";
  position: absolute;
  bottom: -2px;
  right: 0;
  width: 0;
  height: 2px;
  background: var(--primary-color);
  transition: var(--transition);
}

.news-card:hover .read-more {
  transform: translateX(-5px);
  color: var(--secondary-color);
}

.news-card:hover .read-more::after {
  width: 100%;
}

.read-more i {
  transition: var(--transition);
}

.news-card:hover .read-more i {
  transform: translateX(-3px);
}

/* ========== RESPONSIVE DESIGN ========== */
@media (max-width: 1024px) {
  .news-grid {
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 25px;
  }

  .news-header-content h1 {
    font-size: 3rem;
  }
}

@media (max-width: 768px) {
  .news-header {
    padding: 80px 0 60px;
  }

  .news-header-content h1 {
    font-size: 2.5rem;
  }

  .news-header-content p {
    font-size: 1.1rem;
  }

  .news-section {
    padding: 60px 0;
  }

  .news-grid {
    grid-template-columns: 1fr;
    gap: 20px;
    margin-top: 30px;
  }

  .news-card {
    border-radius: 15px;
  }

  .news-content {
    padding: 20px;
  }

  .news-title {
    font-size: 1.3rem;
  }

  .news-image {
    height: 220px;
  }
}

@media (max-width: 480px) {
  .news-header {
    padding: 60px 0 40px;
  }

  .news-header-content h1 {
    font-size: 2rem;
  }

  .news-header-content p {
    font-size: 1rem;
  }

  .news-section {
    padding: 40px 0;
  }

  .news-grid {
    gap: 15px;
  }

  .news-content {
    padding: 15px;
  }

  .news-title {
    font-size: 1.2rem;
  }

  .news-image {
    height: 200px;
  }

  .news-description {
    font-size: 0.9rem;
  }
}

@keyframes loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.news-image[src] {
  animation: none;
  background: none;
}
