/* === RESET & BASE STYLES === */
*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --primary-color: #27a849;;
  --primary-dark: #27a849;
  --secondary-color: #60a5fa;
  --bg-dark: #0B1317;
  --bg-card: #121a22;
  --border-color: rgba(255, 255, 255, 0.1);
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  background-color: var(--bg-dark);
  color: white;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

body::-webkit-scrollbar {
  width: 8px;
}

body::-webkit-scrollbar-track {
  background: transparent;
}

body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

body::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

h1,
h2,
h3 {
  margin: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
}

/* === LANDING PAGE STYLES === */

.landing-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 40px;
  background: rgba(11, 19, 23, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
}

.landing-nav-logo {
  font-size: 28px;
  font-weight: bold;
  color: white;
  letter-spacing: 2px;
}

.landing-nav-links {
  display: flex;
  gap: 30px;
  align-items: center;
}

.landing-nav-links a {
  color: rgba(255, 255, 255, 0.8);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: color 0.3s ease;
}

.landing-nav-links a:hover {
  color: white;
}

.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--bg-dark) 0%, #1a2530 100%);
  padding: 40px 20px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 20% 50%, rgba(52, 211, 153, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(96, 165, 250, 0.1) 0%, transparent 50%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 800px;
  text-align: center;
}

.hero h1 {
  font-size: clamp(32px, 8vw, 72px);
  font-weight: bold;
  margin-bottom: 20px;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: clamp(16px, 4vw, 24px);
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 40px;
  line-height: 1.6;
}

.hero-buttons {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 60px;
}

.btn-download {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  color: white;
  padding: 16px 48px;
  font-size: 16px;
  font-weight: bold;
  border-radius: 50px;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
  box-shadow: 0 10px 30px rgba(52, 211, 153, 0.3);
}

.btn-download:hover {
  transform: translateY(-3px);
  box-shadow: 0 15px 40px rgba(52, 211, 153, 0.5);
}

.btn-catalog {
  background: transparent;
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.3);
  padding: 14px 46px;
  font-size: 16px;
  font-weight: bold;
  border-radius: 50px;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.btn-catalog:hover {
  border-color: white;
  color: white;
  transform: translateY(-3px);
}

.features-section {
  padding: 100px 40px;
  background: var(--bg-dark);
}

.features-header {
  text-align: center;
  margin-bottom: 80px;
}

.features-header h2 {
  font-size: 48px;
  font-weight: bold;
  margin-bottom: 15px;
}

.features-header p {
  font-size: 18px;
  color: rgba(255, 255, 255, 0.6);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 40px;
  max-width: 1200px;
  margin: 0 auto;
}

.feature-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 40px;
  text-align: center;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.feature-card:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(52, 211, 153, 0.5);
  transform: translateY(-10px);
}

.feature-icon {
  font-size: 48px;
  margin-bottom: 20px;
  display: inline-block;
}

.feature-card h3 {
  font-size: 20px;
  font-weight: bold;
  margin-bottom: 12px;
}

.feature-card p {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.6;
}

.stats-section {
  padding: 80px 40px;
  background: linear-gradient(135deg, rgba(52, 211, 153, 0.1), rgba(96, 165, 250, 0.1));
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 40px;
  max-width: 1000px;
  margin: 0 auto;
  text-align: center;
}

.stat-item h3 {
  font-size: 48px;
  font-weight: bold;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 10px;
}

.stat-item p {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.6);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.cta-section {
  padding: 80px 40px;
  background: var(--bg-dark);
  text-align: center;
}

.cta-content {
  max-width: 600px;
  margin: 0 auto;
}

.cta-content h2 {
  font-size: 44px;
  font-weight: bold;
  margin-bottom: 20px;
}

.cta-content p {
  font-size: 18px;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 40px;
  line-height: 1.6;
}

.footer {
  background: rgba(0, 0, 0, 0.3);
  padding: 40px;
  text-align: center;
  border-top: 1px solid var(--border-color);
  color: rgba(255, 255, 255, 0.5);
  font-size: 14px;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 30px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.5);
  transition: color 0.3s ease;
}

.footer-links a:hover {
  color: white;
}

/* === CATALOG STYLES === */

.catalog-wrapper {
  min-height: 100vh;
  background: var(--bg-dark);
}

