/* News Page Specific Styles */

/* Breaking News Banner */
.breaking-news {
  background: linear-gradient(135deg, #dc2626, #ef4444);
  color: white;
  padding: 1rem 0;
  position: relative;
  overflow: hidden;
}

.breaking-banner {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.breaking-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.breaking-text {
  background: rgba(255, 255, 255, 0.2);
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  font-weight: 700;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.breaking-pulse {
  width: 0.5rem;
  height: 0.5rem;
  background: white;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

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

.breaking-content {
  flex: 1;
  min-width: 0;
}

.breaking-title {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
  line-height: 1.3;
}

.breaking-description {
  font-size: 0.875rem;
  opacity: 0.9;
  line-height: 1.4;
}

/* News Categories */
.news-categories {
  padding: 2rem 0;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-primary);
}

.categories-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.categories-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
}

.category-buttons {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.category-btn {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border-primary);
  background: var(--bg-primary);
  color: var(--text-secondary);
  border-radius: 2rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.category-btn:hover {
  background: var(--bg-tertiary);
  border-color: var(--border-secondary);
}

.category-btn.active {
  background: var(--primary-600);
  color: white;
  border-color: var(--primary-600);
}

/* Featured News */
.featured-news {
  padding: 3rem 0;
}

.news-card.featured {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: center;
  background: var(--bg-primary);
  border: 1px solid var(--border-primary);
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.news-card.featured .news-image {
  height: 300px;
}

.news-card.featured .news-content {
  padding: 2rem;
}

.news-card.featured .news-title {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.news-card.featured .news-description {
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

/* News Grid */
.news-section {
  padding: 3rem 0;
}

.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 2rem;
}

.news-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-primary);
  border-radius: 1rem;
  overflow: hidden;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-sm);
}

.news-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

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

.news-badges {
  position: absolute;
  top: 1rem;
  left: 1rem;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.badge {
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.badge-featured {
  background: var(--primary-600);
  color: white;
}

.badge-breaking {
  background: #dc2626;
  color: white;
  animation: pulse 2s infinite;
}

.badge-update {
  background: #3b82f6;
  color: white;
}
.badge-security {
  background: #10b981;
  color: white;
}
.badge-event {
  background: #8b5cf6;
  color: white;
}
.badge-community {
  background: #f59e0b;
  color: white;
}
.badge-mod {
  background: #ef4444;
  color: white;
}
.badge-esports {
  background: #06b6d4;
  color: white;
}

.credibility-indicator {
  position: absolute;
  top: 1rem;
  right: 1rem;
  text-align: center;
}

.credibility-score {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: conic-gradient(var(--primary-600) calc(var(--score) * 1%), var(--border-primary) 0);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.credibility-score::before {
  content: "";
  position: absolute;
  inset: 3px;
  background: var(--bg-primary);
  border-radius: 50%;
}

.credibility-score span {
  position: relative;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-primary);
}

.credibility-label {
  font-size: 0.625rem;
  color: var(--text-tertiary);
  margin-top: 0.25rem;
}

.news-content {
  padding: 1.5rem;
}

.news-header {
  margin-bottom: 1rem;
}

.news-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
  margin-bottom: 0.75rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.75rem;
  color: var(--text-tertiary);
  flex-wrap: wrap;
}

.news-description {
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-tags {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.tag {
  padding: 0.25rem 0.5rem;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border-radius: 0.25rem;
  font-size: 0.75rem;
  font-weight: 500;
}

.news-stats {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  font-size: 0.75rem;
  color: var(--text-tertiary);
}

.stat {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.stat-icon {
  width: 0.875rem;
  height: 0.875rem;
}

.news-source {
  margin-bottom: 1rem;
  font-size: 0.75rem;
  color: var(--text-tertiary);
}

.source-label {
  font-weight: 500;
}

.source-name {
  color: var(--text-secondary);
  font-weight: 600;
}

.news-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* Background Colors for Categories */
.update-bg {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
}
.security-bg {
  background: linear-gradient(135deg, #10b981, #059669);
}
.event-bg {
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
}
.community-bg {
  background: linear-gradient(135deg, #f59e0b, #d97706);
}
.mod-bg {
  background: linear-gradient(135deg, #ef4444, #dc2626);
}
.esports-bg {
  background: linear-gradient(135deg, #06b6d4, #0891b2);
}

/* Modal Styles */
.share-modal-overlay,
.article-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.share-modal-overlay.active,
.article-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.share-modal,
.article-modal {
  background: var(--bg-primary);
  border-radius: 1rem;
  box-shadow: var(--shadow-xl);
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.share-modal-overlay.active .share-modal,
.article-modal-overlay.active .article-modal {
  transform: scale(1);
}

.article-modal {
  max-width: 800px;
}

.share-modal-header,
.article-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-primary);
}

.modal-close-btn {
  width: 2rem;
  height: 2rem;
  border: none;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border-radius: 0.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.modal-close-btn:hover {
  background: var(--bg-quaternary);
  color: var(--text-primary);
}

.share-modal-content,
.article-modal-content {
  padding: 1.5rem;
}

.share-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.share-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem;
  border: 1px solid var(--border-primary);
  background: var(--bg-secondary);
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  color: var(--text-primary);
}

.share-option:hover {
  background: var(--bg-tertiary);
  border-color: var(--border-secondary);
  transform: translateY(-2px);
}

.share-option svg {
  width: 1.5rem;
  height: 1.5rem;
}

/* Article Modal Specific Styles */
.article-header {
  margin-bottom: 2rem;
}

.article-title {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
  margin-bottom: 1rem;
}

.article-meta {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-tertiary);
}

.meta-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: center;
}

.article-image {
  width: 100%;
  height: 300px;
  object-fit: cover;
  border-radius: 0.5rem;
  margin-bottom: 2rem;
}

.article-content {
  line-height: 1.7;
  color: var(--text-primary);
}

.article-lead {
  font-size: 1.125rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 2rem;
  padding: 1rem;
  background: var(--bg-secondary);
  border-radius: 0.5rem;
  border-left: 4px solid var(--primary-600);
}

.article-body h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 2rem 0 1rem 0;
}

.article-body p {
  margin-bottom: 1rem;
}

.article-body ul {
  margin: 1rem 0;
  padding-left: 1.5rem;
}

.article-body li {
  margin-bottom: 0.5rem;
}

.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 2rem 0;
  padding: 1rem;
  background: var(--bg-secondary);
  border-radius: 0.5rem;
}

.article-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1rem;
  background: var(--bg-secondary);
  border-radius: 0.5rem;
  margin-top: 2rem;
}

/* Toast Notifications */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--primary-600);
  color: white;
  padding: 1rem 1.5rem;
  border-radius: 0.5rem;
  font-weight: 500;
  z-index: 1001;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  box-shadow: var(--shadow-lg);
}

.toast.show {
  transform: translateX(0);
}

.toast.success {
  background: #10b981;
}

.toast.error {
  background: #ef4444;
}

.toast.warning {
  background: #f59e0b;
}

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

.load-more-btn {
  padding: 0.75rem 2rem;
  background: var(--primary-600);
  color: white;
  border: none;
  border-radius: 2rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-sm);
}

.load-more-btn:hover {
  background: var(--primary-700);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.load-more-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Search and Filters */
.news-filters {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: var(--bg-primary);
  border: 1px solid var(--border-primary);
  border-radius: 1rem;
}

.search-container {
  position: relative;
}

.search-input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.5rem;
  border: 1px solid var(--border-primary);
  border-radius: 2rem;
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 0.875rem;
  transition: all 0.2s ease;
}

.search-input:focus {
  outline: none;
  border-color: var(--primary-600);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.1);
}

