/* Mods Page Specific Styles */

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

.mod-filters {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.filter-section {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.filter-label {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

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

.filter-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;
}

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

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

/* Mod Loader Colors */
.loader-forge {
  background: #1e40af;
  color: white;
}

.loader-fabric {
  background: #059669;
  color: white;
}

.loader-quilt {
  background: #7c3aed;
  color: white;
}

.loader-neoforge {
  background: #dc2626;
  color: white;
}

/* Featured Mod */
.featured-mod {
  padding: 3rem 0;
}

.mod-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);
  position: relative;
}

.mod-card.featured::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-600), var(--accent-color));
}

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

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

.mod-card.featured .mod-title {
  font-size: 1.75rem;
  margin-bottom: 1rem;
}

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

/* Mod Grid */
.mods-section {
  padding: 3rem 0;
}

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

.mod-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);
  position: relative;
}

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

.mod-image {
  position: relative;
  height: 220px;
  overflow: hidden;
  background: linear-gradient(135deg, var(--primary-600), var(--accent-color));
}

.mod-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-new {
  background: #10b981;
  color: white;
}

.badge-updated {
  background: #3b82f6;
  color: white;
}

.badge-popular {
  background: #f59e0b;
  color: white;
}

.badge-beta {
  background: #8b5cf6;
  color: white;
}

/* Download Counter */
.download-counter {
  position: absolute;
  top: 1rem;
  right: 1rem;
  text-align: center;
}

.download-circle {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.download-count {
  font-size: 0.75rem;
  font-weight: 700;
  color: white;
  text-align: center;
  line-height: 1.2;
}

.download-label {
  font-size: 0.625rem;
  color: white;
  background: rgba(0, 0, 0, 0.6);
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
  margin-top: 0.25rem;
}

/* Favorite Button */
.favorite-btn {
  position: absolute;
  bottom: 1rem;
  right: 1rem;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  opacity: 0;
}

.mod-card:hover .favorite-btn {
  opacity: 1;
}

.favorite-btn:hover {
  background: white;
  transform: scale(1.1);
}

.favorite-btn.active {
  background: #ef4444;
  color: white;
}

.favorite-btn svg {
  width: 1.25rem;
  height: 1.25rem;
}

.mod-content {
  padding: 1.5rem;
}

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

.mod-title {
  font-size: 1.25rem;
  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;
}

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

.mod-version {
  padding: 0.25rem 0.5rem;
  background: var(--bg-secondary);
  border-radius: 0.25rem;
  font-weight: 600;
}

.mod-loader {
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

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

/* Mod Rating */
.mod-rating {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.stars {
  display: flex;
  gap: 0.125rem;
}

.star {
  color: var(--gray-300);
  font-size: 1rem;
  transition: color 0.2s ease;
}

.star.filled {
  color: #f59e0b;
}

.rating-text {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.rating-count {
  font-size: 0.75rem;
  color: var(--text-tertiary);
}

/* Mod Tags */
.mod-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;
  transition: all 0.2s ease;
}

.tag:hover {
  background: var(--primary-600);
  color: white;
}

/* Mod Stats */
.mod-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;
}

/* Mod Actions */
.mod-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.btn {
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.375rem;
  border: none;
  text-decoration: none;
}

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

.btn-primary:hover {
  background: var(--primary-700);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-primary);
}

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

.btn-icon {
  width: 1rem;
  height: 1rem;
}

/* Mod Modal */
.mod-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  backdrop-filter: blur(4px);
}

.mod-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

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

.mod-modal-overlay.active .mod-modal {
  transform: scale(1);
}

.mod-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-primary);
  position: sticky;
  top: 0;
  background: var(--bg-primary);
  z-index: 10;
}

.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);
}

.mod-modal-content {
  padding: 2rem;
}

/* Mod Gallery */
.mod-gallery {
  margin-bottom: 2rem;
}

.gallery-main {
  width: 100%;
  height: 400px;
  object-fit: cover;
  border-radius: 0.75rem;
  margin-bottom: 1rem;
}