.catalog-header {
  background: rgba(11, 19, 23, 0.95);
  backdrop-filter: blur(10px);
  padding: 20px 40px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.catalog-header-content {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.catalog-logo {
  font-size: 24px;
  font-weight: bold;
  cursor: pointer;
  color: #27a849;
  letter-spacing: 2px;
  transition: opacity 0.3s ease;
}

.catalog-logo:hover {
  opacity: 0.8;
}

.catalog-header-nav {
  display: flex;
  gap: 20px;
  align-items: center;
}

.catalog-header-nav a {
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
  transition: color 0.3s ease;
}

.catalog-header-nav a:hover {
  color: white;
}

.catalog-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 40px;
}

.catalog-title {
  font-size: 36px;
  font-weight: bold;
  margin-bottom: 30px;
  color: #27a849;
}

.filter-section {
  display: flex;
  gap: 20px;
  margin-bottom: 40px;
  flex-wrap: wrap;
  align-items: center;
}

.search-box {
  flex: 1;
  min-width: 250px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  padding: 12px 16px;
  border-radius: 8px;
  color: white;
  font-size: 14px;
}

.search-box::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.search-box:focus {
  outline: none;
  border-color: rgba(52, 211, 153, 0.5);
  background: rgba(255, 255, 255, 0.08);
}

.sort-dropdown {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  padding: 10px 16px;
  border-radius: 8px;
  color: white;
  font-size: 14px;
}

.sort-dropdown:focus {
  outline: none;
  border-color: rgba(52, 211, 153, 0.5);
}

.loading-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 400px;
  text-align: center;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.game-card {
  background: #1a2530;
  border-radius: 14px;
  overflow: hidden;
  cursor: default;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  border: 1px solid rgba(255, 255, 255, 0.08);
  position: relative;
  display: flex;
  flex-direction: column;
}

.game-card:hover {
  transform: translateY(-10px) scale(1.02);
  border-color: var(--primary-color);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6),
    0 0 20px rgba(52, 211, 153, 0.1);
}

.game-card-image {
  width: 100%;
  aspect-ratio: 1 / 1.4;
  /* Aspect ratio plus élancé */
  background: #0f172a;
  overflow: hidden;
  position: relative;
}

.game-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease, filter 0.3s ease;
  display: block;
}

.game-card:hover .game-card-image img {
  transform: scale(1.1);
  filter: brightness(1.1);
}

.game-card-image.loading {
  background: linear-gradient(90deg, #1e293b 25%, #334155 50%, #1e293b 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite linear;
}

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }

  100% {
    background-position: 200% 0;
  }
}

.game-card-info {
  padding: 15px;
  background: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.3));
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.game-card-title {
  font-size: 14px;
  font-weight: 700;
  color: #f8fafc;
  line-height: 1.4;
  height: 2.8em;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  transition: color 0.3s ease;
}

.game-card:hover .game-card-title {
  color: var(--primary-color);
}

.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}

.modal.active {
  display: flex;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.modal-content {
  background: var(--bg-card);
  border-radius: 16px;
  width: 90%;
  max-width: 700px;
  max-height: 90vh;
  overflow-y: auto;
  border: 1px solid var(--border-color);
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    transform: translateY(50px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-header {
  padding: 30px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 {
  margin: 0;
  font-size: 24px;
}

.modal-close {
  background: none;
  border: none;
  color: white;
  font-size: 28px;
  transition: color 0.3s ease;
}

.modal-close:hover {
  color: var(--primary-color);
}

.modal-body {
  padding: 30px;
}

.modal-game-header {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
}

.modal-game-image {
  width: 150px;
  height: 200px;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.05);
  flex-shrink: 0;
}

.modal-game-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.modal-game-info h2 {
  font-size: 24px;
  margin-bottom: 10px;
}

.modal-game-dev {
  color: rgba(255, 255, 255, 0.6);
  font-size: 14px;
  margin-bottom: 15px;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 15px;
}

.tag {
  background: rgba(52, 211, 153, 0.2);
  color: var(--primary-color);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
}

.modal-description {
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.6;
  margin-bottom: 20px;
  font-size: 14px;
}

.modal-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-modal {
  flex: 1;
  min-width: 150px;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: bold;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.btn-primary-modal {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  color: white;
}

.btn-primary-modal:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(52, 211, 153, 0.3);
}

.btn-secondary-modal {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary-modal:hover {
  background: rgba(255, 255, 255, 0.15);
}

.no-results {
  text-align: center;
  padding: 60px 20px;
  color: rgba(255, 255, 255, 0.5);
}

.no-results h3 {
  font-size: 20px;
  margin-bottom: 10px;
}

.pagination {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 40px 0;
  flex-wrap: wrap;
}

.pagination button {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: white;
  padding: 10px 16px;
  border-radius: 6px;
  transition: all 0.3s ease;
}

.pagination button:hover {
  background: rgba(255, 255, 255, 0.1);
}

.pagination button.active {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  border-color: var(--primary-color);
}

.pagination button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* === RESPONSIVE === */

@media (max-width: 768px) {
  .landing-nav {
    padding: 15px 20px;
  }

  .landing-nav-links {
    gap: 15px;
  }

  .hero-buttons {
    flex-direction: column;
    align-items: stretch;
  }

  .btn-download,
  .btn-catalog {
    width: 100%;
  }

  .features-section {
    padding: 60px 20px;
  }

  .features-header {
    margin-bottom: 40px;
  }

  .features-header h2 {
    font-size: 32px;
  }

  .stats-section {
    padding: 60px 20px;
  }

  .stat-item h3 {
    font-size: 32px;
  }

  .cta-section {
    padding: 60px 20px;
  }

  .cta-content h2 {
    font-size: 28px;
  }

  .catalog-container {
    padding: 20px;
  }

  .catalog-title {
    font-size: 24px;
  }

  .filter-section {
    flex-direction: column;
  }

  .search-box {
    min-width: 100%;
  }

  .games-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
  }

  .modal-game-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .modal-game-image {
    width: 120px;
    height: 160px;
  }

  .modal-actions {
    flex-direction: column;
  }

  .btn-modal {
    width: 100%;
  }
}