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

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  min-height: 100vh;
  color: #fff;
}

#admin-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  background: rgba(255,255,255,0.1);
  border-radius: 15px;
  margin-bottom: 30px;
  backdrop-filter: blur(10px);
}

.admin-header h1 {
  font-size: 1.8rem;
  background: linear-gradient(45deg, #ff6b6b, #feca57);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 15px;
}

#admin-username {
  padding: 8px 15px;
  background: rgba(255,255,255,0.1);
  border-radius: 20px;
  font-weight: 500;
}

#back-btn {
  padding: 10px 20px;
  background: linear-gradient(45deg, #667eea, #764ba2);
  border: none;
  border-radius: 25px;
  color: white;
  cursor: pointer;
  font-size: 1rem;
  transition: transform 0.2s, box-shadow 0.2s;
}

#back-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.admin-section {
  background: rgba(255,255,255,0.05);
  border-radius: 15px;
  padding: 25px;
  margin-bottom: 30px;
  backdrop-filter: blur(10px);
}

.admin-section h2 {
  margin-bottom: 20px;
  font-size: 1.4rem;
  color: #feca57;
}

.search-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.search-bar input {
  flex: 1;
  padding: 12px 20px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 25px;
  color: white;
  font-size: 1rem;
}

.search-bar input::placeholder {
  color: rgba(255,255,255,0.5);
}

.search-bar button {
  padding: 12px 25px;
  background: linear-gradient(45deg, #11998e, #38ef7d);
  border: none;
  border-radius: 25px;
  color: white;
  cursor: pointer;
  font-size: 1rem;
  transition: transform 0.2s;
}

.search-bar button:hover {
  transform: scale(1.05);
}

.users-table-container {
  overflow-x: auto;
}

#users-table {
  width: 100%;
  border-collapse: collapse;
}

#users-table th,
#users-table td {
  padding: 15px;
  text-align: left;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

#users-table th {
  background: rgba(255,255,255,0.1);
  font-weight: 600;
  color: #feca57;
}

#users-table tr:hover {
  background: rgba(255,255,255,0.05);
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255,255,255,0.2);
}

.action-btn {
  padding: 8px 12px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  margin: 2px;
  transition: transform 0.2s, opacity 0.2s;
}

.action-btn:hover {
  transform: scale(1.1);
}

