/* StretchStrong - Social Challenges Styles */
/* Gamified UI for social features, challenges, and community engagement */

.social-modal {
  z-index: 10002;
}

.social-modal-content {
  max-width: 1000px;
  width: 95vw;
  max-height: 95vh;
  overflow-y: auto;
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
}

/* Social Header */
.social-header {
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
  color: white;
  padding: 24px 30px;
  border-radius: 20px 20px 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.social-header .modal-title {
  font-size: 26px;
  font-weight: 700;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.social-header .modal-title i {
  color: #fbbf24;
  font-size: 28px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.user-level-badge {
  background: rgba(255, 255, 255, 0.2);
  padding: 8px 16px;
  border-radius: 20px;
  font-weight: 600;
  font-size: 14px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

/* User Profile Section */
.user-profile-section {
  padding: 20px 30px;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
}

.profile-card {
  background: white;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
  border: 1px solid #e2e8f0;
}

.profile-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  margin-bottom: 16px;
  box-shadow: 0 4px 16px rgba(139, 92, 246, 0.3);
}

.profile-info h3 {
  font-size: 20px;
  font-weight: 700;
  color: #1e293b;
  margin: 0 0 16px 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 20px;
}

.stat-item {
  text-align: center;
}

.stat-value {
  font-size: 24px;
  font-weight: 800;
  color: #8b5cf6;
  line-height: 1;
}

.stat-label {
  font-size: 12px;
  color: #64748b;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 4px;
}

.experience-bar {
  background: #f1f5f9;
  border-radius: 12px;
  padding: 16px;
}

.xp-label {
  font-size: 14px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 8px;
}

.xp-bar {
  height: 8px;
  background: #e2e8f0;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 8px;
}

.xp-fill {
  height: 100%;
  background: linear-gradient(90deg, #8b5cf6 0%, #7c3aed 100%);
  transition: width 0.8s ease;
}

.xp-text {
  font-size: 12px;
  color: #64748b;
  text-align: center;
}

/* Social Tabs */
.social-tabs {
  display: flex;
  background: #f8fafc;
  padding: 0 30px;
  border-bottom: 1px solid #e2e8f0;
}

.social-tab {
  flex: 1;
  padding: 16px 20px;
  border: none;
  background: transparent;
  color: #64748b;
  font-weight: 600;
  cursor: pointer;
  position: relative;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.social-tab:hover {
  color: #8b5cf6;
  background: rgba(139, 92, 246, 0.05);
}

.social-tab.active {
  color: #8b5cf6;
  background: white;
  border-radius: 8px 8px 0 0;
  margin-top: -1px;
}

.social-tab.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #8b5cf6 0%, #7c3aed 100%);
}

/* Tab Content */
.tab-content {
  display: none;
  padding: 30px;
}

.tab-content.active {
  display: block;
}

/* Challenges Tab */
.challenges-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.challenges-header h3 {
  font-size: 22px;
  font-weight: 700;
  color: #1e293b;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.filter-buttons {
  display: flex;
  gap: 8px;
}

.filter-btn {
  padding: 8px 16px;
  border: 2px solid #e2e8f0;
  border-radius: 20px;
  background: white;
  color: #64748b;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 14px;
}

.filter-btn:hover {
  border-color: #8b5cf6;
  color: #8b5cf6;
}

.filter-btn.active {
  background: #8b5cf6;
  border-color: #8b5cf6;
  color: white;
}

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

.challenge-card {
  background: white;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  border: 1px solid #e2e8f0;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.challenge-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}

.challenge-card.individual {
  border-left: 5px solid #3b82f6;
}

.challenge-card.team {
  border-left: 5px solid #10b981;
}

.challenge-card.social {
  border-left: 5px solid #f59e0b;
}

.challenge-card.easy::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 0;
  height: 0;
  border-left: 30px solid transparent;
  border-top: 30px solid #10b981;
}

.challenge-card.medium::before {
  border-top-color: #f59e0b;
}

.challenge-card.hard::before {
  border-top-color: #ef4444;
}

.challenge-card.expert::before {
  border-top-color: #8b5cf6;
}

.challenge-header {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
}

.challenge-icon {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 20px;
  box-shadow: 0 4px 16px rgba(139, 92, 246, 0.3);
}

.challenge-info {
  flex: 1;
}

.challenge-info h4 {
  font-size: 18px;
  font-weight: 700;
  color: #1e293b;
  margin: 0 0 8px 0;
}

.challenge-info p {
  color: #64748b;
  margin: 0;
  line-height: 1.5;
}

.challenge-reward {
  text-align: right;
}

.reward-points {
  font-size: 16px;
  font-weight: 700;
  color: #fbbf24;
}

.reward-xp {
  font-size: 12px;
  color: #64748b;
  font-weight: 500;
}

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

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

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #8b5cf6 0%, #7c3aed 100%);
  transition: width 0.6s ease;
}

.progress-text {
  font-size: 14px;
  font-weight: 600;
  color: #374151;
  text-align: center;
}

.challenge-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 20px 0;
}

.difficulty-badge {
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.difficulty-badge.easy {
  background: #d1fae5;
  color: #065f46;
}

.difficulty-badge.medium {
  background: #fef3c7;
  color: #92400e;
}

.difficulty-badge.hard {
  background: #fee2e2;
  color: #991b1b;
}

.difficulty-badge.expert {
  background: #ede9fe;
  color: #5b21b6;
}

.challenge-time {
  font-size: 12px;
  color: #64748b;
  font-weight: 500;
}

.challenge-action-btn {
  width: 100%;
  padding: 12px 20px;
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.challenge-action-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}

/* Leaderboard Tab */
.leaderboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.leaderboard-header h3 {
  font-size: 22px;
  font-weight: 700;
  color: #1e293b;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.leaderboard-filters {
  display: flex;
  gap: 8px;
}

.leaderboard-filter {
  padding: 8px 16px;
  border: 2px solid #e2e8f0;
  border-radius: 20px;
  background: white;
  color: #64748b;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.leaderboard-filter:hover {
  border-color: #fbbf24;
  color: #fbbf24;
}

.leaderboard-filter.active {
  background: #fbbf24;
  border-color: #fbbf24;
  color: white;
}

.leaderboard-container {
  background: white;
  border-radius: 16px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  border: 1px solid #e2e8f0;
}

.leaderboard-list {
  padding: 0;
}

.leaderboard-item {
  display: flex;
  align-items: center;
  padding: 16px 24px;
  border-bottom: 1px solid #f1f5f9;
  transition: background 0.2s ease;
}

.leaderboard-item:hover {
  background: #f8fafc;
}

.leaderboard-item.current-user {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.1) 0%, rgba(124, 58, 237, 0.1) 100%);
  border-left: 4px solid #8b5cf6;
}

.leaderboard-item:last-child {
  border-bottom: none;
}

.rank {
  min-width: 60px;
  font-size: 18px;
  font-weight: 700;
  text-align: center;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.user-name {
  font-weight: 700;
  color: #1e293b;
}

.user-stats {
  font-size: 12px;
  color: #64748b;
}

.user-score {
  font-size: 16px;
  font-weight: 700;
  color: #fbbf24;
}

/* Achievements Tab */
.achievements-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.achievements-header h3 {
  font-size: 22px;
  font-weight: 700;
  color: #1e293b;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.achievement-stats {
  font-size: 14px;
  color: #64748b;
  font-weight: 500;
}

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

.achievement-card {
  background: white;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  border: 1px solid #e2e8f0;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.achievement-card.unlocked {
  background: linear-gradient(135deg, #fef3c7 0%, #fffbeb 100%);
  border-color: #fbbf24;
  transform: scale(1.02);
}

.achievement-card.locked {
  background: #f8fafc;
  opacity: 0.7;
}

.achievement-card.common {
  border-left: 5px solid #94a3b8;
}

.achievement-card.uncommon {
  border-left: 5px solid #10b981;
}

.achievement-card.rare {
  border-left: 5px solid #3b82f6;
}

.achievement-card.epic {
  border-left: 5px solid #8b5cf6;
}

.achievement-card.legendary {
  border-left: 5px solid #fbbf24;
  background: linear-gradient(135deg, #fef3c7 0%, #fffbeb 100%);
}

.achievement-card.legendary::before {
  content: '✨';
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 20px;
  animation: sparkle 2s infinite;
}

@keyframes sparkle {
  0%, 100% { transform: scale(1) rotate(0deg); opacity: 1; }
  50% { transform: scale(1.2) rotate(180deg); opacity: 0.8; }
}

.achievement-icon {
  font-size: 40px;
  margin-bottom: 12px;
  text-align: center;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.achievement-info h4 {
  font-size: 16px;
  font-weight: 700;
  color: #1e293b;
  margin: 0 0 8px 0;
}

.achievement-info p {
  color: #64748b;
  margin: 0 0 8px 0;
  line-height: 1.4;
  font-size: 14px;
}

.unlock-date {
  font-size: 12px;
  color: #059669;
  font-weight: 500;
}

.progress-info {
  font-size: 12px;
  color: #64748b;
  font-weight: 500;
}

.achievement-rarity {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 2px 6px;
  border-radius: 8px;
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.achievement-rarity.common {
  background: #94a3b8;
  color: white;
}

.achievement-rarity.uncommon {
  background: #10b981;
  color: white;
}

.achievement-rarity.rare {
  background: #3b82f6;
  color: white;
}

.achievement-rarity.epic {
  background: #8b5cf6;
  color: white;
}

.achievement-rarity.legendary {
  background: #fbbf24;
  color: #92400e;
}

/* Teams Tab */
.teams-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.teams-header h3 {
  font-size: 22px;
  font-weight: 700;
  color: #1e293b;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.teams-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 30px;
}

.team-card {
  background: white;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  border: 1px solid #e2e8f0;
  transition: all 0.3s ease;
}

.team-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}

.team-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.team-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.team-info {
  flex: 1;
}

.team-info h4 {
  font-size: 18px;
  font-weight: 700;
  color: #1e293b;
  margin: 0 0 4px 0;
}

.team-stats {
  font-size: 14px;
  color: #64748b;
}

.team-points {
  font-size: 16px;
  font-weight: 700;
  color: #10b981;
}

.team-challenge {
  background: #f0fdf4;
  padding: 12px 16px;
  border-radius: 8px;
  margin: 16px 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #166534;
}

.team-challenge i {
  color: #10b981;
}

.team-actions {
  display: flex;
  gap: 12px;
}

.team-actions .btn {
  flex: 1;
  padding: 10px 16px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn.btn-outline {
  background: transparent;
  border: 2px solid #e2e8f0;
  color: #64748b;
}

.btn.btn-outline:hover {
  border-color: #10b981;
  color: #10b981;
}

.create-team-section {
  margin-top: 30px;
}

.create-team-card {
  background: linear-gradient(135deg, #f0fdf4 0%, #f7fee7 100%);
  border: 2px dashed #10b981;
  border-radius: 16px;
  padding: 40px;
  text-align: center;
}

.create-team-icon {
  font-size: 48px;
  color: #10b981;
  margin-bottom: 16px;
}

.create-team-info h4 {
  font-size: 20px;
  font-weight: 700;
  color: #166534;
  margin: 0 0 8px 0;
}

.create-team-info p {
  color: #166534;
  margin: 0 0 20px 0;
}

/* Challenge Completion Popup */
.challenge-completion-popup {
  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: 20000;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.completion-content {
  background: white;
  border-radius: 20px;
  padding: 40px;
  text-align: center;
  max-width: 400px;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
  animation: slideUp 0.4s ease;
}

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

.completion-header {
  margin-bottom: 24px;
}

.celebration-icon {
  font-size: 60px;
  color: #fbbf24;
  margin-bottom: 16px;
  animation: bounce 0.6s ease;
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-10px); }
  60% { transform: translateY(-5px); }
}

.completion-header h3 {
  font-size: 24px;
  font-weight: 700;
  color: #1e293b;
  margin: 0;
}

.completion-details h4 {
  font-size: 18px;
  font-weight: 600;
  color: #374151;
  margin: 0 0 16px 0;
}

.rewards {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 24px;
}

.reward-item {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #f8fafc;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #374151;
}

.reward-item i {
  color: #fbbf24;
}

/* Social Footer */
.social-footer {
  padding: 20px 30px;
  border-top: 1px solid #e2e8f0;
  background: #fafbfc;
  border-radius: 0 0 20px 20px;
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.social-footer .btn {
  padding: 12px 20px;
  font-weight: 600;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.social-footer .btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Responsive Design */
@media (max-width: 1024px) {
  .social-modal-content {
    width: 95vw;
  }
  
  .challenges-grid {
    grid-template-columns: 1fr;
  }
  
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .achievements-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  }
}

@media (max-width: 768px) {
  .social-header {
    padding: 20px;
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }
  
  .social-header .modal-title {
    font-size: 22px;
  }
  
  .user-profile-section {
    padding: 20px;
  }
  
  .profile-card {
    padding: 20px;
  }
  
  .social-tabs {
    padding: 0 20px;
    overflow-x: auto;
  }
  
  .social-tab {
    min-width: 120px;
    padding: 12px 16px;
    font-size: 14px;
  }
  
  .tab-content {
    padding: 20px;
  }
  
  .challenges-header,
  .leaderboard-header,
  .achievements-header,
  .teams-header {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }
  
  .filter-buttons,
  .leaderboard-filters {
    justify-content: center;
    flex-wrap: wrap;
  }
  
  .team-actions {
    flex-direction: column;
  }
  
  .social-footer {
    padding: 16px 20px;
    flex-direction: column;
  }
  
  .social-footer .btn {
    width: 100%;
    justify-content: center;
  }
  
  .completion-content {
    margin: 20px;
    padding: 30px 20px;
  }
  
  .rewards {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .social-header .modal-title {
    font-size: 18px;
  }
  
  .challenge-card,
  .team-card,
  .achievement-card {
    padding: 16px;
  }
  
  .profile-avatar {
    width: 50px;
    height: 50px;
    font-size: 24px;
  }
  
  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }
  
  .stat-value {
    font-size: 20px;
  }
  
  .leaderboard-item {
    padding: 12px 16px;
  }
  
  .user-avatar {
    width: 35px;
    height: 35px;
    font-size: 16px;
  }
  
  .rank {
    min-width: 40px;
    font-size: 14px;
  }
}