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

/* Gamification Button */
.gamification-button {
  position: fixed;
  bottom: 170px;
  right: 24px;
  height: 56px;
  border-radius: 28px;
  background: linear-gradient(135deg, #FFD700, #FF9500);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 20px;
  box-shadow: 0 4px 20px rgba(255, 215, 0, 0.4);
  transition: transform 0.2s, box-shadow 0.2s;
  z-index: 1001;
  color: #000;
}

.gamification-button:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 30px rgba(255, 215, 0, 0.6);
}

.gamification-button svg {
  width: 24px;
  height: 24px;
}

.gamification-button-label {
  font-weight: 600;
  font-size: 0.9rem;
}

.gamification-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 22px;
  height: 22px;
  background: #FF6B9D;
  border-radius: 11px;
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  box-shadow: 0 2px 8px rgba(255, 107, 157, 0.5);
}

@media (max-width: 600px) {
  .gamification-button {
    width: 56px;
    padding: 0;
    border-radius: 50%;
  }
  .gamification-button-label {
    display: none;
  }
}

/* Gamification Modal */
.gamification-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.gamification-modal.active {
  display: flex;
  opacity: 1;
}

.gamification-modal-content {
  background: linear-gradient(145deg, #1a1a2e 0%, #16213e 100%);
  border-radius: 24px;
  padding: 0;
  max-width: 600px;
  width: 95%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  border: 1px solid rgba(255, 215, 0, 0.2);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  animation: modal-pop 0.3s ease;
}

.gamification-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  font-size: 1.5rem;
  cursor: pointer;
  z-index: 10;
  transition: color 0.2s;
}

.gamification-modal-close:hover {
  color: #fff;
}

/* Header with Level */
.gamification-header {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.15) 0%, rgba(255, 107, 157, 0.15) 100%);
  padding: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.level-display {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.level-emoji {
  font-size: 3rem;
  line-height: 1;
}

.level-info {
  display: flex;
  flex-direction: column;
}

.level-name {
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
}

.level-xp {
  font-size: 0.9rem;
  color: #FFD700;
  font-weight: 600;
}

.xp-progress {
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.xp-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #FFD700, #FF9500);
  border-radius: 4px;
  transition: width 0.5s ease;
}

.xp-to-next {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
  text-align: right;
}

/* Streak Display */
.streak-display {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
  background: rgba(255, 107, 107, 0.1);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.streak-flame {
  font-size: 2.5rem;
  animation: flame-pulse 1s ease infinite;
}

.streak-flame.streak-hot {
  animation: flame-intense 0.5s ease infinite;
}

.streak-flame.streak-epic {
  animation: flame-epic 0.3s ease infinite;
  filter: drop-shadow(0 0 10px #ff6b6b);
}

@keyframes flame-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

@keyframes flame-intense {
  0%, 100% { transform: scale(1) rotate(-5deg); }
  50% { transform: scale(1.15) rotate(5deg); }
}

@keyframes flame-epic {
  0%, 100% { transform: scale(1) rotate(-3deg); filter: drop-shadow(0 0 10px #ff6b6b); }
  50% { transform: scale(1.2) rotate(3deg); filter: drop-shadow(0 0 20px #ff6b6b); }
}

.streak-info {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.streak-count {
  font-size: 2rem;
  font-weight: 700;
  color: #FF6B6B;
}

.streak-label {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.7);
}

.streak-best {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.05);
  padding: 0.5rem 1rem;
  border-radius: 20px;
}

/* Tab Navigation */
.gamification-tabs {
  display: flex;
  gap: 0.25rem;
  padding: 0.75rem 1rem;
  background: rgba(0, 0, 0, 0.2);
  overflow-x: auto;
}

.tab-btn {
  padding: 0.6rem 1rem;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  border-radius: 20px;
  white-space: nowrap;
  transition: all 0.2s;
}

.tab-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.tab-btn.active {
  color: #FFD700;
  background: rgba(255, 215, 0, 0.15);
}

/* Tab Content */
.tab-content {
  padding: 1.5rem;
}

.tab-pane {
  display: none;
}

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

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 1rem 0.5rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.stat-icon {
  font-size: 1.5rem;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
}

.stat-label {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.5);
}

@media (max-width: 500px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Quick Actions */
.quick-actions-section {
  margin-bottom: 1.5rem;
}

.quick-actions-section h4 {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 0.75rem;
}

.quick-action-buttons {
  display: flex;
  gap: 0.75rem;
}

.quick-action-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  color: #fff;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}

.quick-action-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 215, 0, 0.3);
  transform: translateY(-2px);
}

.quick-action-btn span:first-child {
  font-size: 1.5rem;
}

/* Next Milestone */
.next-milestone {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 1rem;
  margin-bottom: 1.5rem;
}

.next-milestone h4 {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 0.75rem;
}

.milestone-preview {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.milestone-emoji {
  font-size: 2rem;
}

.milestone-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.milestone-name {
  font-weight: 600;
  color: #fff;
}

.milestone-desc {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
}

.milestone-progress {
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 0.5rem;
}

.milestone-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #90FF6A, #50D050);
  border-radius: 3px;
  transition: width 0.5s ease;
}

.milestone-progress-text {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.5);
}

/* Recent Achievements */
.recent-achievements h4 {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 0.75rem;
}

.achievement-preview {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.achievement-mini {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: rgba(255, 215, 0, 0.1);
  border: 1px solid rgba(255, 215, 0, 0.2);
  border-radius: 20px;
  font-size: 0.85rem;
  color: #FFD700;
}

/* Achievements Grid */
.achievements-header {
  margin-bottom: 1rem;
  font-size: 0.9rem;
  color: #FFD700;
}

.achievement-category {
  margin-bottom: 1.5rem;
}

.achievement-category h5 {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.achievement-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.achievement-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  min-width: 80px;
  position: relative;
  transition: all 0.2s;
}

.achievement-item.earned {
  background: rgba(255, 215, 0, 0.1);
  border-color: rgba(255, 215, 0, 0.3);
}

.achievement-item.locked {
  opacity: 0.5;
}

.achievement-emoji {
  font-size: 1.5rem;
}

.achievement-name {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.7);
  text-align: center;
}

.achievement-check {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 18px;
  height: 18px;
  background: #90FF6A;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  color: #000;
  font-weight: 700;
}

/* Milestones List */
.milestone-category {
  margin-bottom: 1.5rem;
}

.milestone-category h5 {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 0.75rem;
}

.milestone-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  margin-bottom: 0.75rem;
}

.milestone-item.reached {
  background: rgba(144, 255, 106, 0.1);
  border-color: rgba(144, 255, 106, 0.3);
}

.milestone-details {
  flex: 1;
}

.milestone-reached {
  color: #90FF6A;
  font-size: 0.85rem;
  font-weight: 600;
}

/* Mood Tab */
.mood-header {
  margin-bottom: 1.5rem;
}

.mood-header h4 {
  font-size: 1rem;
  color: #fff;
  margin-bottom: 1rem;
  text-align: center;
}

.mood-picker {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
}

.mood-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 0.75rem 0.5rem;
  background: rgba(255, 255, 255, 0.03);
  border: 2px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.mood-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

.mood-btn.selected {
  background: rgba(255, 107, 157, 0.2);
  border-color: #FF6B9D;
}

.mood-emoji {
  font-size: 1.5rem;
}

.mood-label {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.7);
}

.mood-note-section {
  margin-bottom: 1.5rem;
}

.mood-note-section textarea {
  width: 100%;
  min-height: 80px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 1rem;
  color: #fff;
  font-size: 0.9rem;
  resize: vertical;
  margin-bottom: 0.75rem;
}

.mood-submit-btn {
  width: 100%;
  padding: 1rem;
  background: linear-gradient(135deg, #FF6B9D, #C44569);
  border: none;
  border-radius: 12px;
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s;
}

.mood-submit-btn:hover {
  transform: translateY(-2px);
}

.mood-history,
.mood-stats {
  margin-bottom: 1.5rem;
}

.mood-history h4,
.mood-stats h4 {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 0.75rem;
}

.mood-history-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 10px;
  margin-bottom: 0.5rem;
}

.mood-history-emoji {
  font-size: 1.25rem;
}

.mood-history-info {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.mood-history-label {
  font-size: 0.9rem;
  color: #fff;
}

.mood-history-note {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.5);
  font-style: italic;
}

.mood-history-time {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.4);
}