.btn-edit {
  background: linear-gradient(45deg, #667eea, #764ba2);
  color: white;
}

.btn-delete-avatar {
  background: linear-gradient(45deg, #f093fb, #f5576c);
  color: white;
}

.btn-toggle-avatar {
  background: linear-gradient(45deg, #4facfe, #00f2fe);
  color: white;
}

.btn-delete {
  background: linear-gradient(45deg, #ff416c, #ff4b2b);
  color: white;
}

.btn-toggle-avatar.blocked {
  background: linear-gradient(45deg, #636e72, #2d3436);
}

.status-blocked {
  color: #ff6b6b;
  font-weight: bold;
}

.status-allowed {
  color: #38ef7d;
}

/* Scores */
.scores-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.score-game {
  background: rgba(255,255,255,0.05);
  border-radius: 10px;
  padding: 15px;
}

.score-game h3 {
  margin-bottom: 15px;
  color: #feca57;
  font-size: 1.1rem;
}

.scores-list {
  max-height: 300px;
  overflow-y: auto;
}

.score-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
  background: rgba(255,255,255,0.05);
  border-radius: 8px;
  margin-bottom: 8px;
}

.score-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.score-rank {
  width: 25px;
  height: 25px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 0.8rem;
  font-weight: bold;
}

.rank-1 { background: linear-gradient(45deg, #ffd700, #ffec8b); color: #333; }
.rank-2 { background: linear-gradient(45deg, #c0c0c0, #e8e8e8); color: #333; }
.rank-3 { background: linear-gradient(45deg, #cd7f32, #daa520); color: #333; }
.rank-other { background: rgba(255,255,255,0.2); }

.score-username {
  font-weight: 500;
}

.score-value {
  font-weight: bold;
  color: #38ef7d;
}

.score-actions {
  display: flex;
  gap: 5px;
}

.btn-edit-score {
  padding: 5px 10px;
  background: linear-gradient(45deg, #667eea, #764ba2);
  border: none;
  border-radius: 5px;
  color: white;
  cursor: pointer;
  font-size: 0.8rem;
}

.btn-delete-score {
  padding: 5px 10px;
  background: linear-gradient(45deg, #ff416c, #ff4b2b);
  border: none;
  border-radius: 5px;
  color: white;
  cursor: pointer;
  font-size: 0.8rem;
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background: linear-gradient(135deg, #1a1a2e, #16213e);
  padding: 30px;
  border-radius: 15px;
  min-width: 350px;
  border: 1px solid rgba(255,255,255,0.1);
}

.modal-content h3 {
  margin-bottom: 20px;
  color: #feca57;
}

.form-group {
  margin-bottom: 15px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  color: rgba(255,255,255,0.8);
}

.form-group input {
  width: 100%;
  padding: 12px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 8px;
  color: white;
  font-size: 1rem;
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.btn-save, .btn-cancel {
  flex: 1;
  padding: 12px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  transition: transform 0.2s;
}

.btn-save {
  background: linear-gradient(45deg, #11998e, #38ef7d);
  color: white;
}

.btn-cancel {
  background: rgba(255,255,255,0.1);
  color: white;
}

.btn-save:hover, .btn-cancel:hover {
  transform: scale(1.02);
}

/* Responsive */
@media (max-width: 768px) {
  .admin-header {
    flex-direction: column;
    gap: 15px;
    text-align: center;
  }
  
  .search-bar {
    flex-direction: column;
  }
  
  #users-table th:nth-child(4),
  #users-table td:nth-child(4),
  #users-table th:nth-child(5),
  #users-table td:nth-child(5) {
    display: none;
  }
  
  .action-btn {
    padding: 6px 8px;
    font-size: 0.75rem;
  }
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(255,255,255,0.05);
  border-radius: 4px;
}

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

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

/* Whitelist Styles */
.whitelist-controls {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.restriction-toggle {
  background: rgba(255,255,255,0.05);
  padding: 20px;
  border-radius: 10px;
}

.restriction-toggle h3 {
  margin-bottom: 15px;
  color: #feca57;
  font-size: 1.2rem;
}

.toggle-container {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 10px;
}

.switch {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 34px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: .4s;
  border-radius: 34px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 26px;
  width: 26px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: #ff6b6b;
}

input:checked + .slider:before {
  transform: translateX(26px);
}

#restriction-status {
  font-weight: bold;
  font-size: 1.1rem;
}

.info-text {
  color: rgba(255,255,255,0.7);
  font-size: 0.9rem;
  margin-top: 10px;
}

.whitelist-section {
  background: rgba(255,255,255,0.05);
  padding: 20px;
  border-radius: 10px;
}

.whitelist-section h3 {
  margin-bottom: 15px;
  color: #feca57;
  font-size: 1.2rem;
}

.whitelist-add {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

#user-select {
  flex: 1;
  padding: 12px 15px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 8px;
  color: white;
  font-size: 1rem;
  cursor: pointer;
}

#user-select option {
  background: #1a1a2e;
  color: white;
}

.btn-add {
  padding: 12px 25px;
  background: linear-gradient(45deg, #00d2ff, #3a7bd5);
  border: none;
  border-radius: 8px;
  color: white;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.btn-add:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(58, 123, 213, 0.4);
}

.whitelist-users-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 400px;
  overflow-y: auto;
}

.whitelist-user-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px;
  background: rgba(255,255,255,0.08);
  border-radius: 8px;
  transition: background 0.2s;
}

.whitelist-user-item:hover {
  background: rgba(255,255,255,0.12);
}

.whitelist-user-info {
  display: flex;
  flex-direction: column;
}

.whitelist-user-name {
  font-weight: bold;
  font-size: 1.1rem;
  color: #feca57;
}

.whitelist-user-date {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.6);
  margin-top: 3px;
}

.btn-remove-whitelist {
  padding: 8px 15px;
  background: linear-gradient(45deg, #ff6b6b, #ee5a6f);
  border: none;
  border-radius: 6px;
  color: white;
  cursor: pointer;
  transition: transform 0.2s;
}

.btn-remove-whitelist:hover {
  transform: translateY(-2px);
}

.no-whitelist-users {
  text-align: center;
  padding: 30px;
  color: rgba(255,255,255,0.5);
  font-style: italic;
}

/* Geodle Management Styles */
.geodle-management {
  display: flex;
  flex-direction: column;
  gap: 25px;
}

.geodle-form {
  background: rgba(255,255,255,0.05);
  padding: 20px;
  border-radius: 10px;
}

.geodle-form h3 {
  margin-bottom: 15px;
  color: #feca57;
}

.geodle-auto-schedule {
  background: rgba(255,165,0,0.1);
  padding: 20px;
  border-radius: 10px;
  border: 2px dashed rgba(255,165,0,0.3);
}

.geodle-auto-schedule h3 {
  margin-bottom: 10px;
  color: #feca57;
}

.info-text {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.7);
  margin-bottom: 15px;
}

.warning-text {
  font-size: 0.85rem;
  color: #ff9800;
  margin-top: 10px;
  font-style: italic;
}

.btn-auto {
  padding: 12px 25px;
  background: linear-gradient(45deg, #ff9800, #ffa726);
  border: none;
  border-radius: 25px;
  color: white;
  cursor: pointer;
  font-size: 1rem;
  font-weight: bold;
  transition: all 0.3s;
}

.btn-auto:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 20px rgba(255, 152, 0, 0.4);
}

.form-row {
  display: flex;
  gap: 15px;
  margin-bottom: 15px;
}

.form-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-weight: bold;
  font-size: 0.9rem;
}

.form-group input,
.form-group select {
  padding: 10px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 8px;
  color: white;
  font-size: 1rem;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: #feca57;
}

.form-group input[type="time"] {
  cursor: pointer;
}

.form-group input[type="date"] {
  cursor: pointer;
}

.form-group select option {
  background: #1a1a2e;
  color: white;
}

#current-geodle-info {
  padding: 15px;
  background: rgba(0,255,0,0.1);
  border-left: 4px solid #4caf50;
  border-radius: 8px;
  margin-bottom: 15px;
}

#current-geodle-info.no-geodle {
  background: rgba(255,0,0,0.1);
  border-left-color: #f44336;
}

.geodle-list {
  background: rgba(255,255,255,0.05);
  padding: 20px;
  border-radius: 10px;
}

.geodle-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.geodle-list h3 {
  margin: 0;
  color: #feca57;
}

.btn-delete-all {
  padding: 8px 16px;
  background: linear-gradient(45deg, #e74c3c, #c0392b);
  border: 2px solid rgba(255,255,255,0.2);
  border-radius: 8px;
  color: white;
  font-weight: bold;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.3s;
  box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
}

.btn-delete-all:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(231, 76, 60, 0.5);
  background: linear-gradient(45deg, #c0392b, #a93226);
}

#geodles-table-container {
  max-height: 400px;
  overflow-y: auto;
}

#geodles-table {
  width: 100%;
  border-collapse: collapse;
}

#geodles-table thead th {
  background: rgba(0,0,0,0.3);
  padding: 12px;
  color: white;
  text-align: left;
  position: sticky;
  top: 0;
  z-index: 10;
}

#geodles-table tbody td {
  padding: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  color: white;
}

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

.btn-delete-geodle {
  padding: 6px 12px;
  background: linear-gradient(45deg, #ff6b6b, #ee5a6f);
  border: none;
  border-radius: 6px;
  color: white;
  cursor: pointer;
  font-size: 0.85rem;
  transition: transform 0.2s;
}

.btn-delete-geodle:hover {
  transform: translateY(-2px);
}

.btn-edit-geodle {
  padding: 4px 8px;
  margin-left: 8px;
  background: linear-gradient(45deg, #3498db, #2980b9);
  border: none;
  border-radius: 4px;
  color: white;
  cursor: pointer;
  font-size: 0.85rem;
  transition: transform 0.2s;
}

.btn-edit-geodle:hover {
  transform: translateY(-2px);
}

.btn-save-geodle {
  padding: 4px 8px;
  margin-left: 8px;
  background: linear-gradient(45deg, #2ecc71, #27ae60);
  border: none;
  border-radius: 4px;
  color: white;
  cursor: pointer;
  font-size: 0.85rem;
  transition: transform 0.2s;
}

.btn-save-geodle:hover {
  transform: translateY(-2px);
}

.btn-cancel-geodle {
  padding: 4px 8px;
  background: linear-gradient(45deg, #95a5a6, #7f8c8d);
  border: none;
  border-radius: 4px;
  color: white;
  cursor: pointer;
  font-size: 0.85rem;
  transition: transform 0.2s;
}

.btn-cancel-geodle:hover {
  transform: translateY(-2px);
}

.geodle-person-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}

.geodle-person-edit {
  padding: 6px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 6px;
  color: white;
  font-size: 0.9rem;
  min-width: 200px;
}

.geodle-person-edit option {
  background: #1a1a2e;
  color: white;
}

/* ===== GESTION DES JEUX ===== */
.games-management {
  width: 100%;
}

.games-status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.game-status-card {
  background: rgba(255,255,255,0.05);
  border-radius: 12px;
  padding: 20px;
  border: 1px solid rgba(255,255,255,0.1);
  transition: transform 0.2s, box-shadow 0.2s;
}

.game-status-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 20px rgba(0,0,0,0.3);
}

.game-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  padding-bottom: 15px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.game-header h4 {
  font-size: 1.1rem;
  color: #feca57;
  margin: 0;
}

.game-status {
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
}

.game-status.available {
  background: rgba(46, 204, 113, 0.2);
  color: #2ecc71;
  border: 1px solid rgba(46, 204, 113, 0.5);
}

.game-status.pending {
  background: rgba(241, 196, 15, 0.2);
  color: #f1c40f;
  border: 1px solid rgba(241, 196, 15, 0.5);
}

.game-status.hidden {
  background: rgba(231, 76, 60, 0.2);
  color: #e74c3c;
  border: 1px solid rgba(231, 76, 60, 0.5);
}

.release-date {
  margin-bottom: 15px;
  padding: 10px;
  background: rgba(241, 196, 15, 0.1);
  border-left: 3px solid #f1c40f;
  border-radius: 5px;
  font-size: 0.9rem;
  color: #f1c40f;
}

.game-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.status-select {
  width: 100%;
  padding: 10px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 8px;
  color: white;
  font-size: 0.95rem;
  cursor: pointer;
}

.status-select option {
  background: #1a1a2e;
  color: white;
  padding: 10px;
}

.release-date-input {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.release-date-input input[type="datetime-local"] {
  flex: 1;
  padding: 10px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 8px;
  color: white;
  font-size: 0.95rem;
}

.release-date-input input[type="datetime-local"]::-webkit-calendar-picker-indicator {
  filter: invert(1);
  cursor: pointer;
}

.btn-save {
  width: 100%;
  padding: 10px 20px;
  background: linear-gradient(45deg, #2ecc71, #27ae60);
  border: none;
  border-radius: 8px;
  color: white;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  transition: transform 0.2s, box-shadow 0.2s;
}

.btn-save:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(46, 204, 113, 0.4);
}
