/* Points System Styles */
.points-container {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 15px;
  padding: 20px;
  color: white;
  margin-bottom: 20px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.points-balance {
  text-align: center;
  margin-bottom: 20px;
}

.points-balance h2 {
  font-size: 2.5rem;
  margin: 0;
  font-weight: bold;
  text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.points-balance .points-label {
  font-size: 1rem;
  opacity: 0.9;
  margin-top: 5px;
}

.points-icon {
  color: #ffd700;
  margin-right: 8px;
  font-size: 1.2em;
}

/* Daily Bonus Section */
.daily-bonus {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 15px;
  margin-bottom: 15px;
  backdrop-filter: blur(10px);
}

.daily-bonus-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.streak-counter {
  background: rgba(255, 255, 255, 0.2);
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: bold;
}

.bonus-btn {
  background: linear-gradient(45deg, #ffd700, #ffed4e);
  border: none;
  color: #333;
  padding: 10px 20px;
  border-radius: 25px;
  font-weight: bold;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
}

.bonus-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 215, 0, 0.4);
}

.bonus-claimed {
  background: rgba(76, 175, 80, 0.3);
  color: #fff;
  border: 2px solid #4caf50;
}

/* Points History */
.points-history {
  background: white;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.points-history-header {
  background: #f8f9fa;
  padding: 15px 20px;
  border-bottom: 1px solid #dee2e6;
  font-weight: bold;
  color: #495057;
}

.points-history-item {
  padding: 15px 20px;
  border-bottom: 1px solid #f1f3f4;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background-color 0.2s ease;
}

.points-history-item:hover {
  background-color: #f8f9fa;
}

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

.transaction-info {
  flex: 1;
}

.transaction-reason {
  font-weight: 500;
  color: #333;
  margin-bottom: 2px;
}

.transaction-meta {
  font-size: 0.85rem;
  color: #6c757d;
}

.transaction-amount {
  font-weight: bold;
  font-size: 1.1rem;
  padding: 5px 10px;
  border-radius: 20px;
  min-width: 80px;
  text-align: center;
}

.transaction-amount.credit {
  color: #28a745;
  background-color: rgba(40, 167, 69, 0.1);
}

.transaction-amount.debit {
  color: #dc3545;
  background-color: rgba(220, 53, 69, 0.1);
}

/* Leaderboard */
.leaderboard {
  background: white;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.leaderboard-item {
  padding: 15px 20px;
  border-bottom: 1px solid #f1f3f4;
  display: flex;
  align-items: center;
  transition: background-color 0.2s ease;
}

.leaderboard-item:hover {
  background-color: #f8f9fa;
}

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

.leaderboard-rank {
  font-size: 1.2rem;
  font-weight: bold;
  color: #495057;
  margin-right: 15px;
  min-width: 30px;
}

.leaderboard-rank.first {
  color: #ffd700;
}

.leaderboard-rank.second {
  color: #c0c0c0;
}

.leaderboard-rank.third {
  color: #cd7f32;
}

.leaderboard-user {
  flex: 1;
  display: flex;
  align-items: center;
}

.leaderboard-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  margin-right: 12px;
  object-fit: cover;
}

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

.leaderboard-points {
  font-weight: bold;
  color: #667eea;
  font-size: 1.1rem;
}

/* Points Widget (for display in other pages) */
.points-widget {
  display: inline-flex;
  align-items: center;
  background: linear-gradient(45deg, #667eea, #764ba2);
  color: white;
  padding: 8px 15px;
  border-radius: 20px;
  font-weight: bold;
  font-size: 0.9rem;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
  transition: all 0.3s ease;
}

.points-widget:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.points-widget .points-icon {
  margin-right: 5px;
}

/* Daily Rewards Calendar Modal Styles */
.daily-rewards-header {
  background: linear-gradient(to bottom right, #ffffff, #ceadff);
  border: none;
  padding: 20px 24px;
}

.daily-rewards-icon {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  padding: 15px;
  backdrop-filter: blur(10px);
}

.current-streak-banner {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-bottom: 1px solid #dee2e6;
}

.streak-info {
  display: flex;
  align-items: center;
  gap: 20px;
}

.streak-flame {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.streak-flame i {
  position: relative;
  z-index: 1;
}

.streak-count {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(255, 255, 255, 0.9);
  color: #ff6b35;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 1rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Streak Container */
.streak-container {
  padding: 24px;
  min-height: 400px;
}

.streak-header {
  text-align: center;
  margin-bottom: 30px;
}

/* Streak Grid */
.streak-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 12px;
  max-width: 100%;
  margin: 0 auto;
}

/* Streak Day Cards */
.streak-day {
  background: #f8f9fa;
  border: 2px solid #e9ecef;
  border-radius: 12px;
  padding: 12px 8px;
  text-align: center;
  transition: all 0.3s ease;
  cursor: pointer;
  min-height: 100px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
}

.streak-day:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Streak Day States */
.streak-day.completed {
  background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
  border-color: #28a745;
  color: white;
  box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.streak-day.current {
  background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
  border-color: #ffd700;
  color: #333;
  animation: pulseStreak 2s infinite;
  box-shadow: 0 4px 20px rgba(255, 215, 0, 0.4);
}

.streak-day.future {
  background: #f8f9fa;
  border-color: #dee2e6;
  color: #6c757d;
  opacity: 0.7;
}

/* Streak Day Content */
.streak-day-number {
  font-size: 1.2rem;
  font-weight: bold;
  margin-bottom: 4px;
}

.streak-icon {
  font-size: 1.5rem;
  margin: 4px 0;
}

.streak-points {
  font-size: 0.8rem;
  font-weight: 600;
  margin-top: 4px;
}

.streak-points small {
  font-size: 0.7rem;
  opacity: 0.8;
}

/* Streak Bonus Indicators */
.streak-bonus-indicator {
  position: absolute;
  top: -5px;
  right: -5px;
  background: #ff6b35;
  color: white;
  border-radius: 50%;
  width: 25px;
  height: 25px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  z-index: 2;
}

.streak-bonus-indicator.weekly {
  background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
  color: #333;
}

.streak-bonus-indicator.final {
  background: linear-gradient(135deg, #6f42c1 0%, #e83e8c 100%);
  color: white;
  width: 30px;
  height: 30px;
  font-size: 1rem;
}

/* Next Reward Display */
.next-reward {
  text-align: center;
}

.next-reward-preview {
  background: rgba(255, 215, 0, 0.1);
  border: 2px solid rgba(255, 215, 0, 0.3);
  border-radius: 15px;
  padding: 10px 15px;
  display: inline-block;
  margin-top: 5px;
}

.reward-amount {
  font-size: 1.3rem;
  font-weight: bold;
  color: #ffd700;
}

/* Today's Reward Section */
.todays-reward-section {
  background: linear-gradient(135deg, #f8f9fa 0%, rgba(40, 167, 69, 0.05) 100%);
  border-top: 3px solid #28a745;
}

.todays-reward-info h6 {
  color: #28a745;
  font-weight: 600;
}

.reward-details {
  margin: 15px 0;
}

.reward-points {
  background: rgba(40, 167, 69, 0.1);
  border-radius: 12px;
  padding: 8px 16px;
  display: inline-block;
  margin-right: 10px;
}

.reward-bonus-text {
  margin-top: 8px;
  font-style: italic;
}

/* Claim Button */
.claim-todays-reward {
  background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
  border: none;
  padding: 12px 24px;
  border-radius: 25px;
  font-weight: 600;
  box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
  transition: all 0.3s ease;
  color: white;
  min-height: 48px;
  min-width: 140px;
}

.claim-todays-reward:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
  color: white;
}

.claim-todays-reward:disabled {
  background: #6c757d;
  opacity: 0.6;
  transform: none;
  box-shadow: none;
}

/* Fix for modal scrolling issues */
#dailyRewardsModal .modal-dialog {
  height: calc(100% - 60px);
  margin-top: 30px;
  margin-bottom: 30px;
}

#dailyRewardsModal .modal-content {
  max-height: 100%;
}

#dailyRewardsModal .modal-body {
  overflow-y: auto;
  /* remove the scroll‐contain that snaps back */
  overscroll-behavior: auto;
  /* enable smooth/native touch scrolling on iOS/Chrome */
  -webkit-overflow-scrolling: touch;
}

/* Prevent content from jumping around during interactions */
.streak-container {
  min-height: 480px;
  position: relative;
}

/* Prevent scroll jumping */
.streak-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 12px;
  max-width: 100%;
  margin: 0 auto;
}

/* Ensure the claim button doesn't cause layout shifts */
.claim-todays-reward {
  min-height: 48px;
  min-width: 140px;
}

/* Animations */
@keyframes pulseStreak {
  0%, 100% {
    box-shadow: 0 4px 20px rgba(255, 215, 0, 0.4);
  }
  50% {
    box-shadow: 0 4px 30px rgba(255, 215, 0, 0.6);
  }
}

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

.streak-day.completing {
  animation: streakComplete 0.6s ease-out;
}

/* Responsive Design for Streak Grid */
@media (max-width: 768px) {
  .streak-grid {
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
  }
  
  .streak-day {
    padding: 8px 4px;
    min-height: 80px;
  }
  
  .streak-day-number {
    font-size: 1rem;
  }
  
  .streak-icon {
    font-size: 1.2rem;
  }
  
  .streak-points {
    font-size: 0.7rem;
  }
  
  .streak-bonus-indicator {
    width: 20px;
    height: 20px;
    font-size: 0.7rem;
  }
  
  .streak-bonus-indicator.final {
    width: 25px;
    height: 25px;
    font-size: 0.8rem;
  }
  
  .streak-info {
    flex-direction: column;
    text-align: center;
    gap: 15px;
  }
  
  .next-reward {
    text-align: center !important;
    margin-top: 15px;
  }
}

@media (max-width: 576px) {
  .streak-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
  }
  
  .streak-day {
    padding: 6px 3px;
    min-height: 70px;
  }
  
  .streak-day-number {
    font-size: 0.9rem;
  }
  
  .streak-icon {
    font-size: 1rem;
  }
  
  .streak-points {
    font-size: 0.65rem;
  }
  
  .streak-container {
    padding: 16px;
  }
}

/* Animation for point changes */
@keyframes pointsUpdate {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
    color: #ffd700;
  }
  100% {
    transform: scale(1);
  }
}

.points-updated {
  animation: pointsUpdate 0.6s ease-in-out;
}

/* Loading states */
.points-loading {
  opacity: 0.6;
  pointer-events: none;
}

.points-skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Daily Bonus Notification Styles */
.daily-bonus-notification {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.daily-bonus-notification.show {
  opacity: 1;
  visibility: visible;
}

.daily-bonus-notification.hiding {
  opacity: 0;
  transform: scale(0.8);
}

.daily-bonus-container {
  background: linear-gradient(135deg, #ff9a56 0%, #ff6b6b 50%, #ffa726 100%);
  border: 3px solid #fff;
  box-shadow: 0 25px 50px rgba(255, 154, 86, 0.4);
}

.daily-bonus-calendar {
  position: relative;
  font-size: 3rem;
  color: #fff;
  animation: bounceIn 0.8s ease-out;
}

.calendar-day {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.2rem;
  font-weight: bold;
  color: #ff6b6b;
  background: #fff;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: dayBounce 1.5s ease-out;
}

.streak-fire {
  position: absolute;
  top: -10px;
  right: -10px;
  font-size: 2rem;
  color: #ff4444;
  opacity: 0;
  transition: all 0.3s ease;
}

.streak-fire.active {
  opacity: 1;
  animation: fireFlicker 1.5s infinite;
}

.streak-number {
  position: absolute;
  top: -8px;
  right: -8px;
  background: #fff;
  color: #ff4444;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  font-size: 0.8rem;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.streak-info {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  padding: 8px 15px;
  margin-top: 10px;
  font-size: 0.9rem;
  backdrop-filter: blur(10px);
}

/* Special Reward Notification Styles */
.special-reward-notification {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.special-reward-notification.show {
  opacity: 1;
  visibility: visible;
}

.special-reward-notification.hiding {
  opacity: 0;
  transform: scale(0.8);
}

.reward-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
}

.reward-container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 20px;
  padding: 40px;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
  overflow: hidden;
  position: relative;
}

.special-reward-notification.show .reward-container,
.daily-bonus-notification.show .reward-container {
  transform: translate(-50%, -50%) scale(1);
}

.reward-content {
  text-align: center;
  color: white;
  position: relative;
  z-index: 2;
}

.reward-icon-container {
  position: relative;
  margin-bottom: 20px;
  height: 80px;
}

.reward-main-icon {
  font-size: 3rem;
  color: #ffd700;
  animation: bounceIn 0.8s ease-out;
}

.reward-star {
  position: absolute;
  color: #ffd700;
  font-size: 1.2rem;
  animation: twinkle 2s infinite;
}

.star-1 {
  top: 10px;
  left: 20px;
  animation-delay: 0.2s;
}

.star-2 {
  top: 5px;
  right: 30px;
  animation-delay: 0.5s;
}

.star-3 {
  bottom: 10px;
  left: 30px;
  animation-delay: 0.8s;
}

.reward-title {
  font-size: 1.8rem;
  font-weight: bold;
  margin-bottom: 10px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.reward-message {
  font-size: 1.1rem;
  margin-bottom: 20px;
  opacity: 0.9;
}

.reward-points {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 15px;
  padding: 15px;
  margin-bottom: 15px;
  backdrop-filter: blur(10px);
}

.points-earned {
  font-size: 2.5rem;
  font-weight: bold;
  color: #ffd700;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  animation: pointsGlow 2s infinite alternate;
}

.points-label {
  display: block;
  font-size: 1rem;
  opacity: 0.8;
  margin-top: 5px;
}

.reward-meta {
  font-size: 0.9rem;
  opacity: 0.7;
}

.reward-close-btn {
  position: absolute;
  top: 15px;
  right: 15px;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  width: 35px;
  height: 35px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.reward-close-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

.reward-particles {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
}

.particle {
  position: absolute;
  width: 8px;
  height: 8px;
  background: #ffd700;
  border-radius: 50%;
  opacity: 0;
  animation: particleFloat 3s infinite;
}

.particle-1 { left: 10%; animation-delay: 0.2s; }
.particle-2 { left: 25%; animation-delay: 0.8s; }
.particle-3 { left: 50%; animation-delay: 0.4s; }
.particle-4 { left: 75%; animation-delay: 1.2s; }
.particle-5 { left: 85%; animation-delay: 0.6s; }
.particle-6 { left: 40%; animation-delay: 1.0s; }

/* Notification Animation Keyframes */
@keyframes bounceIn {
  0% { transform: scale(0); opacity: 0; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(1); }
}

@keyframes twinkle {
  0%, 100% { opacity: 0.4; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.2); }
}

@keyframes pointsGlow {
  0% { text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3); }
  100% { text-shadow: 0 2px 20px rgba(255, 215, 0, 0.8); }
}

@keyframes particleFloat {
  0% { transform: translateY(100%); opacity: 0; }
  20% { opacity: 1; }
  80% { opacity: 1; }
  100% { transform: translateY(-100%); opacity: 0; }
}

/* Daily Bonus Specific Animation Keyframes */
@keyframes calendarPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

@keyframes dayBounce {
  0% { transform: translate(-50%, -50%) scale(0); }
  60% { transform: translate(-50%, -50%) scale(1.2); }
  100% { transform: translate(-50%, -50%) scale(1); }
}

@keyframes fireFlicker {
  0%, 100% { transform: scale(1) rotate(-2deg); }
  25% { transform: scale(1.1) rotate(2deg); }
  50% { transform: scale(0.95) rotate(-1deg); }
  75% { transform: scale(1.05) rotate(1deg); }
}

.buy-points-card {
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease;
  border-radius: 1.4rem !important;
}

.buy-points-card:hover {
  transform: scale(1.03);
  box-shadow: 0 0.75rem 1.5rem rgba(0,0,0,0.08);
}
