/* Styles for the user profile and achievements tab */

#profile-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: calc(100% - 80px); /* Full height minus tabs height */
  background-color: #0a0a2a;
  z-index: 990;
  display: none;
  flex-direction: column;
  overflow: hidden;
}

/* Profile header with user info */
.profile-header {
  padding: 10px 15px;
  display: flex;
  align-items: center;
  background-color: #0a0a2a;
  border-bottom: 2px solid #5050ff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.profile-avatar {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid #5050ff;
  box-shadow: 0 0 15px rgba(80, 80, 255, 0.4);
  display: flex;
  justify-content: center;
  align-items: center;
  color: white;
  font-weight: bold;
  font-size: 32px;
  background-color: #1a1a4a;
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-user-info {
  margin-left: 15px;
  flex: 1;
}

.profile-username {
  font-size: 22px;
  font-weight: bold;
  color: white;
  margin-bottom: 3px;
  text-shadow: 0 0 10px #5050ff;
}

.profile-stats {
  font-size: 16px;
  color: #fff;
  margin-bottom: 5px;
  font-weight: bold;
}

.profile-stats-streak {
  font-size: 16px;
  color: #50ffff;
  font-weight: bold;
}

/* Card-based UI */
.profile-card {
  background-color: #1a1a4a;
  border-radius: 12px;
  margin-bottom: 15px;
  padding: 15px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
  border: 1px solid #2a2a7a;
}

.section-title {
  font-size: 18px;
  color: white;
  margin-bottom: 8px;
  font-weight: bold;
  padding-bottom: 8px;
}

/* Stats cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 15px;
}

.stat-card {
  background-color: #101040;
  border-radius: 10px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  border: 1px solid #2a2a7a;
}

.stat-value {
  font-size: 22px;
  font-weight: bold;
  color: #50ffff;
  margin-bottom: 5px;
}

.stat-label {
  font-size: 12px;
  color: #aaa;
}

/* Daily streak section */
.streak-display {
  display: flex;
  align-items: center;
  margin-bottom: 15px;
  justify-content: center;
}

.streak-count {
  font-size: 28px;
  font-weight: bold;
  color: #ffcc00; /* Gold color for streak */
  margin: 0 12px 0 0;
  text-shadow: 0 0 8px rgba(255, 204, 0, 0.5);
}

.streak-label {
  font-size: 16px;
  color: white;
}

.streak-flame {
  font-size: 28px;
  margin-right: 4px;
}

/* Weekly calendar grid */
.week-calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  margin-top: 10px;
}

.day-box {
  aspect-ratio: 1;
  border-radius: 8px;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  background-color: #101040;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  transition: all 0.2s ease;
  border: 1px solid #2a2a7a;
}

.day-box.active {
  background-color: #5050ff;
  transform: translateY(-3px);
  box-shadow: 0 5px 10px rgba(80, 80, 255, 0.4);
  border-color: #8080ff;
}

.day-label {
  font-size: 10px;
  color: #aaa;
}

.day-number {
  font-size: 16px;
  font-weight: bold;
  color: white;
}

/* Main content area with scrollable list */
.profile-content {
  flex: 1;
  overflow-y: auto;
  padding: 10px 15px 30px 15px;
  scrollbar-width: thin;
  scrollbar-color: #5050ff #0a0a2a;
}

/* Custom scrollbar */
.profile-content::-webkit-scrollbar {
  width: 6px;
}

.profile-content::-webkit-scrollbar-track {
  background: #0a0a2a;
}

.profile-content::-webkit-scrollbar-thumb {
  background-color: #5050ff;
  border-radius: 10px;
}

/* Celestial bodies collection */
.bodies-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 10px;
}

.body-item {
  background-color: #101040;
  border-radius: 10px;
  padding: 8px 5px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  border: 1px solid #2a2a7a;
  position: relative;
  overflow: hidden;
}

.body-item.unlocked {
  border-color: #5050ff;
  box-shadow: 0 0 10px rgba(80, 80, 255, 0.3);
  background-color: rgba(80, 80, 255, 0.1);
}

.body-item.locked {
  opacity: 0.7;
  filter: grayscale(0.7);
}

.body-icon {
  font-size: 22px;
  margin-bottom: 5px;
}

.body-name {
  font-size: 12px;
  color: white;
  font-weight: bold;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.body-count {
  font-size: 11px;
  color: #aaa;
}

.no-bodies-message {
  grid-column: 1 / -1;
  text-align: center;
  padding: 20px;
  color: #aaa;
  font-style: italic;
  background-color: rgba(10, 10, 40, 0.5);
  border-radius: 10px;
  border: 1px dashed #2a2a7a;
}

/* Play patterns */
.play-patterns {
  margin-top: 10px;
}

.pattern-bar {
  display: flex;
  height: 30px;
  border-radius: 6px;
  overflow: hidden;
  background-color: #101040;
  margin-bottom: 5px;
}

.pattern-segment {
  height: 100%;
  transition: width 0.5s ease;
}

.pattern-morning {
  background-color: #ffcc00; /* Yellow for morning */
}

.pattern-afternoon {
  background-color: #ff9900; /* Orange for afternoon */
}

.pattern-evening {
  background-color: #5050ff; /* Blue for evening */
}

.pattern-night {
  background-color: #202080; /* Dark blue for night */
}

.pattern-labels {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #aaa;
}

.empty-pattern {
  width: 100%;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #777;
  font-style: italic;
  font-size: 12px;
}

.achievements-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 10px;
}