.mood-stat-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  margin-bottom: 0.75rem;
}

.mood-stat-emoji {
  font-size: 2rem;
}

.mood-stat-label {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.5);
}

.mood-stat-value {
  font-size: 0.9rem;
  color: #fff;
}

/* Activities Tab */
.activities-section {
  margin-bottom: 2rem;
}

.activities-section h4 {
  font-size: 1rem;
  color: #fff;
  margin-bottom: 0.25rem;
}

.section-desc {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 1rem;
}

.games-grid,
.themes-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.game-card,
.theme-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1.25rem 1rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.game-card:hover,
.theme-card:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 215, 0, 0.3);
  transform: translateY(-2px);
}

.game-emoji,
.theme-emoji {
  font-size: 2rem;
}

.game-name,
.theme-name {
  font-weight: 600;
  color: #fff;
  font-size: 0.9rem;
}

.game-desc,
.theme-desc {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.5);
  line-height: 1.4;
}

.game-xp {
  font-size: 0.75rem;
  color: #FFD700;
  background: rgba(255, 215, 0, 0.1);
  padding: 0.25rem 0.75rem;
  border-radius: 10px;
}

/* Empty State */
.empty-state {
  text-align: center;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.9rem;
  padding: 1rem;
}

/* Toast Notifications */
.gamification-toast {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
  background: linear-gradient(145deg, #1a1a2e 0%, #16213e 100%);
  border: 1px solid rgba(255, 215, 0, 0.3);
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  z-index: 3000;
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.gamification-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.toast-emoji {
  font-size: 2rem;
}

.toast-content {
  display: flex;
  flex-direction: column;
}

.toast-title {
  font-weight: 600;
  color: #fff;
}

.toast-desc {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.7);
}

/* Modal Animation */
@keyframes modal-pop {
  from {
    transform: scale(0.9);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* Responsive */
@media (max-width: 500px) {
  .gamification-modal-content {
    max-height: 95vh;
    border-radius: 20px 20px 0 0;
    margin-top: auto;
  }

  .mood-picker {
    grid-template-columns: repeat(3, 1fr);
  }

  .games-grid,
  .themes-grid {
    grid-template-columns: 1fr;
  }

  .quick-action-buttons {
    flex-direction: column;
  }
}
