:root {
  --primary-color: #d4af37; /* Gold */
  --secondary-color: #f8f9fa; /* Light grey */
  --bg-gradient-1: #ffffff;
  --bg-gradient-2: #f4f4f9;
  --bg-gradient-3: #eaeaea;
  --text-primary: #111827;
  --text-secondary: #6b7280;
  --glass-bg: #ffffff;
  --glass-border: rgba(0, 0, 0, 0.08);
  --danger: #dc2626;
  --success: #16a34a;
}

body {
  margin: 0;
  font-family: 'Tajawal', 'Inter', 'Outfit', sans-serif;
  background: linear-gradient(135deg, var(--bg-gradient-1), var(--bg-gradient-2), var(--bg-gradient-3));
  background-attachment: fixed;
  color: var(--text-primary);
  min-height: 100vh;
}

* {
  box-sizing: border-box;
}

a {
  color: var(--primary-color);
  text-decoration: none;
}

h1, h2, h3, h4 {
  margin-top: 0;
}

.glass-panel {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.glass-panel:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.45);
}

.container {
  width: 96%;
  max-width: 1600px;
  margin: 0 auto;
  padding: 10px;
}

/* Custom inputs */
input, select, textarea {
  width: 100%;
  padding: 12px 16px;
  margin: 8px 0 16px;
  border-radius: 8px;
  border: 1px solid #d1d5db;
  background: #fff;
  color: #111827;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  outline: none;
  transition: border 0.3s ease, box-shadow 0.3s ease;
}

input:focus, select:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.2);
}

/* Select2 Customization to match normal inputs */
.select2-container--default .select2-selection--single {
  height: auto !important;
  padding: 10px 16px !important;
  border-radius: 8px !important;
  border: 1px solid #d1d5db !important;
  background: #fff !important;
  color: #111827 !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  display: flex !important;
  align-items: center !important;
  outline: none !important;
}

.select2-container--default.select2-container--open .select2-selection--single {
  border-color: var(--primary-color) !important;
  box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.2) !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 100% !important;
  top: 0 !important;
  right: auto !important;
  left: 10px !important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
  line-height: normal !important;
  padding-right: 0 !important;
  padding-left: 20px !important;
  color: #111827 !important;
  white-space: nowrap !important;
  width: auto !important;
}

.select2-results__option {
  white-space: nowrap !important;
}

/* Custom button */
button {
  background: linear-gradient(90deg, #d4af37, #f3e5ab);
  color: #000;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
}

button:hover {
  transform: scale(1.05);
  box-shadow: 0 0 15px rgba(212, 175, 55, 0.5);
}

button.danger {
  background: linear-gradient(90deg, #ef4444, #f87171);
  color: #fff;
}

button.btn-blue {
  background: linear-gradient(90deg, #3b82f6, #2563eb);
  color: #fff;
}

.nav-btn {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
  border: none;
  border-radius: 10px;
  font-weight: 800;
  font-size: clamp(11px, 1vw, 14.5px);
  padding: clamp(6px, 0.8vw, 10px) clamp(10px, 1.2vw, 16px);
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.35);
  text-transform: none;
  letter-spacing: normal;
  white-space: nowrap;
}

.nav-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(239, 68, 68, 0.5);
}

.nav-action-btn {
  padding: clamp(6px, 0.8vw, 10px) clamp(10px, 1.2vw, 16px);
  border-radius: 10px;
  border: none;
  font-weight: 800;
  font-size: clamp(11px, 1vw, 14.5px);
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
}
.nav-action-btn:hover {
  transform: translateY(-2px);
}
.primary-action {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: white;
  box-shadow: 0 4px 10px rgba(59, 130, 246, 0.3);
}
.primary-action:hover {
  box-shadow: 0 6px 15px rgba(59, 130, 246, 0.5);
}
.danger-action {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
  box-shadow: 0 4px 10px rgba(239, 68, 68, 0.3);
}
.danger-action:hover {
  box-shadow: 0 6px 15px rgba(239, 68, 68, 0.5);
}
.success-action {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  padding: clamp(6px, 0.8vw, 10px) clamp(14px, 1.5vw, 24px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
}
.success-action:hover {
  box-shadow: 0 6px 15px rgba(16, 185, 129, 0.5);
}

/* Adjustments for English ONLY (Single Line) */
html[lang="en"] .nav-btn,
html[lang="en"] .nav-action-btn {
  font-size: clamp(10px, 0.85vw, 12.5px);
  padding: clamp(5px, 0.6vw, 8px) clamp(8px, 1vw, 12px);
}
html[lang="en"] .success-action {
  padding: clamp(5px, 0.6vw, 8px) clamp(10px, 1.2vw, 16px);
}
html[lang="en"] #nav-links,
html[lang="en"] #nav-actions {
  gap: 5px !important;
  justify-content: center;
}

/* Adjustments for French ONLY (Two Lines) */
html[lang="fr"] #main-navbar {
  flex-wrap: wrap !important;
  justify-content: center !important;
  gap: 15px !important;
  padding: 15px 30px !important;
}
html[lang="fr"] #nav-links {
  flex-wrap: wrap !important;
  justify-content: center !important;
  gap: 10px !important;
}
html[lang="fr"] #nav-actions {
  flex-wrap: wrap !important;
  justify-content: center !important;
  gap: 10px !important;
}
html[lang="fr"] .nav-btn,
html[lang="fr"] .nav-action-btn {
  font-size: 13px !important;
  padding: 8px 12px !important;
}
html[lang="fr"] .success-action {
  padding: 8px 16px !important;
}

