/* Modern News Page Styles */
.news-hero {
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  padding: 6rem 0 4rem;
  position: relative;
  overflow: hidden;
}

.news-hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(
      circle at 20% 20%,
      rgba(99, 102, 241, 0.05) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle at 80% 80%,
      rgba(139, 92, 246, 0.05) 0%,
      transparent 50%
    );
  pointer-events: none;
}

.news-hero-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 4rem;
  align-items: center;
  position: relative;
  z-index: 1;
}

.news-hero-content {
  text-align: left;
}

.news-badge {
  display: inline-block;
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--secondary-color)
  );
  color: white;
  padding: 0.5rem 1.5rem;
  border-radius: 50px;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.news-hero-title {
  color: var(--text-color);
  font-size: 3.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  line-height: 1.2;
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--secondary-color)
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.news-hero-subtitle {
  color: var(--light-text);
  font-size: 1.25rem;
  line-height: 1.6;
  margin-bottom: 0;
}

.news-hero-stats {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.stat-item {
  text-align: center;
  padding: 1.5rem;
  background: var(--white);
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.1);
}

.stat-number {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--primary-color);
  line-height: 1;
  margin-bottom: 0.5rem;
}

.stat-label {
  font-size: 0.875rem;
  color: var(--light-text);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 500;
}

/* News Content */
.news-content {
  padding: 4rem 0;
  background: var(--white);
}

.news-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* News Filters */
.news-filters {
  display: flex;
  gap: 1rem;
  margin-bottom: 3rem;
  justify-content: center;
  flex-wrap: wrap;
}

.filter-btn {
  background: var(--white);
  color: var(--light-text);
  border: 2px solid rgba(99, 102, 241, 0.1);
  padding: 0.75rem 1.5rem;
  border-radius: 50px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.filter-btn:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.15);
}

.filter-btn.active {
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--secondary-color)
  );
  color: white;
  border-color: transparent;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

/* News Grid */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
}

/* News Cards */
.news-card {
  background: var(--white);
  border-radius: 16px;
  padding: 0;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid rgba(99, 102, 241, 0.1);
  position: relative;
  overflow: hidden;
  opacity: 0;
  transform: translateY(30px);
}

.news-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 20px 40px rgba(99, 102, 241, 0.15);
  border-color: var(--primary-color);
}

.news-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 1.5rem 0;
  margin-bottom: 1rem;
}

.news-card-badge {
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--secondary-color)
  );
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.news-card-date {
  color: var(--light-text);
  font-size: 0.875rem;
  font-weight: 500;
}

.news-card-content {
  padding: 0 1.5rem 1.5rem;
}

.news-card-title {
  color: var(--text-color);
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  line-height: 1.3;
}

.news-card-excerpt {
  color: var(--light-text);
  line-height: 1.6;
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}

.news-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1rem;
}

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

.tag {
  background: rgba(99, 102, 241, 0.1);
  color: var(--primary-color);
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
}

.news-card-btn {
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--secondary-color)
  );
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 50px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 0.875rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.news-card-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(99, 102, 241, 0.3);
}

/* Load More Button */
.news-load-more {
  text-align: center;
  margin-top: 3rem;
}

.load-more-btn {
  background: var(--white);
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
  padding: 1rem 2rem;
  border-radius: 50px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1rem;
}

.load-more-btn:hover {
  background: var(--primary-color);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(99, 102, 241, 0.3);
}

.btn-icon {
  transition: transform 0.3s ease;
}

.load-more-btn:hover .btn-icon {
  transform: translateY(2px);
}

/* Responsive Design */
@media (max-width: 768px) {
  .news-hero {
    padding: 4rem 0 3rem;
  }

  .news-hero-container {
    grid-template-columns: 1fr;
    gap: 2rem;
    text-align: center;
  }

  .news-hero-title {
    font-size: 2.5rem;
  }

  .news-hero-stats {
    flex-direction: row;
    justify-content: center;
    gap: 1rem;
  }

  .stat-item {
    padding: 1rem;
    flex: 1;
  }

  .stat-number {
    font-size: 2rem;
  }

  .news-filters {
    gap: 0.5rem;
    margin-bottom: 2rem;
  }

  .filter-btn {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
  }

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

  .news-card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .news-card-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
}

