/* Chao Garden Aesthetic - Sonic Adventure 2 Inspired */

.chao-stats-container {
  font-family: 'Fredoka', 'Comic Neue', sans-serif;
}

.chao-header {
  background: linear-gradient(135deg, rgba(100, 180, 255, 0.9), rgba(80, 160, 240, 0.9));
  border: 4px solid rgba(255, 255, 255, 0.6);
  border-radius: 35px;
  padding: 2rem;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(10px);
  margin-bottom: 2rem;
  text-align: center;
  position: relative;
}

.chao-character-name {
  font-size: 3rem;
  font-weight: 700;
  color: white;
  text-shadow: 3px 3px 0px rgba(0, 0, 0, 0.3);
  margin: 0;
  letter-spacing: 1px;
}

.chao-character-level {
  font-size: 1.8rem;
  font-weight: 600;
  color: #FFD700;
  text-shadow: 2px 2px 0px rgba(0, 0, 0, 0.3);
  margin-top: 0.5rem;
}

.chao-overall-progress {
  margin-top: 1.5rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.chao-overall-progress-bar {
  width: 100%;
  height: 32px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 16px;
  border: 3px solid rgba(255, 255, 255, 0.5);
  overflow: hidden;
  position: relative;
  margin-bottom: 0.75rem;
}

.chao-overall-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #FFD700, #FFA500, #FF8C00);
  border-radius: 14px;
  transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.6);
  position: relative;
  overflow: hidden;
}

.chao-overall-progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.4) 50%,
    transparent 100%
  );
  animation: shimmer-overall 2s infinite;
}