.nav-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  margin-bottom: 25px;
  border-bottom: 1px solid var(--glass-border);
}
.nav-bar::-webkit-scrollbar {
  display: none;
}
.nav-bar {
  -ms-overflow-style: none;  /* IE and Edge */
  scrollbar-width: none;  /* Firefox */
}

.logo-container {
  padding: 10px 24px;
  background: linear-gradient(90deg, #2563eb, #1d4ed8);
  border: none;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
  transition: all 0.3s ease;
  display: inline-block;
}

.logo-container:hover {
  transform: translateY(-3px);
  background: linear-gradient(90deg, #1d4ed8, #1e40af);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.3);
}

.nav-bar h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  background: none;
  -webkit-text-fill-color: #fff;
  color: #fff;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
  transition: all 0.3s ease;
}

.nav-links {
  display: flex;
  gap: 20px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.players-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 30px;
}

@media (max-width: 1200px) {
  .players-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 900px) {
  .players-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .players-grid {
    grid-template-columns: 1fr;
  }
}

.player-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.player-img {
  width: 150px;
  height: 150px;
  border-radius: 16px;
  object-fit: cover;
  border: 4px solid var(--primary-color);
  margin-bottom: 15px;
  box-shadow: 0 8px 16px rgba(0,0,0,0.3);
}

.player-points {
  font-size: 24px;
  font-weight: bold;
  color: var(--primary-color);
  margin: 10px 0;
}

.player-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  font-size: 14px;
  color: var(--text-secondary);
}

