/* Admin Styles */

/* Login Page */
.admin-login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-box {
  background: var(--bg-secondary);
  border: 2px solid var(--border);
  border-radius: 24px;
  padding: 48px;
  max-width: 480px;
  width: 100%;
  box-shadow: var(--shadow-lg), var(--glow-purple);
}

.login-header {
  text-align: center;
  margin-bottom: 32px;
}

.login-icon {
  font-size: 64px;
  margin-bottom: 16px;
  filter: drop-shadow(0 0 20px rgba(139, 92, 246, 0.5));
}

.login-header h1 {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 8px;
  background: linear-gradient(135deg, var(--neon-cyan), var(--neon-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.login-header p {
  color: var(--text-secondary);
  font-size: 16px;
}

.error-message {
  background: rgba(255, 0, 110, 0.1);
  border: 1px solid var(--neon-pink);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 24px;
  color: var(--neon-pink);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
}

.login-form {
  margin-bottom: 24px;
}

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

.form-group label {
  display: block;
  margin-bottom: 8px;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-group input {
  width: 100%;
  padding: 14px 16px;
  background: var(--bg-tertiary);
  border: 2px solid var(--border);
  border-radius: 12px;
  color: var(--text-primary);
  font-size: 16px;
  font-family: inherit;
  transition: all 0.3s ease;
}

.form-group input:focus {
  outline: none;
  border-color: var(--neon-purple);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.btn-primary {
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, var(--neon-purple), var(--neon-pink));
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 16px rgba(139, 92, 246, 0.4);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(139, 92, 246, 0.6);
}

.login-footer {
  text-align: center;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.back-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.3s ease;
}

.back-link:hover {
  color: var(--neon-cyan);
}

.login-hint {
  margin-top: 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
}

/* Admin Dashboard */
.admin-container {
  min-height: 100vh;
  background: var(--bg-primary);
}

.admin-header {
  background: var(--bg-secondary);
  border-bottom: 2px solid var(--border);
  padding: 24px 32px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-md);
}

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

.admin-header h1 {
  font-size: 28px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--neon-cyan), var(--neon-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.admin-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.admin-user {
  color: var(--text-secondary);
  font-size: 14px;
  padding: 8px 16px;
  background: var(--bg-tertiary);
  border-radius: 8px;
}

.btn-secondary {
  padding: 10px 20px;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-block;
}

.btn-secondary:hover {
  border-color: var(--neon-cyan);
  background: rgba(0, 240, 255, 0.1);
}

.btn-danger {
  padding: 10px 20px;
  background: rgba(255, 0, 110, 0.1);
  color: var(--neon-pink);
  border: 1px solid var(--neon-pink);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-block;
}

.btn-danger:hover {
  background: rgba(255, 0, 110, 0.2);
}

.admin-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 32px;
}

.admin-section {
  background: var(--bg-secondary);
  border: 2px solid var(--border);
  border-radius: 20px;
  padding: 32px;
  margin-bottom: 32px;
  box-shadow: var(--shadow-md);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--border);
}

.section-header h2 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
}

.game-count {
  padding: 6px 16px;
  background: linear-gradient(135deg, var(--neon-purple), var(--neon-pink));
  color: white;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 700;
}

/* Game Form */
.game-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}

/* Games List */
.games-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.game-item {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px;
  background: var(--bg-tertiary);
  border: 2px solid var(--border);
  border-radius: 16px;
  transition: all 0.3s ease;
}

.game-item:hover {
  border-color: var(--border-glow);
  box-shadow: var(--glow-purple);
}

.game-item-icon {
  font-size: 48px;
  filter: drop-shadow(0 0 15px rgba(139, 92, 246, 0.4));
}

.game-item-content {
  flex: 1;
}

.game-item-content h3 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--text-primary);
}

.game-item-content p {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 8px;
}

.game-item-url {
  display: inline-block;
  padding: 4px 12px;
  background: var(--bg-secondary);
  border-radius: 6px;
  font-size: 12px;
  color: var(--text-muted);
  font-family: "JetBrains Mono", monospace;
}

.game-item-meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.game-order {
  padding: 4px 12px;
  background: var(--bg-secondary);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--neon-cyan);
  font-family: "JetBrains Mono", monospace;
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 28px;
}

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

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg-secondary);
  border: 2px solid var(--border);
  transition: 0.3s;
  border-radius: 28px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 2px;
  bottom: 2px;
  background: var(--text-muted);
  transition: 0.3s;
  border-radius: 50%;
}

input:checked + .toggle-slider {
  background: linear-gradient(135deg, var(--neon-purple), var(--neon-pink));
  border-color: transparent;
}

input:checked + .toggle-slider:before {
  transform: translateX(24px);
  background: white;
}

/* Game Actions */
.game-item-actions {
  display: flex;
  gap: 8px;
}

.btn-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 18px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-icon:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-edit:hover {
  border-color: var(--neon-cyan);
  background: rgba(0, 240, 255, 0.1);
}

.btn-delete:hover {
  border-color: var(--neon-pink);
  background: rgba(255, 0, 110, 0.1);
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
}

.modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: var(--bg-secondary);
  border: 2px solid var(--border);
  border-radius: 24px;
  padding: 32px;
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg), var(--glow-purple);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--border);
}

.modal-header h2 {
  font-size: 24px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--neon-cyan), var(--neon-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.modal-close {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 24px;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.modal-close:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.modal-actions button {
  flex: 1;
}

/* Admin Link on Main Page */
.admin-link {
  position: absolute;
  top: 32px;
  right: 32px;
  padding: 10px 20px;
  background: var(--bg-secondary);
  border: 2px solid var(--border);
  border-radius: 12px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.admin-link:hover {
  border-color: var(--neon-purple);
  color: var(--neon-purple);
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.3);
}

/* Responsive */
@media (max-width: 768px) {
  .admin-header-content {
    flex-direction: column;
    align-items: flex-start;
  }

  .admin-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .admin-content {
    padding: 20px;
  }

  .admin-section {
    padding: 20px;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .game-item {
    flex-direction: column;
    text-align: center;
  }

  .game-item-actions {
    width: 100%;
    justify-content: center;
  }

  .login-box {
    padding: 32px 24px;
  }

  .admin-link {
    position: static;
    margin-top: 16px;
  }

  .game-header {
    position: relative;
  }
}