.achievement-tile {
  background-color: #101040;
  border-radius: 10px;
  padding: 15px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  transition: transform 0.2s ease;
  border: 1px solid #2a2a7a;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2);
  height: 140px; /* Fixed height for consistent rows */
  position: relative;
}

.achievement-tile:active {
  transform: scale(0.97);
}

.achievement-tile.earned {
  border-color: #5050ff;
  background-color: rgba(80, 80, 255, 0.15);
  box-shadow: 0 0 15px rgba(80, 80, 255, 0.3);
}

.achievement-tile.locked {
  opacity: 0.7;
  background-color: #0f0f35;
  border-color: #1f1f4f;
  filter: grayscale(0.8);
}

.achievement-tile.not-earned {
  opacity: 0.9;
  background-color: #151545;
  border-color: #2a2a7a;
}

.achievement-icon {
  font-size: 32px;
  margin-bottom: 8px;
  filter: drop-shadow(0 0 5px rgba(80, 80, 255, 0.5));
  width: 40px;
  height: 40px;
  object-fit: contain;
  display: flex;
  align-items: center;
  justify-content: center;
}

img.achievement-icon {
  border-radius: 50%;
  overflow: hidden;
}

.body-icon-img {
  border-radius: 50%;
  overflow: hidden;
  object-fit: contain;
  display: flex;
  filter: drop-shadow(0 0 5px rgba(80, 80, 255, 0.5));
  width: 24px;
  height: 24px;
  align-items: center;
  justify-content: center;
}

.achievement-name {
  font-size: 13px;
  font-weight: bold;
  color: white;
  text-align: center;
  margin-bottom: 4px;
}

.achievement-description {
  font-size: 11px;
  color: #aaa;
  text-align: center;
  flex-grow: 1;
}

.achievement-progress {
  margin-top: 8px;
  width: 100%;
  height: 6px;
  background-color: #0a0a2a;
  border-radius: 3px;
  overflow: hidden;
  margin-top: auto;
}

.achievement-progress-bar {
  height: 100%;
  background-color: #50ffff;
  border-radius: 3px;
}

.achievement-locked-message {
  font-style: italic;
  font-size: 12px;
  color: #888;
  text-align: center;
}

.locked-icon {
  font-size: 30px;
  opacity: 0.8;
  margin-bottom: 8px;
  filter: grayscale(1);
}

.no-achievements-message {
  grid-column: 1 / -1;
  text-align: center;
  padding: 30px;
  color: #aaa;
  font-style: italic;
  background-color: rgba(10, 10, 40, 0.5);
  border-radius: 10px;
  border: 1px dashed #2a2a7a;
}

/* Achievement tooltips */
.achievement-tooltip {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: rgba(10, 10, 42, 0.95);
  border: 2px solid #5050ff;
  border-radius: 12px;
  padding: 20px;
  width: 80%;
  max-width: 300px;
  text-align: center;
  z-index: 2000;
  box-shadow: 0 0 30px rgba(80, 80, 255, 0.5);
  display: none;
}

.tooltip-icon {
  font-size: 38px;
  margin-bottom: 15px;
}

.tooltip-title {
  font-size: 18px;
  font-weight: bold;
  color: white;
  margin-bottom: 10px;
}

.tooltip-description {
  font-size: 14px;
  color: #aaa;
  margin-bottom: 15px;
}

.tooltip-progress {
  margin: 10px 0;
}

.tooltip-progress-bar {
  height: 8px;
  background-color: #0a0a2a;
  border-radius: 4px;
  overflow: hidden;
}

.tooltip-progress-value {
  height: 100%;
  background-color: #50ffff;
  border-radius: 4px;
}

.tooltip-progress-text {
  font-size: 12px;
  color: #aaa;
  text-align: right;
  margin-top: 5px;
}

/* Loader styles */
.profile-loader {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background-color: rgba(10, 10, 42, 0.8);
  z-index: 1000;
  display: none;
}

.loader-spinner {
  width: 50px;
  height: 50px;
  border: 5px solid #1a1a4a;
  border-top: 5px solid #5050ff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 15px;
}

.loader-text {
  color: white;
  font-size: 16px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Animation for achievement unlock */
@keyframes achievement-unlock {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 rgba(80, 80, 255, 0);
  }
  50% {
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(80, 80, 255, 0.8);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 10px rgba(80, 80, 255, 0.4);
  }
}

.achievement-unlocking {
  animation: achievement-unlock 1s ease;
}
