/* site.css - ملف الأنماط الموحد لـ PSPKG مع التحديثات الجديدة */

:root {
  --primary-color: #ffffff;
  --primary-dark: #f8f9fa;
  --primary-light: #e9ecef;
  --accent-color: #27ae60; /* الأخضر الجديد */
  --text-color: #000000;
  --bg-light: #fafafa;
  --card-border: #e0e0e0;
  --region-bg: #f0f0f0;
}

/* الوضع الليلي */
body.dark-mode {
  --primary-color: #000000;
  --primary-dark: #111111;
  --primary-light: #1a1a1a;
  --accent-color: #2ecc71;
  --text-color: #ffffff;
  --bg-light: #000000;
  --card-border: #444444;
  --region-bg: #1a1a1a;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Tajawal', sans-serif;
  background: var(--bg-light);
  color: var(--text-color);
  min-height: 100vh;
  text-align: center;
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 12px;
}



/* نافذة الفلتر */
.filter-modal {
  display: none;
  position: absolute;
  top: 100%;
  right: 20px;
  background: var(--primary-color);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
  z-index: 1000;
  min-width: 180px;
}

.filter-modal.show {
  display: block;
}

.filter-modal-content {
  padding: 15px;
  position: relative;
}

.filter-modal-content h3 {
  margin-bottom: 10px;
  font-size: 14px;
  color: var(--text-color);
  border-bottom: 1px solid var(--card-border);
  padding-bottom: 8px;
}

.filter-option {
  display: block;
  width: 100%;
  padding: 8px 12px;
  margin-bottom: 5px;
  background: var(--primary-light);
  border: 1px solid var(--card-border);
  border-radius: 5px;
  color: var(--text-color);
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 13px;
  text-align: left;
}

.filter-option:hover {
  background: var(--accent-color);
  color: white;
  border-color: var(--accent-color);
}

.filter-close {
  position: absolute;
  top: 10px;
  right: 10px;
  background: none;
  border: none;
  color: #666;
  cursor: pointer;
  font-size: 14px;
  padding: 5px;
}

.filter-close:hover {
  color: var(--accent-color);
}

/* ===== الشريط العلوي المتحرك للألعاب المميزة ===== */
.featured-games-bar {
  width: 100%;
  background: var(--primary-dark);
  padding: 10px 0 12px;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--card-border);
}

.featured-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 12px;
}

.featured-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.featured-title {
  font-size: 1.2rem;
  color: var(--accent-color);
  font-weight: 700;
  position: relative;
  display: inline-block;
}

.featured-title::after {
  content: '';
  position: absolute;
  bottom: -5px;
  right: 0;
  width: 50%;
  height: 2px;
  background: var(--accent-color);
  transition: width 0.3s ease;
}

.featured-games {
  display: flex;
  gap: 10px;
  overflow-x: hidden;
  padding: 7px 0;
  scroll-behavior: smooth;
  position: relative;
  mask: linear-gradient(
    90deg,
    transparent,
    white 20%,
    white 80%,
    transparent
  );
}

.featured-games-wrapper {
  display: flex;
  width: max-content;
  animation: scroll-featured 60s linear infinite;
}

@keyframes scroll-featured {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(calc(-160px * 25 - 10px * 25));
  }
}

.featured-games:hover .featured-games-wrapper {
  animation-play-state: paused;
}

.featured-game {
  flex: 0 0 160px;
  background: var(--primary-color);
  border-radius: 7px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  cursor: pointer;
  border: 1px solid var(--card-border);
  text-align: center;
  padding: 10px;
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
  will-change: transform;
  backface-visibility: hidden;
}

.featured-game:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border-color: var(--accent-color);
}

.featured-game img {
  width: 100%;
  height: 170px;
  object-fit: contain;
  border-radius: 4px;
  margin-bottom: 8px;
  flex-shrink: 0;
  display: block;
  transition: opacity 0.3s ease;
}

.featured-game-content {
  padding: 0;
  text-align: center;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.featured-game-title {
  font-size: 12px;
  font-weight: bold;
  color: var(--text-color);
  line-height: 1.4;
  height: 34px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: auto;
}

.featured-game-platform {
  font-size: 0.7rem;
  color: var(--accent-color);
  font-weight: 600;
  background: var(--region-bg);
  padding: 2px 7px;
  border-radius: 10px;
  display: inline-block;
  margin-top: 7px;
}

.featured-game-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 7px;
  font-size: 11px;
  color: #666;
}

.featured-download-count {
  display: flex;
  align-items: center;
  gap: 3px;
}

.featured-rating {
  display: flex;
  align-items: center;
  gap: 2px;
}

.featured-rating i {
  color: #ffc107;
  font-size: 9px;
}

/* ===== أقسام المنصات ===== */
.platform-section {
  margin: 35px 0;
  width: 100%;
}

