/**
 * Rewards System Styles
 * Stars, badges, levels, celebrations!
 */

/* Rewards Panel */
#rewards-panel {
  position: fixed;
  top: 70px;
  right: 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 15px;
  padding: 15px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.3);
  z-index: 1000;
  min-width: 200px;
  color: white;
  font-family: 'Montserrat', sans-serif;
}

.rewards-header {
  text-align: center;
  font-size: 18px;
  font-weight: bold;
  margin-bottom: 10px;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.star-counter {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 24px;
  margin: 10px 0;
}

#star-count {
  font-weight: bold;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.level-display {
  text-align: center;
  margin: 10px 0;
}

#player-level {
  font-size: 32px;
  font-weight: bold;
  display: block;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.level-label {
  font-size: 12px;
  opacity: 0.9;
}

.xp-bar {
  width: 100%;
  height: 8px;
  background: rgba(255,255,255,0.3);
  border-radius: 4px;
  overflow: hidden;
  margin: 10px 0;
}

#xp-progress {
  height: 100%;
  background: linear-gradient(90deg, #4ECDC4, #45B7D1);
  transition: width 0.5s ease;
  box-shadow: 0 0 10px rgba(78,205,196,0.5);
}

.streak-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 16px;
  margin: 10px 0;
  padding: 8px;
  background: rgba(255,255,255,0.2);
  border-radius: 10px;
}

#streak-days {
  font-weight: bold;
}

#badge-showcase {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 10px;
  max-height: 100px;
  overflow-y: auto;
}

.badge-item {
  background: rgba(255,255,255,0.2);
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 16px;
  cursor: help;
  transition: transform 0.2s;
}

.badge-item:hover {
  transform: scale(1.1);
  background: rgba(255,255,255,0.3);
}

