/* Base */
body {
  margin: 0;
  font-family: 'Orbitron', 'Segoe UI', sans-serif;
  background: #0d0d0d;
  color: #fff;
  text-align: center;
  padding-top: 60px; /* Pour compenser la nav fixe */
}

html {
  scroll-behavior: smooth;
}

h2 {
  color: #ff4444;
  margin-bottom: 20px;
}

ul {
  list-style: none;
  padding: 0;
}

li {
  margin: 10px 0;
  font-size: 1.1em;
}

/* Header */
header {
  background: linear-gradient(180deg, #1a1a1a, #0d0d0d);
  padding: 40px 20px;
  animation: fadeInUp 0.6s ease forwards;
  animation-delay: 0.2s;
}

.logo {
  width: 120px;
  margin-bottom: 20px;
  transition: transform 0.3s ease;
  animation: fadeInUp 0.8s ease forwards;
  animation-delay: 0.5s;
}

.logo:hover {
  transform: scale(1.05);
}

header h1 {
  font-size: 3em;
  margin: 0;
  color: #e60000;
}

header p {
  font-size: 1.2em;
  color: #ccc;
}

header nav a {
  margin: 0 10px;
  color: #ff4444;
  text-decoration: none;
  font-weight: bold;
  transition: color 0.3s ease;
}

header nav a:hover {
  color: #fff;
}

/* Main nav */
.main-nav {
  position: fixed;
  top: 0;
  width: 100%;
  background: #111;
  z-index: 1000;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.main-nav ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  padding: 10px 0;
  margin: 0;
  gap: 10px;
}

.main-nav li {
  margin: 0;
  flex: 1 1 auto;
  text-align: center;
  min-width: 80px;
}

.main-nav a {
  display: inline-block;
  padding: 8px 12px;
  font-size: clamp(12px, 2vw, 16px);
  color: #fff;
  text-decoration: none;
  font-weight: bold;
  transition: color 0.3s, border-bottom 0.3s;
  white-space: nowrap;
}

.main-nav a:hover {
  color: #ff4444;
}

.main-nav a.active {
  color: #ff4c4c;
  border-bottom: 2px solid #ff4c4c;
}

/* Sections */
section {
  padding: 60px 20px;
  border-top: 1px solid #333;
  animation: fadeInUp 0.6s ease forwards;
  animation-delay: 0.2s;
}

/* Titles */
#players h3 {
  margin-top: 60px;
  margin-bottom: 20px;
  font-size: 1.8em;
  color: #ff4444;
}

/* Button */
.btn {
  display: inline-block;
  margin-top: 15px;
  padding: 12px 24px;
  background: #e60000;
  color: #fff;
  text-decoration: none;
  border-radius: 8px;
  transition: transform 0.2s ease, background 0.3s ease;
}

.btn:hover {
  background: #a50000;
  transform: scale(1.05);
}

/* Footer */
footer {
  padding: 20px;
  background: #111;
  color: #666;
  font-size: 0.9em;
  animation: fadeInUp 0.6s ease forwards;
  animation-delay: 0.2s;
}

/* Table Search Input */
#achievements input[type="text"] {
  padding: 10px;
  width: 80%;
  max-width: 400px;
  margin: 20px auto;
  border: none;
  border-radius: 8px;
  font-size: 1em;
  display: block;
  text-align: center;
}

/* Table Styling */
#achievementsTable {
  width: 100%;
  margin: 20px auto 0 auto;
  border-collapse: collapse;
  background-color: #1a1a1a;
  table-layout: fixed;
  word-wrap: break-word;
}

#achievementsTable thead {
  background-color: #222;
}

#achievementsTable th,
#achievementsTable td {
  padding: 12px;
  border: 1px solid #444;
  text-align: center;
  font-size: clamp(10px, 2.5vw, 14px);
}

#achievementsTable tbody tr:nth-child(even) {
  background-color: #2b2b2b;
}

