/* ============================================
   THE 3D BIBLE CHALLENGE - Styles
   ============================================ */

/* ============================================
   REGISTRATION POPUP
   ============================================ */

.challenge-popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.challenge-popup-overlay.show {
  opacity: 1;
}

.challenge-popup {
  background: white;
  border-radius: 12px;
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.challenge-popup-overlay.show .challenge-popup {
  transform: scale(1);
}

.challenge-popup-header {
  background: linear-gradient(135deg, #5f0c0b 0%, #143348 100%);
  color: white;
  padding: 30px;
  text-align: center;
  border-radius: 12px 12px 0 0;
}

.challenge-popup-header h2 {
  margin: 0 0 10px 0;
  font-size: 29px;
  font-weight: 700;
}

.challenge-popup-header .subtitle {
  margin: 0;
  font-size: 17px;
  opacity: 0.9;
  color: #e8b562;
}

.challenge-popup-body {
  padding: 30px;
}

.challenge-features {
  margin: 20px 0;
  padding: 0;
  list-style: none;
}

.challenge-features li {
  padding: 10px 0;
  display: flex;
  align-items: center;
  font-size: 16px;
  color: #333;
}

.challenge-features li::before {
  content: '✓';
  display: inline-block;
  width: 24px;
  height: 24px;
  background: #143348;
  color: white;
  border-radius: 50%;
  text-align: center;
  line-height: 24px;
  margin-right: 12px;
  flex-shrink: 0;
}

.challenge-form {
  margin-top: 20px;
}

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

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #333;
  font-size: 15px;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"] {
  width: 100%;
  padding: 12px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 16px;
  transition: border-color 0.3s ease;
}

.form-group input:focus {
  outline: none;
  border-color: #143348;
}

.form-group-checkbox {
  display: flex;
  align-items: start;
  margin: 20px 0;
}

.form-group-checkbox input[type="checkbox"] {
  margin-right: 10px;
  margin-top: 3px;
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.form-group-checkbox label {
  margin: 0;
  font-size: 15px;
  color: #666;
  cursor: pointer;
}

.challenge-popup-footer {
  padding: 0 30px 30px 30px;
  display: flex;
  gap: 12px;
}

.btn-challenge {
  flex: 1;
  padding: 14px 24px;
  background: linear-gradient(135deg, #5f0c0b 0%, #143348 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-challenge:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(95, 12, 11, 0.3);
}

.btn-challenge:active {
  transform: translateY(0);
}

.btn-challenge-secondary {
  flex: 1;
  padding: 14px 24px;
  background: white;
  color: #333;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-challenge-secondary:hover {
  border-color: #143348;
  color: #143348;
}

.popup-close {
  position: absolute;
  top: 15px;
  right: 15px;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  font-size: 24px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

.popup-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* ============================================
   LEADERBOARD
   ============================================ */

.leaderboard {
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.leaderboard-header {
  background: linear-gradient(135deg, #5f0c0b 0%, #143348 100%);
  color: white;
  padding: 30px;
  text-align: center;
}

.leaderboard-header h2 {
  margin: 0 0 8px 0;
  font-size: 28px;
}

.leaderboard-subtitle {
  margin: 0;
  opacity: 0.9;
  font-size: 14px;
}

.leaderboard-table {
  padding: 0;
}

.leaderboard-row {
  display: grid;
  grid-template-columns: 60px 1fr 100px 100px;
  gap: 12px;
  padding: 16px 20px;
  align-items: center;
  border-bottom: 1px solid #f0f0f0;
  transition: background 0.2s ease;
}

.leaderboard-row:hover {
  background: #f9f9f9;
}

.leaderboard-row.completed {
  background: #f0fdf4;
}

.leaderboard-row.completed:hover {
  background: #dcfce7;
}

.leaderboard-header-row {
  background: #f5f5f5;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  color: #666;
  padding: 12px 20px;
}

.leaderboard-header-row:hover {
  background: #f5f5f5;
}

.rank-col {
  text-align: center;
}

.rank-number {
  font-size: 20px;
  font-weight: 700;
  color: #5f0c0b;
}

.name-col {
  display: flex;
  align-items: center;
  gap: 8px;
}

.display-name {
  font-weight: 500;
  color: #333;
}

.badge-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  background: #10b981;
  color: white;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
}

.streak-col,
.entries-col {
  text-align: center;
  font-size: 14px;
  color: #666;
}

.streak-value,
.entries-value {
  font-weight: 600;
  color: #333;
}

.leaderboard-footer {
  padding: 20px;
  text-align: center;
  border-top: 1px solid #f0f0f0;
}

.leaderboard-empty {
  padding: 60px 20px;
  text-align: center;
  color: #999;
}

/* ============================================
   USER RANK WIDGET
   ============================================ */

.user-rank-card {
  background: linear-gradient(135deg, #5f0c0b 0%, #143348 100%);
  color: white;
  border-radius: 12px;
  padding: 24px;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.rank-badge {
  margin-bottom: 20px;
}

.rank-badge .rank-number {
  font-size: 48px;
  font-weight: 700;
  display: block;
  margin-bottom: 8px;
}

.rank-badge .rank-label {
  font-size: 14px;
  opacity: 0.9;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.rank-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin: 20px 0;
  padding: 20px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.rank-stats .stat {
  text-align: center;
}

.rank-stats .stat-value {
  font-size: 24px;
  font-weight: 700;
  display: block;
  margin-bottom: 4px;
}

.rank-stats .stat-label {
  font-size: 12px;
  opacity: 0.8;
  text-transform: uppercase;
}

.rank-position {
  margin: 12px 0 0 0;
  font-size: 14px;
  opacity: 0.9;
}

/* ============================================
   CHALLENGE BADGES
   ============================================ */

.challenge-badges {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 20px 0;
}

.challenge-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: linear-gradient(135deg, #5f0c0b 0%, #143348 100%);
  color: white;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.challenge-badge-icon {
  font-size: 18px;
}

.streak-box.challenge-active {
  border: 2px solid #e8b562;
  box-shadow: 0 0 12px rgba(232, 181, 98, 0.3);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    box-shadow: 0 0 12px rgba(232, 181, 98, 0.3);
  }
  50% {
    box-shadow: 0 0 20px rgba(232, 181, 98, 0.5);
  }
}

/* ============================================
   CHALLENGE PROGRESS BAR
   ============================================ */

.challenge-progress {
  margin: 20px 0;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 14px;
  color: #666;
}

.progress-bar {
  height: 8px;
  background: #e0e0e0;
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #5f0c0b 0%, #143348 100%);
  border-radius: 4px;
  transition: width 0.3s ease;
}

/* ============================================
   MOBILE RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
  .leaderboard-row {
    grid-template-columns: 50px 1fr 80px 80px;
    gap: 8px;
    padding: 12px 16px;
  }
  
  .rank-number {
    font-size: 18px;
  }
  
  .display-name {
    font-size: 14px;
  }
  
  .streak-col,
  .entries-col {
    font-size: 12px;
  }
  
  .challenge-popup {
    max-width: 95%;
  }
  
  .challenge-popup-header h2 {
    font-size: 24px;
  }
  
  .user-rank-card .rank-badge .rank-number {
    font-size: 36px;
  }
}

/* ============================================
   MODAL
   ============================================ */

.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.modal.show {
  opacity: 1;
}

.modal-content.leaderboard-modal {
  max-width: 800px;
  width: 90%;
  max-height: 90vh;
  background: white;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.modal-header {
  padding: 20px 30px;
  background: #f5f5f5;
  border-bottom: 1px solid #e0e0e0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 {
  margin: 0;
  font-size: 24px;
}

.modal-close {
  background: none;
  border: none;
  font-size: 32px;
  color: #999;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
}

.modal-close:hover {
  color: #333;
}

.modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}