.gallery-thumbnails {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
}

.gallery-thumb {
  width: 80px;
  height: 60px;
  object-fit: cover;
  border-radius: 0.375rem;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s ease;
  flex-shrink: 0;
}

.gallery-thumb:hover,
.gallery-thumb.active {
  opacity: 1;
}

/* Mod Details */
.mod-details {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

.mod-info h3 {
  font-size: 1.375rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.mod-info p {
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1rem;
}

.mod-sidebar {
  background: var(--bg-secondary);
  padding: 1.5rem;
  border-radius: 0.75rem;
}

.sidebar-section {
  margin-bottom: 1.5rem;
}

.sidebar-section:last-child {
  margin-bottom: 0;
}

.sidebar-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
}

.detail-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-primary);
  font-size: 0.875rem;
}

.detail-item:last-child {
  border-bottom: none;
}

.detail-label {
  color: var(--text-secondary);
  font-weight: 500;
}

.detail-value {
  color: var(--text-primary);
  font-weight: 600;
}

/* Requirements */
.requirements-list {
  list-style: none;
  padding: 0;
}

.requirements-list li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-primary);
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.requirements-list li:last-child {
  border-bottom: none;
}

.requirements-list li::before {
  content: "✓";
  color: #10b981;
  font-weight: bold;
  margin-right: 0.5rem;
}

/* Changelog */
.changelog {
  margin: 2rem 0;
}

.changelog h4 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.changelog-item {
  padding: 1rem;
  background: var(--bg-secondary);
  border-radius: 0.5rem;
  margin-bottom: 1rem;
  border-left: 4px solid var(--primary-600);
}

.changelog-version {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.changelog-date {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  margin-bottom: 0.75rem;
}

.changelog-changes {
  list-style: none;
  padding: 0;
}

.changelog-changes li {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
  padding-left: 1rem;
  position: relative;
}

.changelog-changes li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--primary-600);
  font-weight: bold;
}

/* Comments Section */
.comments-section {
  margin: 2rem 0;
  padding: 1.5rem;
  background: var(--bg-secondary);
  border-radius: 0.75rem;
}

.comments-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

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

.sort-comments {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border-primary);
  border-radius: 0.5rem;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 0.875rem;
}

.comment {
  padding: 1rem;
  background: var(--bg-primary);
  border-radius: 0.5rem;
  margin-bottom: 1rem;
  border: 1px solid var(--border-primary);
}

.comment-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.comment-author {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
}

.comment-date {
  font-size: 0.75rem;
  color: var(--text-tertiary);
}

.comment-text {
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 0.75rem;
}

.comment-actions {
  display: flex;
  gap: 1rem;
}

.comment-action {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  color: var(--text-tertiary);
  cursor: pointer;
  transition: color 0.2s ease;
}

.comment-action:hover {
  color: var(--primary-600);
}

/* 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 */
.mod-search {
  margin-bottom: 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-primary);
  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);
}

/* Sort Options */
.sort-section {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.sort-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
}

.sort-select {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border-primary);
  border-radius: 0.5rem;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 0.875rem;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-secondary);
}

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

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

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

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

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

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

  .mod-details {
    grid-template-columns: 1fr;
  }

  .gallery-thumbnails {
    justify-content: center;
  }

  .sort-section {
    flex-direction: column;
    align-items: flex-start;
  }

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

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

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

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

/* Dark Mode Adjustments */
@media (prefers-color-scheme: dark) {
  .download-circle {
    background: rgba(255, 255, 255, 0.1);
  }

  .mod-modal {
    background: var(--bg-primary);
    border-color: var(--border-primary);
  }
}

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

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

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

/* Accessibility Improvements */
@media (prefers-reduced-motion: reduce) {
  .mod-card,
  .filter-btn,
  .toast,
  .load-more-btn,
  .favorite-btn {
    transition: none;
  }
}

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

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

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

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

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

.mod-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%);
  }
}
