/* PlaySprint Profile Page Styles */
.profile-header-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 2.5rem 2rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2rem;
  position: relative;
  overflow: hidden;
}

.profile-avatar-wrapper {
  position: relative;
  width: 100px;
  height: 100px;
  background: var(--bg-tertiary);
  border: 2px solid var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.5rem;
  box-shadow: var(--shadow-glow);
  cursor: pointer;
  transition: transform 0.2s ease;
}

.profile-avatar-wrapper:hover {
  transform: scale(1.05);
}

.avatar-edit-badge {
  position: absolute;
  bottom: 0;
  right: 0;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
}

.profile-info {
  flex: 1;
  min-width: 240px;
}

.profile-name-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.profile-name {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-primary);
  border: none;
  background: transparent;
  border-bottom: 2px stroke transparent;
  transition: border-color 0.2s ease;
}

.profile-name:focus {
  outline: none;
  border-bottom-color: var(--primary);
}

.profile-rank {
  font-size: 0.9rem;
  color: var(--primary);
  font-weight: 600;
  background: rgba(59, 130, 246, 0.15);
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  display: inline-block;
}

.profile-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2.5rem;
}

.profile-stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  text-align: center;
  box-shadow: var(--shadow-md);
  transition: transform 0.2s ease;
}

.profile-stat-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-hover);
}

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

.stat-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-primary);
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.25rem;
}

/* CSS Animated Bar Charts */
.chart-container {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 1.75rem;
  margin-bottom: 2.5rem;
}

.chart-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.bar-chart {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  height: 180px;
  padding-top: 1rem;
  gap: 0.75rem;
  border-bottom: 2px solid var(--border-color);
}

.chart-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
}

.chart-bar-bg {
  width: 100%;
  max-width: 40px;
  height: 100%;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.chart-bar-fill {
  width: 100%;
  background: linear-gradient(180deg, var(--primary) 0%, var(--primary-dark) 100%);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  transition: height 1s ease-out;
}

.chart-col-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

/* Achievements Grid */
.achievements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.achievement-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: all 0.2s ease;
  position: relative;
}

.achievement-card.locked {
  opacity: 0.5;
  filter: grayscale(0.8);
}

.achievement-card.unlocked {
  border-color: rgba(34, 197, 94, 0.4);
  box-shadow: 0 4px 15px rgba(34, 197, 94, 0.1);
}

.ach-icon {
  font-size: 2.25rem;
  width: 50px;
  height: 50px;
  background: var(--bg-tertiary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ach-info {
  flex: 1;
}

.ach-title {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-primary);
  margin-bottom: 0.2rem;
}

.ach-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.3;
}

.ach-badge {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
  margin-top: 0.4rem;
  display: inline-block;
}

.ach-badge.unlocked-badge {
  background: rgba(34, 197, 94, 0.2);
  color: var(--success);
}

.ach-badge.locked-badge {
  background: var(--bg-tertiary);
  color: var(--text-muted);
}

/* History List Table */
.history-table-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  overflow: hidden;
}

.history-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.history-table th,
.history-table td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.9rem;
}

.history-table th {
  background: var(--bg-tertiary);
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
}

.history-table tr:last-child td {
  border-bottom: none;
}

/* Achievement Toast Popup Styling */
.achievement-toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  pointer-events: none;
}

.achievement-toast {
  background: linear-gradient(135deg, #1E293B 0%, #0F172A 100%);
  border: 2px solid var(--success);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 15px rgba(34, 197, 94, 0.3);
  color: white;
  min-width: 300px;
  pointer-events: auto;
}

.toast-icon {
  font-size: 2.25rem;
}

.toast-subtitle {
  font-size: 0.65rem;
  font-weight: 800;
  color: var(--success);
  letter-spacing: 0.1em;
}

.toast-title {
  font-size: 1rem;
  font-weight: 700;
}

.toast-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.achievement-toast.fade-out {
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.4s ease;
}

@media (max-width: 600px) {
  .profile-header-card {
    flex-direction: column;
    text-align: center;
  }
  .profile-name-group {
    justify-content: center;
  }
}