.platform-header {
  background: transparent;
  color: var(--text-color);
  padding: 12px 0;
  margin-bottom: 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid var(--card-border);
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

.platform-title {
  font-size: 1.3rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--text-color);
}

.view-all-btn {
  background: var(--accent-color);
  color: white;
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 5px;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.view-all-btn:hover {
  background: #219a52;
  transform: translateY(-1px);
  box-shadow: 0 3px 6px rgba(0,0,0,0.1);
}

/* ===== شبكة الألعاب ===== */
.games-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding: 18px 12px;
  max-width: 1400px;
  margin: 0 auto;
}

.game-card {
  background: var(--primary-color);
  border: 1px solid var(--card-border);
  text-align: center;
  padding: 10px;
  border-radius: 5px;
  transition: all 0.2s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
  will-change: transform;
  backface-visibility: hidden;
  transform: translateZ(0);
}

.game-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.08);
  border-color: var(--accent-color);
}

.game-card img {
  width: 100%;
  height: 170px;
  object-fit: contain;
  border-radius: 3px;
  margin-bottom: 8px;
  flex-shrink: 0;
  transition: opacity 0.3s ease;
}

.game-title {
  color: var(--text-color);
  font-weight: bold;
  font-size: 12px;
  line-height: 1.4;
  height: 34px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: auto;
}

/* علامات الترجمة للعربية */
.game-translation {
  position: absolute;
  top: 7px;
  left: 7px;
  background: #28a745;
  color: white;
  font-size: 0.65rem;
  font-weight: bold;
  padding: 2px 5px;
  border-radius: 3px;
  z-index: 2;
}

.game-card.arabic-game::before {
  display: none;
}

.game-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 7px;
  font-size: 11px;
  color: #666;
}

.download-count {
  display: flex;
  align-items: center;
  gap: 3px;
}

.rating {
  display: flex;
  align-items: center;
  gap: 2px;
}

.rating i {
  color: #ffc107;
  font-size: 9px;
}

/* ===== قسم التعليقات ===== */
.comments-section {
  margin: 35px 0;
  width: 100%;
}

.comments-container-full {
  max-width: 1200px;
  margin: 0 auto;
  padding: 25px;
  background: var(--primary-color);
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  border: 1px solid var(--card-border);
}

.comments-title {
  font-size: 1.5rem;
  color: var(--accent-color);
  margin-bottom: 10px;
  font-weight: 700;
}

.comments-description {
  color: #666;
  margin-bottom: 20px;
  font-size: 0.9rem;
}

/* ===== الفوتر ===== */
.footer {
  margin-top: 35px;
  padding: 25px 0;
  color: #666;
  font-size: 0.8rem;
  border-top: 1px solid var(--card-border);
  background: var(--primary-color);
  width: 100%;
}

.footer-social {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 10px;
}

.footer-social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--accent-color);
  font-size: 0.9rem;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.footer-social a::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--accent-color);
  border-radius: 50%;
  transform: scale(0);
  transition: transform 0.3s ease;
}

.footer-social a:hover::before {
  transform: scale(1);
}

.footer-social a i {
  position: relative;
  z-index: 1;
}

.footer-social a:hover i {
  color: white;
}

.footer-social a:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.footer-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
}

.footer-links a {
  color: var(--accent-color);
  text-decoration: none;
  transition: all 0.2s ease;
  font-weight: 500;
  font-size: 0.8rem;
  position: relative;
}

.footer-links a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  right: 0;
  width: 0;
  height: 1px;
  background: var(--accent-color);
  transition: width 0.3s ease;
}

.footer-links a:hover::after {
  width: 100%;
}
  
  /* تعديلات البطاقات للشاشات الصغيرة */
  .games-grid {
    grid-template-columns: repeat(2, 1fr);
    padding: 12px 10px;
    gap: 10px;
  }
  
  .game-card img {
    height: 150px;
  }
  
  .game-info {
    font-size: 10px;
  }
  
  .footer-links {
    gap: 8px;
  }
}

@media (max-width: 480px) {
  .games-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  
  .game-card img {
    height: 140px;
  }
  
  .game-title {
    font-size: 11px;
  }
  
  .header-top-links {
    gap: 8px;
    font-size: 10px;
  }
  
  .category-nav .nav-link {
    padding: 6px 10px;
    font-size: 0.7rem;
  }
  
  .search-input-header {
    width: 120px;
    font-size: 12px;
  }
 

@media (min-width: 768px) {
  .games-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (min-width: 1024px) {
  .container { 
    max-width: 100%; 
  }
  
  .games-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

/* ===== تحسينات للأداء ===== */
.game-card,
.featured-game {
  transform: translateZ(0);
  backface-visibility: hidden;
}

img[loading="lazy"] {
  opacity: 0;
  transition: opacity 0.3s ease;
}

img[loading="lazy"].loaded {
  opacity: 1;
}