/* Table Row Animation */
#achievementsTable tbody tr {
  opacity: 0;
  transform: translateY(10px);
  animation: fadeInRow 0.5s ease forwards;
}

#achievementsTable tbody tr:nth-child(n) {
  animation-delay: calc(0.05s * var(--i));
}

#achievementsTable td a {
  color: #ff4444;
  text-decoration: none;
  font-weight: bold;
}

#achievementsTable td a:hover {
  color: #fff;
}

@keyframes fadeInRow {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Table Controls */
.table-controls {
  margin-top: 20px;
  text-align: center;
  color: #ccc;
}

.table-controls select {
  padding: 5px 10px;
  margin: 0 5px;
  border-radius: 5px;
  background-color: #222;
  color: #fff;
  border: 1px solid #555;
}

/* Pagination */
.pagination {
  margin-top: 20px;
  text-align: center;
  flex-wrap: wrap;
}

.pagination button {
  background-color: #333;
  color: white;
  border: none;
  margin: 4px 3px;
  padding: 8px 12px;
  border-radius: 5px;
  cursor: pointer;
  font-size: clamp(10px, 2.5vw, 14px);
}

.pagination button.active {
  background-color: #e60000;
}

.pagination button:hover {
  background-color: #555;
}

/* Responsive Fixes */
@media (max-width: 600px) {
  #achievementsTable th,
  #achievementsTable td {
    padding: 6px;
    font-size: 11px;
  }

  #achievementsTable {
    width: 100%;
    font-size: 12px;
  }

  .table-controls select {
    font-size: 12px;
  }
}

/* Fade-In General Animation */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.6s ease forwards;
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Table Column Widths */
#achievementsTable th:nth-child(1),
#achievementsTable td:nth-child(1) {
  width: 50%;
}

#achievementsTable th:nth-child(2),
#achievementsTable td:nth-child(2) {
  width: 25%;
}

#achievementsTable th:nth-child(3),
#achievementsTable td:nth-child(3) {
  width: 10%;
}

#achievementsTable th:nth-child(4),
#achievementsTable td:nth-child(4) {
  width: 15%;
}


/* Loading Screen */
#loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #0d0d0d;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  z-index: 9999;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

#loading-screen.fade-out {
  opacity: 0;
  visibility: hidden;
}

.loading-content img {
  width: 120px;
  height: 120px;
  animation: pulse 2s infinite;
}

.loading-content p {
  color: #fff;
  margin-top: 20px;
  font-size: 1.2em;
  font-family: 'Orbitron', sans-serif;
  letter-spacing: 2px;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.1); opacity: 0.7; }
}

/* Cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-top: 20px;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

.card {
  background-color: #1a1a1a;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid #333;
  text-align: center;
  transition: transform 0.3s ease;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.6s ease forwards;
}

.card:hover {
  transform: scale(1.03);
  background-color: #222;
}

.card img {
  width: 100%;
  height: auto;
  display: block;
}

.card div {
  padding: 10px;
  color: white;
}

.card .role {
  color: #ff6666;
  font-size: 0.9em;
}

.social-links a,
.social-links a:visited,
.social-links a:active {
  color: #ff4444;
  text-decoration: none;
  font-weight: bold;
  transition: color 0.3s ease;
}

.social-links a:hover {
  color: #fff;
}

.social-links {
  margin-top: 15px;
}

.modal {
  display: none;
  position: fixed;
  z-index: 9999;
  padding-top: 60px;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0,0,0,0.9);
}

.modal-content {
  display: block;
  margin: auto;
  max-width: 90%;
  max-height: 80vh;
  border-radius: 8px;
  animation: zoom 0.3s ease-in-out;
}

@keyframes zoom {
  from {transform: scale(0.8); opacity: 0;}
  to {transform: scale(1); opacity: 1;}
}

.close {
  position: absolute;
  top: 20px;
  right: 35px;
  color: #fff;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
  transition: color 0.3s;
}

.close:hover {
  color: #ff4444;
}