.search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1rem;
  height: 1rem;
  color: var(--text-tertiary);
}

/* Empty and Error States */
.empty-state,
.error-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-secondary);
}

.empty-state-icon,
.error-state-icon {
  width: 4rem;
  height: 4rem;
  margin: 0 auto 1rem;
  opacity: 0.5;
}

.error-state-icon {
  color: #ef4444;
  opacity: 1;
}

.empty-state h3,
.error-state h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

/* Responsive Design */
@media (max-width: 768px) {
  .news-card.featured {
    grid-template-columns: 1fr;
  }

  .news-card.featured .news-image {
    height: 250px;
  }

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

  .category-buttons {
    justify-content: center;
  }

  .breaking-banner {
    flex-direction: column;
    text-align: center;
  }

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

  .meta-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .share-options {
    grid-template-columns: repeat(2, 1fr);
  }

  .toast {
    right: 1rem;
    left: 1rem;
    bottom: 1rem;
  }
}

@media (max-width: 480px) {
  .news-content {
    padding: 1rem;
  }

  .article-modal-content {
    padding: 1rem;
  }

  .breaking-news {
    margin: 0 -1rem 2rem -1rem;
    border-radius: 0;
  }

  .news-filters {
    margin: 0 -1rem 2rem -1rem;
    border-radius: 0;
  }
}

/* Dark Mode Adjustments */
@media (prefers-color-scheme: dark) {
  .credibility-score::before {
    background: var(--bg-primary);
  }

  .share-modal,
  .article-modal {
    background: var(--bg-primary);
    border-color: var(--border-primary);
  }
}

/* Print Styles */
@media print {
  .news-filters,
  .news-actions,
  .load-more-container,
  .breaking-news {
    display: none;
  }

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

  .news-card:hover {
    transform: none;
  }
}

*{
   font-family: "Cairo", sans-serif !important;
}

/* Accessibility Improvements */
@media (prefers-reduced-motion: reduce) {
  .news-card,
  .category-btn,
  .share-option,
  .toast,
  .load-more-btn {
    transition: none;
  }

  .breaking-pulse,
  .badge-breaking {
    animation: none;
  }
}

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

  .category-btn {
    border-width: 2px;
  }
}

/* Focus Styles for Keyboard Navigation */
.category-btn:focus,
.search-input:focus,
.share-option:focus,
.modal-close-btn:focus,
.load-more-btn:focus {
  outline: 2px solid var(--primary-600);
  outline-offset: 2px;
}

/* Loading States */
.news-card.loading {
  opacity: 0.6;
  pointer-events: none;
}

.news-card.loading::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  animation: loading-shimmer 1.5s infinite;
}

@keyframes loading-shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}