.badge {
  background: rgba(255, 255, 255, 0.1);
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.rank-badge {
  position: absolute;
  top: 15px;
  left: 15px;
  background: var(--primary-color);
  color: #000;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-weight: bold;
  font-size: 18px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.filters-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  margin-bottom: 30px;
}

.filters-bar select, .filters-bar input {
  flex: 1;
  min-width: 150px;
  margin: 0;
}

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

.pagination button {
  padding: 8px 16px;
}

.pagination button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* RTL Support */
body {
  direction: rtl;
}

.rank-badge {
  left: auto;
  right: 15px;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Table Styles */
.ranking-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
}

.ranking-table th, .ranking-table td {
  padding: 15px;
  text-align: center;
  border-bottom: 1px solid #e5e7eb;
  white-space: nowrap;
}

.ranking-table th {
  background: #f3f4f6;
  color: #111827;
  font-weight: 600;
}

.ranking-table tr:hover {
  background: #fdfdfd;
}

.ranking-table tbody tr:hover {
  background: rgba(255,255,255,0.05);
}

/* --- Admin Layout --- */
.admin-layout {
  width: 100vw;
  min-height: 100vh;
  background: #f8fafc;
  padding: 0;
  margin: 0;
  overflow-x: hidden;
}

.admin-header {
  width: 100%;
  background: linear-gradient(90deg, #1e293b, #0f172a);
  color: #fff;
  padding: 15px 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  margin-bottom: 25px;
}

.admin-header h1 {
  margin: 0;
  font-size: 24px;
  color: #d4af37;
  font-weight: 800;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.admin-header-actions {
  display: flex;
  gap: 15px;
}

.admin-header-actions button {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff;
}

.admin-header-actions button:hover {
  background: rgba(255,255,255,0.2);
  transform: translateY(-2px);
}

.admin-content {
  width: 98%;
  max-width: 1800px;
  margin: 0 auto;
  padding: 10px;
}
/* Pagination Styles */
.pagination-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  margin: 20px 0;
  padding: 15px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.pagination-btn {
  background: linear-gradient(90deg, #d4af37, #f3e5ab);
  color: #000;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 10px rgba(212, 175, 55, 0.3);
}

.pagination-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(212, 175, 55, 0.5);
}

.pagination-btn:disabled {
  background: #e5e7eb;
  color: #9ca3af;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.pagination-info {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-primary);
  background: rgba(212, 175, 55, 0.1);
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px solid rgba(212, 175, 55, 0.3);
}
.page-numbers-group {
  display: flex;
  gap: 8px;
  align-items: center;
}

.page-number-btn {
  background: #fff;
  border: 1px solid #d1d5db;
  color: #374151;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
}

.page-number-btn:hover:not(.dots):not(.active) {
  background: #f3f4f6;
  border-color: var(--primary-color);
  color: var(--primary-color);
  transform: translateY(-2px);
}

.page-number-btn.active {
  background: linear-gradient(135deg, var(--primary-color), #f3e5ab);
  color: #000;
  border-color: var(--primary-color);
  box-shadow: 0 4px 10px rgba(212, 175, 55, 0.4);
  transform: scale(1.1);
}


.page-number-btn.dots {
  background: transparent;
  border: none;
  cursor: default;
  color: #9ca3af;
  font-size: 18px;
  box-shadow: none;
}

/* Pagination Styles */
.pagination-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  margin: 20px 0;
  padding: 15px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.pagination-btn {
  background: linear-gradient(90deg, #d4af37, #f3e5ab);
  color: #000;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 10px rgba(212, 175, 55, 0.3);
}

.pagination-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(212, 175, 55, 0.5);
}

.pagination-btn:disabled {
  background: #e5e7eb;
  color: #9ca3af;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.pagination-info {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-primary);
  background: rgba(212, 175, 55, 0.1);
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px solid rgba(212, 175, 55, 0.3);
}

.page-numbers-group {
  display: flex;
  gap: 8px;
  align-items: center;
}

.page-number-btn {
  background: #fff;
  border: 1px solid #d1d5db;
  color: #374151;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
}

.page-number-btn:hover:not(.dots):not(.active) {
  background: #f3f4f6;
  border-color: var(--primary-color);
  color: var(--primary-color);
  transform: translateY(-2px);
}

.page-number-btn.active {
  background: linear-gradient(135deg, var(--primary-color), #f3e5ab);
  color: #000;
  border-color: var(--primary-color);
  box-shadow: 0 4px 10px rgba(212, 175, 55, 0.4);
  transform: scale(1.1);
}

.page-number-btn.dots {
  background: transparent;
  border: none;
  cursor: default;
  color: #9ca3af;
  font-size: 18px;
  box-shadow: none;
}

/* Footer Styles */
.elegant-footer-centered {
  width: 100%;
  background: transparent;
  padding: 30px 20px;
  margin-top: auto;
  display: flex;
  justify-content: center;
  align-items: center;
  border-top: 1px solid rgba(212, 175, 55, 0.2);
}

.centered-footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
}

.centered-footer-content .footer-brand {
  font-family: 'Outfit', sans-serif;
  font-size: 32px;
  font-weight: 900;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--text-primary);
  margin: 0;
  background: linear-gradient(90deg, #111827, #374151);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.footer-credits-centered {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  color: var(--text-secondary);
}

.footer-credits-centered span {
  letter-spacing: 3px;
  font-weight: 900;
  font-size: 18px;
  color: #374151;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  justify-content: center;
}

.footer-credits-centered span::before,
.footer-credits-centered span::after {
  content: '—';
  margin: 0 10px;
  color: var(--primary-color);
  font-weight: 700;
}

.footer-credits-centered strong {
  font-size: 24px;
  font-weight: 800;
  background: linear-gradient(90deg, #d4af37, #b8860b, #d4af37);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gold-shine 3s linear infinite;
}

@keyframes gold-shine {
  to { background-position: 200% center; }
}

/* Responsive Styles */
.table-responsive { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; display: block; border-radius: 8px; }
@media (max-width: 768px) {
  .grid { grid-template-columns: 1fr !important; }
  .filter-bar { flex-direction: column !important; align-items: stretch !important; gap: 10px !important; }
  .filter-bar > * { width: 100% !important; margin: 0 !important; }
  .nav-buttons { flex-direction: column !important; width: 100%; }
  .nav-buttons a { width: 100%; display: block; margin-bottom: 5px; }
  .nav-buttons button { width: 100%; }
  header .container { flex-direction: column; text-align: center; }
  header .container > div { width: 100%; justify-content: center; margin-bottom: 10px; }
  .glass-panel { padding: 15px; }
  h1, h2 { font-size: 1.5rem !important; }
  .player-header { flex-direction: column !important; text-align: center; }
  .player-header img { width: 120px !important; height: 120px !important; margin: 0 auto 15px !important; }
  .player-header > div { width: 100%; align-items: center; justify-content: center; text-align: center; }
  .stats-grid { grid-template-columns: 1fr 1fr !important; }
  .info-grid { grid-template-columns: 1fr !important; }
  .form-group, .select2-container { width: 100% !important; }
  body { padding-bottom: 20px; }
}