@media (max-width: 480px) {
  .news-hero {
    padding: 3rem 0 2rem;
  }

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

  .news-hero-subtitle {
    font-size: 1rem;
  }

  .news-hero-stats {
    flex-direction: column;
    gap: 1rem;
  }

  .stat-item {
    padding: 1rem;
  }

  .stat-number {
    font-size: 1.75rem;
  }

  .news-card-content {
    padding: 0 1rem 1rem;
  }

  .news-card-title {
    font-size: 1.25rem;
  }

  .news-card-excerpt {
    font-size: 0.875rem;
  }

  .news-card-btn {
    padding: 0.625rem 1.25rem;
    font-size: 0.8rem;
  }
}

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(5px);
}

.modal-content {
  background-color: var(--white);
  margin: 5% auto;
  padding: 2rem;
  border-radius: var(--border-radius);
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  animation: modalSlideIn 0.3s ease-out;
  border: 2px solid var(--accent-color);
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-50px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal {
  animation: modalFadeIn 0.3s ease-out;
}

.close {
  color: var(--light-text);
  float: right;
  font-size: 2rem;
  font-weight: bold;
  cursor: pointer;
  line-height: 1;
  transition: var(--transition-fast);
}

.close:hover,
.close:focus {
  color: var(--primary-color);
  transform: scale(1.1);
}

.close:focus {
  outline: 2px solid var(--accent-color);
  outline-offset: 2px;
}

#modalTitle {
  color: var(--primary-color);
  margin-bottom: 1rem;
  font-size: 1.75rem;
  font-weight: 600;
  border-bottom: 2px solid var(--accent-color);
  padding-bottom: 0.5rem;
}

#modalContent {
  color: var(--light-text);
  line-height: 1.7;
  font-size: 1rem;
  margin-bottom: 1rem;
}

/* Стилі для зображення в модальному вікні */
.modal-image {
  width: 200px;
  max-width: 200px;
  height: auto;
  border-radius: var(--border-radius);
  margin-bottom: 1rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  display: block;
  margin-left: auto;
  margin-right: auto;
}

/* Accessibility improvements */
.modal:focus {
  outline: none;
}

.modal-content:focus {
  outline: none;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .modal-content {
    border: 3px solid var(--primary-color);
  }

  .close {
    border: 2px solid var(--primary-color);
    border-radius: 4px;
    padding: 2px 6px;
  }
}

/* Updated Read More Button Styles */
.news-item .read-more-btn {
  background: var(--accent-color);
  color: var(--white);
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: var(--border-radius);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
  margin-top: 1.5rem;
  font-size: 0.9rem;
  display: inline-block;
  position: relative;
  overflow: hidden;
  /* Забезпечуємо, що кнопка завжди видима після обрізаного тексту */
  z-index: 2;
  position: relative;
}

.news-item .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;
}

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

.news-item .read-more-btn:hover {
  background: var(--primary-color);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.news-item .read-more-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.news-item .read-more-btn:focus {
  outline: 2px solid var(--white);
  outline-offset: 2px;
}

/* Modal Responsive Design */
@media (max-width: 768px) {
  .modal-content {
    margin: 10% auto;
    padding: 1.5rem;
    width: 95%;
    max-height: 85vh;
  }

  #modalTitle {
    font-size: 1.5rem;
  }

  #modalContent {
    font-size: 0.95rem;
  }
}

@media (max-width: 360px) {
  .modal-content {
    margin: 15% auto;
    padding: 1.25rem;
    width: 98%;
  }

  #modalTitle {
    font-size: 1.25rem;
  }

  #modalContent {
    font-size: 0.9rem;
  }
}

/* Touch device improvements */
@media (hover: none) and (pointer: coarse) {
  .read-more-btn {
    min-height: 44px;
    min-width: 44px;
  }

  .close {
    min-height: 44px;
    min-width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .news-item .read-more-btn:hover::before {
    display: none;
  }
}

/* News Print Styles */
@media print {
  .news {
    background: white !important;
    color: black !important;
  }

  .news-item {
    box-shadow: none !important;
    border: 1px solid #ccc !important;
    break-inside: avoid;
  }

  .news-interactive {
    box-shadow: none !important;
    border: 1px solid #ccc !important;
  }
}
