/* ========== GAMIFICATION SYSTEM STYLES ========== */

/* Profile Stats */
.profile-stats {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding: 1.5rem;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-light)) !important;
  border-radius: 12px;
  color: white;
  box-shadow: 0 4px 15px rgba(44, 138, 90, 0.2);
}

.coin-balance {
  text-align: center;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.1) !important;
  border-radius: 8px;
  backdrop-filter: blur(10px);
}

.coin-balance i {
  font-size: 1.5rem;
  margin-right: 0.5rem;
  color: #f0c44c;
  animation: coinSpin 2s ease-in-out infinite;
}

@keyframes coinSpin {
  0%, 100% { transform: rotateY(0deg); }
  50% { transform: rotateY(180deg); }
}

.current-avatar {
  text-align: center;
}

.avatar-display {
  font-size: 3rem;
  margin-bottom: 0.5rem;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1) !important;
  margin: 0 auto 0.5rem;
  border: 3px solid rgba(255, 255, 255, 0.2);
  transition: all 0.3s ease;
}

.avatar-display:hover {
  transform: scale(1.1);
  border-color: rgba(255, 255, 255, 0.4);
}

.current-theme {
  text-align: center;
}

.theme-display {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.1) !important;
  border-radius: 8px;
  backdrop-filter: blur(10px);
}

/* Achievements Section */
.achievements-section {
  margin-bottom: 2rem;
}

.achievements-section h4 {
  color: var(--primary-color);
  margin-bottom: 1rem;
  font-size: 1.2rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.achievements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.achievement-badge {
  text-align: center;
  padding: 1rem;
  border-radius: 12px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.achievement-badge.earned {
  background: linear-gradient(135deg, #f0c44c, #d4af37);
  color: white;
  box-shadow: 0 4px 15px rgba(240, 196, 76, 0.3);
  transform: scale(1);
}

.achievement-badge.earned:hover {
  transform: scale(1.05) translateY(-2px);
  box-shadow: 0 8px 25px rgba(240, 196, 76, 0.4);
}

.achievement-badge.locked {
  background: #f8f9fa;
  color: #6c757d;
  border: 2px dashed #dee2e6;
  opacity: 0.7;
}

.achievement-badge.locked:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.achievement-icon {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  display: block;
}

.achievement-badge.earned .achievement-icon {
  animation: achievementGlow 2s ease-in-out infinite;
}

@keyframes achievementGlow {
  0%, 100% { text-shadow: 0 0 5px rgba(255, 255, 255, 0.5); }
  50% { text-shadow: 0 0 20px rgba(255, 255, 255, 0.8), 0 0 30px rgba(240, 196, 76, 0.6); }
}

.achievement-name {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
  line-height: 1.2;
}

.achievement-description {
  font-size: 0.75rem;
  opacity: 0.9;
  line-height: 1.3;
}

.achievement-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: var(--primary-color);
  transition: width 0.3s ease;
}

/* Rewards Section */
.rewards-section {
  margin-bottom: 2rem;
}

.rewards-section h4 {
  color: var(--primary-color);
  margin-bottom: 1rem;
  font-size: 1.2rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.owned-items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}

.owned-item {
  text-align: center;
  padding: 1rem;
  background: linear-gradient(135deg, var(--gray-50) 0%, var(--gray-100) 100%);
  border: 2px solid var(--primary-light);
  border-radius: 10px;
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
}

.owned-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(44, 138, 90, 0.15);
  border-color: var(--primary-color);
}

.owned-item.active {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
  color: white;
  border-color: var(--secondary-color);
  box-shadow: 0 4px 15px rgba(44, 138, 90, 0.3);
}

.owned-item.active::after {
  content: '✓';
  position: absolute;
  top: -5px;
  right: -5px;
  background: var(--secondary-color);
  color: white;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: bold;
}

.owned-item-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  display: block;
}

.owned-item-name {
  font-size: 0.8rem;
  font-weight: 500;
  line-height: 1.2;
}

/* Stickers Collection */
.stickers-section {
  margin-top: 1.5rem;
}

