/* Year-end Wrapped Styles */

/* ==================== CONTAINER ==================== */

.wrapped-container {
  position: fixed;
  inset: 0;
  background: #0f172a;
  overflow: hidden;
  touch-action: pan-y;
}

/* ==================== SLIDES ==================== */

.wrapped-slides {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.wrapped-slide {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  opacity: 0;
  transform: translateX(100%);
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

.wrapped-slide.active {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

.wrapped-slide.prev {
  opacity: 0;
  transform: translateX(-100%);
}

/* ==================== PROGRESS BAR ==================== */

.wrapped-progress {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  gap: 4px;
  padding: 1rem;
  z-index: 100;
}

.wrapped-progress-segment {
  flex: 1;
  height: 3px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  overflow: hidden;
}

.wrapped-progress-fill {
  height: 100%;
  background: #fff;
  width: 0;
  transition: width 0.3s ease;
}

.wrapped-progress-segment.completed .wrapped-progress-fill {
  width: 100%;
}

.wrapped-progress-segment.active .wrapped-progress-fill {
  width: 100%;
  animation: progressFill 5s linear forwards;
}

@keyframes progressFill {
  from { width: 0; }
  to { width: 100%; }
}

/* ==================== CLOSE BUTTON ==================== */

.wrapped-close {
  position: absolute;
  top: 2rem;
  right: 1rem;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 50%;
  color: #fff;
  font-size: 1.25rem;
  cursor: pointer;
  z-index: 101;
  transition: all 0.2s ease;
}

.wrapped-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* ==================== NAVIGATION AREAS ==================== */

.wrapped-nav-area {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 30%;
  z-index: 50;
  cursor: pointer;
}

.wrapped-nav-prev {
  left: 0;
}

.wrapped-nav-next {
  right: 0;
}

/* ==================== SLIDE BACKGROUNDS ==================== */

.wrapped-slide[data-slide="intro"] {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
}

.wrapped-slide[data-slide="tests"] {
  background: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);
}

.wrapped-slide[data-slide="type"] {
  background: linear-gradient(135deg, #ec4899 0%, #8b5cf6 100%);
}

.wrapped-slide[data-slide="streak"] {
  background: linear-gradient(135deg, #f97316 0%, #ef4444 100%);
}

.wrapped-slide[data-slide="compatibility"] {
  background: linear-gradient(135deg, #ec4899 0%, #f43f5e 100%);
}

.wrapped-slide[data-slide="level"] {
  background: linear-gradient(135deg, #10b981 0%, #14b8a6 100%);
}

.wrapped-slide[data-slide="badges"] {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.wrapped-slide[data-slide="summary"] {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
}

/* ==================== SLIDE CONTENT ==================== */

.wrapped-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  color: #fff;
  max-width: 400px;
}

.wrapped-year {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  opacity: 0.8;
  margin-bottom: 0.5rem;
}

.wrapped-title {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 1rem;
  line-height: 1.2;
}

.wrapped-subtitle {
  font-size: 1rem;
  opacity: 0.9;
  line-height: 1.6;
}

/* ==================== INTRO SLIDE ==================== */

.wrapped-logo {
  font-size: 4rem;
  margin-bottom: 1.5rem;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.wrapped-intro-title {
  font-size: 2.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, #fff 0%, #e0e7ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.5rem;
}

.wrapped-intro-subtitle {
  font-size: 1.125rem;
  opacity: 0.9;
}

.wrapped-tap-hint {
  position: absolute;
  bottom: 3rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  opacity: 0.7;
  animation: pulse 2s ease-in-out infinite;
}

.wrapped-tap-hint span {
  font-size: 0.875rem;
}

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

/* ==================== STAT SLIDE ==================== */

.wrapped-stat-value {
  font-size: 5rem;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 0.5rem;
  animation: countUp 1s ease-out forwards;
}

@keyframes countUp {
  from {
    transform: scale(0.5);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.wrapped-stat-label {
  font-size: 1.25rem;
  opacity: 0.9;
}

.wrapped-stat-detail {
  font-size: 0.875rem;
  opacity: 0.7;
  margin-top: 1rem;
}

/* ==================== TYPE SLIDE ==================== */

.wrapped-type-emoji {
  font-size: 6rem;
  margin-bottom: 1rem;
  animation: bounceIn 0.6s ease-out;
}

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

.wrapped-type-name {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.wrapped-type-count {
  font-size: 1rem;
  opacity: 0.8;
}

.wrapped-type-traits {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1.5rem;
}

.wrapped-type-trait {
  padding: 0.375rem 0.75rem;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 9999px;
  font-size: 0.75rem;
}

/* ==================== STREAK SLIDE ==================== */

.wrapped-streak-flame {
  font-size: 5rem;
  margin-bottom: 1rem;
  animation: flame 1s ease-in-out infinite;
}

@keyframes flame {
  0%, 100% { transform: scale(1) rotate(-3deg); }
  50% { transform: scale(1.1) rotate(3deg); }
}

.wrapped-streak-value {
  font-size: 4rem;
  font-weight: 800;
  margin-bottom: 0.25rem;
}

.wrapped-streak-label {
  font-size: 1.25rem;
  opacity: 0.9;
}

.wrapped-streak-calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-top: 2rem;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 1rem;
}

.wrapped-streak-day {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.1);
}

.wrapped-streak-day.active {
  background: rgba(255, 255, 255, 0.9);
}

/* ==================== COMPATIBILITY SLIDE ==================== */

.wrapped-compat-pair {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.wrapped-compat-type {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.wrapped-compat-emoji {
  font-size: 3rem;
}

.wrapped-compat-name {
  font-size: 0.875rem;
  opacity: 0.9;
}

.wrapped-compat-heart {
  font-size: 2rem;
  animation: heartbeat 1s ease-in-out infinite;
}

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

.wrapped-compat-score {
  font-size: 4rem;
  font-weight: 800;
  margin-bottom: 0.25rem;
}

.wrapped-compat-label {
  font-size: 1rem;
  opacity: 0.8;
}

/* ==================== LEVEL SLIDE ==================== */

.wrapped-level-journey {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.wrapped-level-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem 1.5rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 1rem;
}

.wrapped-level-value {
  font-size: 2.5rem;
  font-weight: 800;
}

.wrapped-level-label {
  font-size: 0.75rem;
  opacity: 0.7;
}

.wrapped-level-arrow {
  font-size: 1.5rem;
  animation: arrowPulse 1s ease-in-out infinite;
}

@keyframes arrowPulse {
  0%, 100% { transform: translateX(0); opacity: 0.5; }
  50% { transform: translateX(5px); opacity: 1; }
}

.wrapped-xp-total {
  font-size: 1.5rem;
  font-weight: 600;
}

.wrapped-xp-bar {
  width: 200px;
  height: 8px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 1rem;
}

.wrapped-xp-fill {
  height: 100%;
  background: #fff;
  border-radius: 4px;
  transition: width 1s ease-out;
}

/* ==================== BADGES SLIDE ==================== */

.wrapped-badges-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
}

.wrapped-badges-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  max-width: 300px;
}

.wrapped-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 0.75rem;
  animation: fadeInUp 0.5s ease-out forwards;
  opacity: 0;
}

.wrapped-badge:nth-child(1) { animation-delay: 0.1s; }
.wrapped-badge:nth-child(2) { animation-delay: 0.2s; }
.wrapped-badge:nth-child(3) { animation-delay: 0.3s; }
.wrapped-badge:nth-child(4) { animation-delay: 0.4s; }
.wrapped-badge:nth-child(5) { animation-delay: 0.5s; }
.wrapped-badge:nth-child(6) { animation-delay: 0.6s; }
.wrapped-badge:nth-child(7) { animation-delay: 0.7s; }
.wrapped-badge:nth-child(8) { animation-delay: 0.8s; }

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.wrapped-badge-emoji {
  font-size: 1.5rem;
}

.wrapped-badge-name {
  font-size: 0.625rem;
  opacity: 0.8;
  text-align: center;
}

.wrapped-badges-count {
  font-size: 0.875rem;
  opacity: 0.7;
  margin-top: 1rem;
}

/* ==================== SUMMARY SLIDE ==================== */

.wrapped-summary-card {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border-radius: 1.5rem;
  padding: 2rem;
  width: 100%;
  max-width: 320px;
}

.wrapped-summary-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.wrapped-summary-avatar {
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 1rem;
  font-size: 2rem;
}

.wrapped-summary-info {
  text-align: left;
}

.wrapped-summary-name {
  font-size: 1.25rem;
  font-weight: 700;
}

.wrapped-summary-type {
  font-size: 0.875rem;
  opacity: 0.8;
}

.wrapped-summary-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.wrapped-summary-stat {
  text-align: center;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 0.75rem;
}

.wrapped-summary-stat-value {
  font-size: 1.5rem;
  font-weight: 700;
}

.wrapped-summary-stat-label {
  font-size: 0.6875rem;
  opacity: 0.7;
}

.wrapped-summary-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.wrapped-share-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem;
  background: #fff;
  color: #6366f1;
  border: none;
  border-radius: 9999px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.wrapped-share-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.wrapped-home-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem;
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 9999px;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.wrapped-home-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* ==================== NOT AVAILABLE ==================== */

.wrapped-not-available {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem;
  text-align: center;
  background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #0f172a 100%);
  color: #f8fafc;
}

.wrapped-not-available-icon {
  font-size: 4rem;
  margin-bottom: 1.5rem;
  opacity: 0.5;
}

.wrapped-not-available-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.wrapped-not-available-text {
  font-size: 0.9375rem;
  color: #94a3b8;
  margin-bottom: 2rem;
  line-height: 1.6;
}

.wrapped-not-available-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  border: none;
  border-radius: 9999px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.wrapped-not-available-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

/* ==================== SHARE CANVAS ==================== */

.wrapped-share-canvas {
  position: fixed;
  top: -9999px;
  left: -9999px;
}

/* ==================== LOADING ==================== */

.wrapped-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
  color: #fff;
}

.wrapped-loading-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 1rem;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ==================== RESPONSIVE ==================== */

@media (min-width: 768px) {
  .wrapped-content {
    max-width: 500px;
  }

  .wrapped-title {
    font-size: 2.5rem;
  }

  .wrapped-stat-value {
    font-size: 6rem;
  }

  .wrapped-type-emoji {
    font-size: 8rem;
  }

  .wrapped-badges-grid {
    max-width: 400px;
  }

  .wrapped-summary-card {
    max-width: 400px;
    padding: 2.5rem;
  }
}
