/* ===== TROPHY SYSTEM STYLES ===== */

/* Trophy Unlock Modal */
.trophy-modal {
  position: fixed;
  inset: 0;
  z-index: 6000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}

.trophy-modal.visible {
  opacity: 1;
  visibility: visible;
}

.trophy-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
}

.trophy-content {
  position: relative;
  background: linear-gradient(145deg, #2a2a2a 0%, #1a1a1a 100%);
  border-radius: 20px;
  padding: 2.5rem 2rem;
  max-width: 340px;
  width: 90%;
  text-align: center;
  border: 2px solid #ffd700;
  box-shadow:
    0 0 40px rgba(255, 215, 0, 0.3),
    0 20px 60px rgba(0, 0, 0, 0.5);
  animation: trophyBounce 0.5s ease-out;
}

@keyframes trophyBounce {
  0% { transform: scale(0.5) translateY(50px); opacity: 0; }
  60% { transform: scale(1.1) translateY(-10px); }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}

/* Trophy Icon */
.trophy-icon-wrapper {
  width: 100px;
  height: 100px;
  margin: 0 auto 1.5rem;
  background: linear-gradient(145deg, #ffd700 0%, #f0a500 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 0 30px rgba(255, 215, 0, 0.5),
    inset 0 -4px 10px rgba(0, 0, 0, 0.2);
  animation: trophyGlow 2s ease-in-out infinite;
}

@keyframes trophyGlow {
  0%, 100% { box-shadow: 0 0 30px rgba(255, 215, 0, 0.5); }
  50% { box-shadow: 0 0 50px rgba(255, 215, 0, 0.8); }
}

.trophy-icon-wrapper svg {
  width: 50px;
  height: 50px;
  fill: #1a1a1a;
}

/* Trophy Text */
.trophy-title {
  color: #ffd700;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.trophy-name {
  color: #fff;
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.trophy-description {
  color: #aaa;
  font-size: 1rem;
  margin-bottom: 1.5rem;
}

/* Theme Reward Badge */
.trophy-reward {
  margin-bottom: 1.5rem;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s, transform 0.3s;
}

.trophy-reward.visible {
  opacity: 1;
  transform: translateY(0);
}

.trophy-reward-badge {
  display: inline-block;
  background: linear-gradient(145deg, #4a0080 0%, #2a0050 100%);
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 600;
  border: 1px solid #7b00cc;
  text-transform: capitalize;
}

/* Trophy Modal Buttons */
.trophy-buttons {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
}

.trophy-btn {
  padding: 0.75rem 1.5rem;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: transform 0.15s, box-shadow 0.15s;
}

.trophy-btn:active {
  transform: scale(0.95);
}

.trophy-btn-primary {
  background: linear-gradient(145deg, #ffd700 0%, #f0a500 100%);
  color: #1a1a1a;
}

.trophy-btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.trophy-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* ===== STATISTICS TABS ===== */

.stats-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 1.5rem;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 12px;
  padding: 4px;
}

.stats-tab-btn {
  flex: 1;
  padding: 0.75rem 1rem;
  background: transparent;
  border: none;
  color: #888;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.2s, color 0.2s;
}

.stats-tab-btn.active {
  background: var(--accent, #4a90d9);
  color: #fff;
}

.stats-tab-btn:not(.active):hover {
  background: rgba(255, 255, 255, 0.1);
  color: #aaa;
}

/* Tab Content */
.stats-tab-content {
  display: none;
}

.stats-tab-content.active {
  display: block;
}

/* ===== TROPHY GRID ===== */

.trophy-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  max-height: 400px;
  overflow-y: auto;
  padding-right: 0.5rem;
}

@media (min-width: 500px) {
  .trophy-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Trophy Card */
.trophy-card {
  position: relative;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 1rem 0.75rem;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: transform 0.2s, box-shadow 0.2s;
}

.trophy-card.unlocked {
  background: rgba(255, 215, 0, 0.1);
  border-color: rgba(255, 215, 0, 0.3);
}

.trophy-card.locked {
  opacity: 0.6;
}

.trophy-card.locked .trophy-card-icon svg {
  fill: #666;
}

.trophy-card-icon {
  width: 40px;
  height: 40px;
  margin: 0 auto 0.5rem;
}

.trophy-card-icon svg {
  width: 100%;
  height: 100%;
  fill: #ffd700;
}

.trophy-card-name {
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  line-height: 1.2;
}

.trophy-card-desc {
  color: #888;
  font-size: 0.7rem;
  line-height: 1.3;
}

.trophy-card-reward {
  margin-top: 0.5rem;
  font-size: 0.65rem;
  color: #c084fc;
  font-weight: 600;
  text-transform: capitalize;
}

.trophy-card-check {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 18px;
  height: 18px;
  background: #22c55e;
  border-radius: 50%;
  color: #fff;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.trophy-card-lock {
  position: absolute;
  top: 6px;
  right: 6px;
  font-size: 12px;
  opacity: 0.5;
}

/* ===== LOCKED THEME STYLES ===== */

.theme-btn {
  position: relative;
}

.theme-btn.locked {
  opacity: 0.5;
  cursor: not-allowed;
}

.theme-btn.locked::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  border-radius: inherit;
}

.theme-lock-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1;
  font-size: 1.2rem;
  opacity: 0.8;
}

.theme-requirement {
  position: absolute;
  bottom: -20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.65rem;
  color: #888;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.2s;
}

.theme-btn.locked:hover .theme-requirement {
  opacity: 1;
}

/* Trophy Progress in Header */
.trophy-progress {
  font-size: 0.8rem;
  color: #888;
  margin-bottom: 0.5rem;
}

.trophy-progress-count {
  color: #ffd700;
  font-weight: 600;
}

/* ===== TROPHY DISCOVERABILITY ===== */

/* Trophy badge on home nav button */
.home-nav-btn {
  position: relative;
}

.trophy-badge {
  position: absolute;
  top: -6px;
  right: -8px;
  background: linear-gradient(145deg, #ffd700 0%, #f0a500 100%);
  color: #1a1a1a;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 6px;
  border-radius: 10px;
  line-height: 1;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Settings trophy link */
.settings-trophy-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  margin-bottom: 1rem;
  padding: 0.875rem 1rem;
  background: rgba(255, 215, 0, 0.1);
  border: 1px solid rgba(255, 215, 0, 0.3);
  border-radius: 12px;
  color: #fff;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}

.settings-trophy-link:hover {
  background: rgba(255, 215, 0, 0.2);
}

.settings-trophy-link:active {
  transform: scale(0.98);
}

.settings-trophy-link svg {
  width: 24px;
  height: 24px;
  fill: #ffd700;
  flex-shrink: 0;
}

.settings-trophy-link span:first-of-type {
  flex: 1;
  text-align: left;
}

.settings-trophy-count {
  background: rgba(255, 215, 0, 0.2);
  color: #ffd700;
  font-weight: 600;
  font-size: 0.8rem;
  padding: 4px 8px;
  border-radius: 6px;
}

/* ===== THEME ADAPTATIONS ===== */

/* Dark theme */
[data-theme="dark"] .trophy-content {
  background: linear-gradient(145deg, #1a1a1a 0%, #0a0a0a 100%);
}

/* Neon theme */
[data-theme="neon"] .trophy-icon-wrapper {
  background: linear-gradient(145deg, #00ff88 0%, #00cc6a 100%);
  box-shadow: 0 0 30px rgba(0, 255, 136, 0.5);
}

[data-theme="neon"] .trophy-content {
  border-color: #00ff88;
  box-shadow: 0 0 40px rgba(0, 255, 136, 0.3);
}

/* Retro theme */
[data-theme="retro"] .trophy-icon-wrapper {
  background: linear-gradient(145deg, #ff6b6b 0%, #ee5a5a 100%);
}

[data-theme="retro"] .trophy-content {
  border-color: #ff6b6b;
}

/* Ocean theme */
[data-theme="ocean"] .trophy-icon-wrapper {
  background: linear-gradient(145deg, #00d4ff 0%, #00a8cc 100%);
}

[data-theme="ocean"] .trophy-content {
  border-color: #00d4ff;
}