.stickers-section h4 {
  color: var(--primary-color);
  margin-bottom: 1rem;
  font-size: 1.1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.stickers-collection {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
  padding: 1rem;
  background: #f8f9fa;
  border-radius: 8px;
  min-height: 60px;
}

.user-sticker {
  font-size: 1.8rem;
  padding: 0.5rem;
  background: linear-gradient(135deg, var(--gray-50) 0%, var(--gray-100) 100%);
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border: 2px solid var(--gray-200);
}

.user-sticker:hover {
  transform: scale(1.2) rotate(10deg);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* Enhanced Rewards Store */
.rewards-store-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.rewards-store-modal.show {
  display: flex !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

.store-content {
  background: linear-gradient(135deg, var(--gray-50) 0%, var(--white) 100%);
  border-radius: 16px;
  max-width: 900px;
  width: 95%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: modalSlideUp 0.3s ease-out;
  border: 2px solid var(--gray-200);
}

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

.store-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid #eee;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
  color: white;
  border-radius: 16px 16px 0 0;
}

.store-header h2 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
}

.close-btn {
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 50%;
  transition: background 0.3s ease;
}

.close-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.coin-balance-store {
  background: rgba(255, 255, 255, 0.1);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-weight: 600;
}

.coin-balance-store i {
  color: #f0c44c;
  font-size: 1.2rem;
}

.store-tabs {
  display: flex;
  background: #f8f9fa;
  border-bottom: 1px solid #eee;
}

.store-tab {
  flex: 1;
  padding: 1rem;
  background: none;
  border: none;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.3s ease;
  position: relative;
}

.store-tab.active {
  background: linear-gradient(135deg, var(--gray-100) 0%, var(--gray-50) 100%);
  color: var(--primary-color);
  position: relative;
  border: 1px solid var(--primary-200);
}

.store-tab.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--primary-color);
}

.store-items {
  padding: 1.5rem;
}

.store-tab-content {
  display: none;
}

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

.items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1rem;
}

.store-item {
  text-align: center;
  padding: 1.5rem;
  border: 2px solid #eee;
  border-radius: 12px;
  transition: all 0.3s ease;
  cursor: pointer;
  background: linear-gradient(135deg, var(--gray-50) 0%, var(--white) 100%);
  position: relative;
}

.store-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
  border-color: var(--primary-color);
}

.store-item.owned {
  background: linear-gradient(135deg, #d4edda, #c3e6cb);
  border-color: #28a745;
  cursor: default;
}

.store-item.owned::after {
  content: '✓ Dimiliki';
  position: absolute;
  top: 10px;
  right: 10px;
  background: #28a745;
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: bold;
}

.store-item.insufficient-coins {
  opacity: 0.6;
  cursor: not-allowed;
  background: #f8f9fa;
}

.store-item-icon {
  font-size: 3rem;
  margin-bottom: 0.5rem;
  display: block;
}

.store-item-name {
  font-weight: 600;
  margin-bottom: 0.5rem;
  font-size: 1rem;
}

.store-item-price {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  font-weight: 600;
  color: var(--primary-color);
}

.store-item-price i {
  color: #f0c44c;
}

/* Mobile Responsiveness for Gamification */
@media (max-width: 768px) {
  .profile-stats {
    grid-template-columns: 1fr;
    gap: 0.75rem;
    padding: 1rem;
  }
  
  .achievements-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 0.75rem;
  }
  
  .achievement-badge {
    padding: 0.75rem;
  }
  
  .achievement-icon {
    font-size: 2rem;
  }
  
  .achievement-name {
    font-size: 0.8rem;
  }
  
  .achievement-description {
    font-size: 0.7rem;
  }
  
  .owned-items-grid {
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 0.5rem;
  }
  
  .owned-item {
    padding: 0.75rem;
  }
  
  .owned-item-icon {
    font-size: 1.5rem;
  }
  
  .owned-item-name {
    font-size: 0.7rem;
  }
  
  .user-sticker {
    width: 40px;
    height: 40px;
    font-size: 1.5rem;
  }
  
  .store-header {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
  
  .store-tabs {
    flex-wrap: wrap;
  }
}

@media (max-width: 480px) {
  .achievements-grid {
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  }
  
  .user-sticker {
    width: 35px;
    height: 35px;
    font-size: 1.3rem;
  }
  
  .store-item-icon {
    font-size: 2rem;
  }
}
