/* ====================================
PERFORMANCE PAGE - CHALLENGE FLOW
==================================== */

/* ====================================
CHALLENGE JOIN AREA
==================================== */
.challenge-join-area {
  background: var(--glass-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem 2rem;
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.challenge-join-area .btn-primary {
  padding: 0.75rem 2rem;
  font-size: 0.95rem;
  white-space: nowrap;
}

.challenge-join-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin: 0;
}

.challenge-join-info i {
  color: var(--gold);
}

/* ====================================
CHALLENGE MODAL
==================================== */
.challenge-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(10px);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.challenge-modal.active {
  display: flex;
}

.challenge-modal-content {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 2.5rem;
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1.25rem;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  transition: 0.3s;
}

.modal-close:hover {
  color: var(--white);
  transform: rotate(90deg);
}

.challenge-modal-content h3 {
  font-family: "Space Grotesk", sans-serif;
  margin-bottom: 0.5rem;
}

.challenge-modal-content h3 i {
  margin-right: 0.5rem;
}

.challenge-modal-content > p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

/* ====================================
CHALLENGE FORM
==================================== */
#challengeJoinForm .form-group {
  margin-bottom: 1rem;
}

#challengeJoinForm label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--white);
  margin-bottom: 0.3rem;
}

#challengeJoinForm label .required {
  color: var(--danger);
  margin-left: 2px;
}

#challengeJoinForm input,
#challengeJoinForm select,
#challengeJoinForm textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--glass-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--white);
  font-size: 0.9rem;
  font-family: "Inter", sans-serif;
  outline: none;
  transition: 0.3s;
}

#challengeJoinForm input:focus,
#challengeJoinForm select:focus,
#challengeJoinForm textarea:focus {
  border-color: var(--secondary);
  box-shadow: 0 0 0 3px rgba(0, 200, 150, 0.15);
}

#challengeJoinForm input::placeholder,
#challengeJoinForm textarea::placeholder {
  color: var(--text-muted);
}

#challengeJoinForm select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23ffffff' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}

#challengeJoinForm textarea {
  resize: vertical;
  min-height: 80px;
}

#challengeJoinForm .btn-primary {
  width: 100%;
  margin-top: 0.5rem;
}

#joinFormStatus {
  margin-top: 1rem;
}

/* ====================================
PARTICIPANTS SECTION
==================================== */
.participants-section {
  margin-bottom: 2rem;
}

.participants-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.participants-header h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--white);
}

.participants-header h3 i {
  color: var(--gold);
  margin-right: 0.5rem;
}

.participants-header span {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ====================================
PENDING APPLICATIONS (Admin)
==================================== */
.pending-applications {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.pending-applications .section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.pending-applications .section-header h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--white);
}

.pending-applications .section-header h3 i {
  color: var(--gold);
  margin-right: 0.5rem;
}

.pending-applications .section-header span {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.pending-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.pending-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: var(--glass-bg);
  border-radius: 12px;
  border-left: 3px solid var(--gold);
  flex-wrap: wrap;
  gap: 0.5rem;
}

.pending-item .pending-info {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.pending-item .pending-info .pending-name {
  font-weight: 600;
  font-size: 0.9rem;
}

.pending-item .pending-info .pending-details {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.pending-item .pending-actions {
  display: flex;
  gap: 0.5rem;
}

.pending-item .pending-actions button {
  padding: 0.4rem 1rem;
  border-radius: 8px;
  border: none;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: 0.3s;
  font-family: "Inter", sans-serif;
}

.pending-item .pending-actions .approve-btn {
  background: var(--profit-green);
  color: var(--bg-dark);
}

.pending-item .pending-actions .approve-btn:hover {
  transform: scale(1.05);
}

.pending-item .pending-actions .reject-btn {
  background: var(--danger);
  color: var(--white);
}

.pending-item .pending-actions .reject-btn:hover {
  transform: scale(1.05);
}

/* ====================================
RESPONSIVE
==================================== */
@media (max-width: 768px) {
  .challenge-join-area {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
    padding: 1.25rem;
  }

  .challenge-join-area .btn-primary {
    width: 100%;
    justify-content: center;
  }

  .challenge-join-info {
    justify-content: center;
    font-size: 0.8rem;
  }

  .challenge-modal-content {
    padding: 1.5rem;
    margin: 0.5rem;
  }

  .pending-item {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }

  .pending-item .pending-actions {
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .challenge-modal-content {
    padding: 1.25rem;
  }

  .challenge-modal-content h3 {
    font-size: 1.1rem;
  }

  #challengeJoinForm input,
  #challengeJoinForm select,
  #challengeJoinForm textarea {
    font-size: 0.8rem;
    padding: 0.6rem 0.75rem;
  }
}