/* Star Notification */
.star-notification {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 999999;
  animation: starPopIn 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.star-popup {
  background: linear-gradient(135deg, #FFD700, #FFA500);
  color: white;
  padding: 20px 30px;
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  text-align: center;
}

.star-icon {
  font-size: 48px;
  animation: rotateStar 1s ease-in-out infinite;
}

.star-amount {
  font-size: 32px;
  font-weight: bold;
  font-family: 'Montserrat', sans-serif;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.star-reason {
  font-size: 16px;
  margin-top: 5px;
  opacity: 0.9;
}

@keyframes starPopIn {
  0% {
    transform: translate(-50%, -50%) scale(0) rotate(-180deg);
    opacity: 0;
  }
  70% {
    transform: translate(-50%, -50%) scale(1.2) rotate(10deg);
  }
  100% {
    transform: translate(-50%, -50%) scale(1) rotate(0deg);
    opacity: 1;
  }
}

@keyframes rotateStar {
  0%, 100% {
    transform: rotate(0deg) scale(1);
  }
  50% {
    transform: rotate(20deg) scale(1.1);
  }
}

/* Level Up Overlay */
.level-up-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999999;
  animation: fadeIn 0.3s ease-in;
}

.level-up-modal {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 40px;
  border-radius: 20px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  animation: bounceIn 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.level-up-modal h2 {
  font-size: 36px;
  margin: 0 0 20px 0;
  text-shadow: 3px 3px 6px rgba(0,0,0,0.3);
  animation: pulse 1s ease-in-out infinite;
}

.new-level {
  font-size: 72px;
  font-weight: bold;
  margin: 20px 0;
  text-shadow: 4px 4px 8px rgba(0,0,0,0.3);
  animation: scaleUp 1s ease-in-out infinite;
}

.level-up-modal p {
  font-size: 18px;
  margin: 20px 0;
}

.level-up-modal button {
  background: white;
  color: #667eea;
  border: none;
  padding: 15px 30px;
  font-size: 18px;
  font-weight: bold;
  border-radius: 30px;
  cursor: pointer;
  transition: transform 0.2s;
  font-family: 'Montserrat', sans-serif;
}

.level-up-modal button:hover {
  transform: scale(1.1);
}

/* Badge Earned Overlay */
.badge-earned-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999999;
  animation: fadeIn 0.3s ease-in;
}

.badge-earned-modal {
  background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
  color: white;
  padding: 40px;
  border-radius: 20px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  animation: bounceIn 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.badge-earned-modal h2 {
  font-size: 36px;
  margin: 0 0 20px 0;
  text-shadow: 3px 3px 6px rgba(0,0,0,0.3);
}

.badge-icon {
  font-size: 64px;
  margin: 20px 0;
  animation: wiggleBadge 0.5s ease-in-out infinite;
}

.badge-earned-modal button {
  background: white;
  color: #FFA500;
  border: none;
  padding: 15px 30px;
  font-size: 18px;
  font-weight: bold;
  border-radius: 30px;
  cursor: pointer;
  transition: transform 0.2s;
  font-family: 'Montserrat', sans-serif;
}

.badge-earned-modal button:hover {
  transform: scale(1.1);
}

/* Animal Level Notification */
.animal-level-notification {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 999999;
  animation: slideInScale 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.animal-level-popup {
  background: linear-gradient(135deg, #4ECDC4 0%, #45B7D1 100%);
  color: white;
  padding: 30px;
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  text-align: center;
}

.animal-level-popup h3 {
  font-size: 28px;
  margin: 0 0 15px 0;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.animal-level-popup button {
  background: white;
  color: #4ECDC4;
  border: none;
  padding: 12px 24px;
  font-size: 16px;
  font-weight: bold;
  border-radius: 20px;
  cursor: pointer;
  margin-top: 15px;
  transition: transform 0.2s;
  font-family: 'Montserrat', sans-serif;
}

.animal-level-popup button:hover {
  transform: scale(1.1);
}

/* Streak Notification */
.streak-notification {
  position: fixed;
  top: 100px;
  right: 20px;
  z-index: 999999;
  animation: slideInRight 0.5s ease-out, fadeOut 0.5s ease-in 3.5s forwards;
}

.streak-popup {
  background: linear-gradient(135deg, #FF6B6B 0%, #FF8E53 100%);
  color: white;
  padding: 20px 25px;
  border-radius: 15px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  gap: 15px;
}

.streak-icon {
  font-size: 36px;
  animation: flameFlicker 0.5s ease-in-out infinite;
}

.streak-days {
  font-size: 24px;
  font-weight: bold;
  font-family: 'Montserrat', sans-serif;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.streak-message {
  font-size: 14px;
  opacity: 0.9;
}

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

@keyframes bounceIn {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

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

@keyframes wiggleBadge {
  0%, 100% {
    transform: rotate(0deg);
  }
  25% {
    transform: rotate(-10deg);
  }
  75% {
    transform: rotate(10deg);
  }
}

@keyframes slideInScale {
  from {
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
  }
  to {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
}

@keyframes flameFlicker {
  0%, 100% {
    transform: scale(1) rotate(0deg);
  }
  50% {
    transform: scale(1.1) rotate(5deg);
  }
}

/* Mobile Responsive */
@media (max-width: 640px) {
  #rewards-panel {
    top: 10px;
    right: 10px;
    left: 10px;
    min-width: auto;
    padding: 10px;
  }
  
  .rewards-header {
    font-size: 16px;
  }
  
  .star-counter {
    font-size: 20px;
  }
  
  #player-level {
    font-size: 24px;
  }
  
  .level-up-modal, .badge-earned-modal {
    padding: 30px 20px;
    max-width: 90%;
  }
  
  .level-up-modal h2, .badge-earned-modal h2 {
    font-size: 24px;
  }
  
  .new-level {
    font-size: 48px;
  }
  
  .badge-icon {
    font-size: 48px;
  }
  
  .streak-notification {
    right: 10px;
    left: 10px;
  }
  
  .streak-popup {
    padding: 15px;
  }
  
  .star-popup {
    padding: 15px 20px;
  }
  
  .star-icon {
    font-size: 36px;
  }
  
  .star-amount {
    font-size: 24px;
  }
}