@keyframes shimmer-overall {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

.chao-overall-progress-text {
  text-align: center;
  font-size: 1rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.chao-sync-btn {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: rgba(255, 255, 255, 0.3);
  border: 3px solid rgba(255, 255, 255, 0.5);
  border-radius: 18px;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: 'Fredoka', 'Comic Neue', sans-serif;
  color: white;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.chao-sync-btn:hover {
  background: rgba(255, 255, 255, 0.45);
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.chao-sync-btn:active {
  transform: translateY(0) scale(1);
}

.chao-stats-box {
  background: rgba(100, 180, 255, 0.85);
  border: 4px solid rgba(255, 255, 255, 0.6);
  border-radius: 35px;
  padding: 2.5rem;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(10px);
  margin-bottom: 2rem;
}

.chao-stats-grid {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.chao-stat-card {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0;
  animation: bounceIn 0.6s ease-out;
}

.chao-stat-card:nth-child(1) { animation-delay: 0.1s; }
.chao-stat-card:nth-child(2) { animation-delay: 0.2s; }
.chao-stat-card:nth-child(3) { animation-delay: 0.3s; }
.chao-stat-card:nth-child(4) { animation-delay: 0.4s; }

@keyframes bounceIn {
  0% {
    opacity: 0;
    transform: scale(0.3);
  }
  50% {
    transform: scale(1.05);
  }
  70% {
    transform: scale(0.9);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

.chao-stat-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 180px;
  flex-shrink: 0;
}

.chao-stat-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-weight: 900;
  font-size: 1.1rem;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
  flex-shrink: 0;
}

.chao-stat-icon.strength {
  background: linear-gradient(135deg, #FF6B00, #CC4400);
  color: white;
}

.chao-stat-icon.endurance {
  background: linear-gradient(135deg, #00FF88, #00CC66);
  color: white;
}

.chao-stat-icon.agility {
  background: linear-gradient(135deg, #FFD700, #CC9900);
  color: #333;
}

.chao-stat-name {
  font-size: 1.5rem;
  font-weight: 700;
  color: white;
  text-shadow: 2px 2px 0px rgba(0, 0, 0, 0.3);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.chao-stat-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.chao-stat-level-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.chao-stat-level {
  font-size: 1.3rem;
  font-weight: 700;
  color: #FFD700;
  text-shadow: 2px 2px 0px rgba(0, 0, 0, 0.3);
  min-width: 60px;
  text-align: right;
}

.chao-progress-container {
  display: flex;
  gap: 6px;
  flex: 1;
}

.chao-progress-segment {
  flex: 1;
  height: 28px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.chao-progress-segment.filled {
  border-color: rgba(255, 255, 255, 0.8);
  transform: scale(1.05);
}

.chao-progress-segment.partial {
  border-color: rgba(255, 255, 255, 0.6);
}

.chao-progress-segment-fill {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  transform-origin: left;
}

.chao-progress-segment-fill.strength {
  background: linear-gradient(135deg, #FF6B00, #FF8533);
}

.chao-progress-segment-fill.endurance {
  background: linear-gradient(135deg, #00FF88, #33FFAA);
}

.chao-progress-segment-fill.agility {
  background: linear-gradient(135deg, #FFD700, #FFE066);
}

.chao-progress-segment.filled .chao-progress-segment-fill {
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.85;
  }
}

/* Segment mode-specific styling */
.chao-progress-container.milestone-mode .chao-progress-segment {
  min-width: 60px;
  border-width: 3px;
}

.chao-progress-container.grouped-mode .chao-progress-segment {
  min-width: 40px;
}

.chao-progress-container.one-to-one-mode .chao-progress-segment {
  min-width: 30px;
}

/* Next-to-fill animation */
.chao-progress-segment.next-to-fill {
  animation: pulse-next 2s ease-in-out infinite;
}

@keyframes pulse-next {
  0%, 100% {
    border-color: rgba(255, 255, 255, 0.4);
  }
  50% {
    border-color: rgba(255, 255, 255, 0.8);
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.5);
  }
}

.chao-xp-info {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 600;
  text-shadow: 1px 1px 0px rgba(0, 0, 0, 0.2);
}

.chao-workout-hint {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.75);
  font-weight: 500;
  font-style: italic;
  margin-top: 0.25rem;
  text-shadow: 1px 1px 0px rgba(0, 0, 0, 0.2);
}

.chao-hint-note {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.6);
  font-weight: 400;
}

.chao-activities-section {
  background: rgba(100, 180, 255, 0.85);
  border: 4px solid rgba(255, 255, 255, 0.6);
  border-radius: 35px;
  padding: 2rem;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(10px);
}

.chao-activities-header {
  font-size: 2rem;
  font-weight: 700;
  color: white;
  text-shadow: 2px 2px 0px rgba(0, 0, 0, 0.3);
  margin-bottom: 1.5rem;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

.chao-activities-header::before,
.chao-activities-header::after {
  content: '';
  width: 40px;
  height: 3px;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 2px;
}

.chao-activity-item {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 20px;
  padding: 1.2rem 1.5rem;
  margin-bottom: 1rem;
  border: 3px solid rgba(255, 255, 255, 0.5);
  transition: all 0.3s ease;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  position: relative;
}

.chao-activity-item:hover {
  background: rgba(255, 255, 255, 0.45);
}

.chao-activity-content {
  flex: 1;
}

.chao-activity-name {
  font-size: 1.3rem;
  font-weight: 700;
  color: white;
  text-shadow: 1px 1px 0px rgba(0, 0, 0, 0.2);
  margin-bottom: 0.5rem;
}

.chao-activity-details {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.95);
  font-weight: 600;
}

.chao-activity-type {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 500;
  margin-top: 0.25rem;
}

.chao-activity-stats {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: flex-end;
}

.chao-stat-contribution {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: white;
}

.chao-stat-icon-small {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  font-weight: 900;
  font-size: 0.7rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  flex-shrink: 0;
}

.chao-stat-icon-small.strength {
  background: linear-gradient(135deg, #CC4400, #FF6B00);
  color: white;
}

.chao-stat-icon-small.endurance {
  background: linear-gradient(135deg, #00CC66, #00FF88);
  color: white;
}

.chao-stat-icon-small.agility {
  background: linear-gradient(135deg, #CC9900, #FFD700);
  color: #333;
}

.chao-loading {
  text-align: center;
  padding: 2rem;
  color: white;
  font-size: 1.2rem;
}

/* Expandable Activity Card */
.chao-activity-item {
  cursor: pointer;
  position: relative;
}

.chao-activity-expand-hint {
  position: absolute;
  bottom: 0.6rem;
  right: 1.5rem;
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Add breathing room on desktop for the hint */
@media (min-width: 769px) {
  .chao-activity-item:not(.expanded) {
    padding-bottom: 2.75rem;
  }
}

.chao-activity-item.expanded .chao-activity-expand-hint {
  display: none;
}

.chao-activity-breakdown {
  display: none;
  width: 100%;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px dashed rgba(255, 255, 255, 0.3);
}

.chao-activity-item.expanded .chao-activity-breakdown {
  display: block;
}

.chao-xp-formula {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
  padding: 1rem;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.85rem;
}

.chao-formula-row {
  display: flex;
  justify-content: space-between;
  padding: 0.3rem 0;
  color: rgba(255, 255, 255, 0.85);
}

.chao-formula-subtotal {
  color: rgba(255, 255, 255, 0.95);
}

.chao-formula-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.2);
  margin: 0.5rem 0;
}

.chao-formula-intensity {
  color: #90EE90;
}

.chao-formula-total {
  font-weight: 700;
  color: white;
  font-size: 0.95rem;
}

.chao-intensity-note {
  margin-top: 0.75rem;
  padding: 0.75rem;
  background: rgba(255, 200, 50, 0.2);
  border-radius: 8px;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.95);
  text-align: center;
}

.chao-activity-collapse-hint {
  text-align: center;
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

@media (max-width: 768px) {
  .chao-header {
    padding: 1.5rem 1rem 1.5rem 1rem;
    padding-top: 3.5rem; /* Make room for sync button */
  }

  .chao-sync-btn {
    top: 1rem;
    right: 1rem;
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    border-radius: 12px;
  }

  .chao-character-name {
    font-size: 2rem;
  }

  .chao-character-level {
    font-size: 1.4rem;
  }

  .chao-overall-progress {
    max-width: 100%;
  }

  .chao-overall-progress-bar {
    height: 28px;
  }

  .chao-overall-progress-text {
    font-size: 0.9rem;
  }

  .chao-stats-box {
    padding: 1.5rem 1rem;
  }

  .chao-stat-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .chao-stat-label {
    min-width: auto;
    width: 100%;
    justify-content: center;
  }

  .chao-stat-name {
    font-size: 1.2rem;
  }

  .chao-stat-info {
    width: 100%;
  }

  .chao-stat-level-bar {
    flex-direction: column-reverse;
    gap: 0.75rem;
  }

  .chao-stat-level {
    text-align: center;
    min-width: auto;
  }

  .chao-progress-container {
    width: 100%;
  }

  /* Mobile-specific segment sizing */
  .chao-progress-segments {
    gap: 3px; /* Reduce gap on mobile */
  }

  .chao-progress-segment {
    min-width: 0; /* Remove min-width constraint */
    height: 24px; /* Slightly smaller height */
  }

  .chao-progress-container.one-to-one-mode .chao-progress-segment {
    min-width: 0; /* Override desktop min-width */
    flex: 1; /* Equal distribution */
  }

  .chao-progress-container.grouped-mode .chao-progress-segment {
    min-width: 0;
    flex: 1;
  }

  .chao-progress-container.milestone-mode .chao-progress-segment {
    min-width: 0;
    flex: 1;
    border-width: 2px; /* Thinner borders on mobile */
  }

  .chao-xp-info {
    font-size: 0.8rem;
    text-align: center;
  }

  .chao-workout-hint {
    font-size: 0.75rem;
    text-align: center;
  }

  .chao-hint-note {
    font-size: 0.7rem;
    display: block;
    margin-top: 0.25rem;
  }

  .chao-activities-section {
    padding: 1.5rem 1rem;
  }

  .chao-activities-header {
    font-size: 1.5rem;
  }

  .chao-activity-item {
    flex-direction: column;
    align-items: flex-start;
    padding: 1rem;
    padding-bottom: 2rem;
  }

  .chao-activity-stats {
    flex-direction: row;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.5rem;
  }

  .chao-activity-name {
    font-size: 1.1rem;
  }

  .chao-activity-details {
    font-size: 0.9rem;
  }

  .chao-activity-expand-hint {
    bottom: 0.5rem;
    right: 50%;
    transform: translateX(50%);
  }
}
