/**
 * @file
 * SimCzech Gamification styles.
 */

/* ── XP mini-bar (global, bottom) ── */
.sc-gamif-xpbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9998;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.4rem 1rem;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--sc-border, #334155);
  font-size: 0.8rem;
}

.sc-gamif-xpbar__info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sc-gamif-xpbar__rank {
  color: var(--sc-accent, #f59e0b);
  font-weight: 600;
}

.sc-gamif-xpbar__level {
  color: var(--sc-text, #e2e8f0);
  font-weight: 700;
}

.sc-gamif-xpbar__xp {
  color: var(--sc-text-muted, #94a3b8);
}

.sc-gamif-xpbar__bar {
  flex: 1;
  height: 6px;
  background: var(--sc-bg-card, #1e293b);
  border-radius: 3px;
  overflow: hidden;
}

.sc-gamif-xpbar__fill {
  height: 100%;
  background: linear-gradient(90deg, var(--sc-accent, #f59e0b), #fbbf24);
  border-radius: 3px;
  transition: width 0.5s ease;
}

.sc-gamif-xpbar__link {
  text-decoration: none;
  font-size: 1rem;
  padding: 0.2rem;
  transition: transform 0.2s;
}

.sc-gamif-xpbar__link:hover {
  transform: scale(1.2);
}

/* ── Toast notifications ── */
.sc-gamif-toast {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 10000;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(10px);
  border: 1px solid var(--sc-accent, #f59e0b);
  border-radius: 12px;
  opacity: 0;
  transform: translateX(100px);
  transition: all 0.3s ease;
  box-shadow: 0 4px 20px rgba(245, 158, 11, 0.2);
}

.sc-gamif-toast--visible {
  opacity: 1;
  transform: translateX(0);
}

.sc-gamif-toast__icon {
  font-size: 1.2rem;
}

.sc-gamif-toast__text {
  color: var(--sc-text, #e2e8f0);
  font-weight: 500;
  font-size: 0.9rem;
}

.sc-gamif-toast__xp {
  background: var(--sc-accent, #f59e0b);
  color: #000;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}

/* ── Daily challenge button ── */
.sc-gamif-daily-btn {
  position: fixed;
  bottom: 3rem;
  right: 1rem;
  z-index: 9999;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--sc-accent, #f59e0b);
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
  transition: transform 0.2s;
  animation: sc-gamif-pulse 2s infinite;
}

.sc-gamif-daily-btn:hover {
  transform: scale(1.1);
}

@keyframes sc-gamif-pulse {
  0%, 100% { box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3); }
  50% { box-shadow: 0 4px 25px rgba(245, 158, 11, 0.5); }
}

/* ── Daily panel ── */
.sc-gamif-daily-panel {
  position: fixed;
  bottom: 5.5rem;
  right: 1rem;
  z-index: 9999;
  width: 280px;
  background: rgba(15, 23, 42, 0.98);
  backdrop-filter: blur(15px);
  border: 1px solid var(--sc-border, #334155);
  border-radius: 16px;
  padding: 1.25rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.sc-gamif-daily-panel h3 {
  margin: 0 0 1rem;
  color: var(--sc-accent, #f59e0b);
  font-size: 1rem;
}

.sc-gamif-daily-panel__challenge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem;
  background: var(--sc-bg-card, #1e293b);
  border-radius: 8px;
  margin-bottom: 1rem;
}

.sc-gamif-daily-panel__icon {
  font-size: 1.5rem;
}

.sc-gamif-daily-panel__title {
  color: var(--sc-text, #e2e8f0);
  font-weight: 500;
  flex: 1;
}

.sc-gamif-daily-panel__reward {
  background: rgba(245, 158, 11, 0.15);
  color: var(--sc-accent, #f59e0b);
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 700;
}

.sc-gamif-daily-panel__done {
  color: #4ade80;
  text-align: center;
  margin: 0;
}

.sc-gamif-daily-panel__claim {
  width: 100%;
}

.sc-gamif-daily-panel__loading {
  color: var(--sc-text-muted, #94a3b8);
  text-align: center;
}

/* ── Leaderboard ── */
.sc-gamif {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.sc-gamif__header {
  margin-bottom: 2rem;
}

.sc-gamif__title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--sc-accent, #f59e0b);
  margin: 0;
}

.sc-gamif__subtitle {
  color: var(--sc-text-muted, #94a3b8);
  margin: 0.25rem 0 0;
}

.sc-gamif__progress-bar {
  height: 8px;
  background: var(--sc-bg-card, #1e293b);
  border-radius: 4px;
  margin-top: 0.75rem;
  overflow: hidden;
}

.sc-gamif__progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--sc-accent, #f59e0b), #fbbf24);
  border-radius: 4px;
  transition: width 0.5s ease;
}

.sc-gamif__own-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 12px;
  margin-bottom: 1.5rem;
}

.sc-gamif__own-rank {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--sc-accent, #f59e0b);
  min-width: 3rem;
  text-align: center;
}

.sc-gamif__own-info {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.sc-gamif__own-info strong {
  color: var(--sc-text, #e2e8f0);
  font-size: 1.1rem;
}

.sc-gamif__own-info span {
  color: var(--sc-text-muted, #94a3b8);
  font-size: 0.85rem;
}

.sc-gamif__own-xp {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--sc-accent, #f59e0b);
}

/* Leaderboard list */
.sc-gamif__leaderboard {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.sc-gamif__player {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: var(--sc-bg-card, #1e293b);
  border: 1px solid var(--sc-border, #334155);
  border-radius: 10px;
  transition: border-color 0.2s;
}

.sc-gamif__player:hover {
  border-color: rgba(245, 158, 11, 0.3);
}

.sc-gamif__player--top {
  border-color: rgba(245, 158, 11, 0.2);
  background: rgba(245, 158, 11, 0.05);
}

.sc-gamif__player--self {
  border-color: var(--sc-accent, #f59e0b);
}

.sc-gamif__player-rank {
  min-width: 2.5rem;
  text-align: center;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--sc-text-muted, #94a3b8);
}

.sc-gamif__player-info {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.sc-gamif__player-name {
  color: var(--sc-text, #e2e8f0);
  font-weight: 600;
  text-decoration: none;
}

.sc-gamif__player-name:hover {
  color: var(--sc-accent, #f59e0b);
}

.sc-gamif__player-rank-title {
  color: var(--sc-text-muted, #94a3b8);
  font-size: 0.8rem;
}

.sc-gamif__player-stats {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.sc-gamif__player-level {
  color: var(--sc-accent, #f59e0b);
  font-weight: 700;
  font-size: 0.9rem;
}

.sc-gamif__player-xp {
  color: var(--sc-text-muted, #94a3b8);
  font-size: 0.85rem;
}

.sc-gamif__player-badges {
  display: flex;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--sc-text-muted, #94a3b8);
}

.sc-gamif__empty {
  text-align: center;
  padding: 3rem;
  color: var(--sc-text-muted, #94a3b8);
}

/* ── Profile ── */
.sc-gamif-profile__card {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1.5rem 2rem;
  background: var(--sc-bg-card, #1e293b);
  border: 1px solid var(--sc-border, #334155);
  border-radius: 16px;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.sc-gamif-profile__avatar {
  font-size: 3rem;
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(245, 158, 11, 0.1);
  border-radius: 50%;
  border: 2px solid var(--sc-accent, #f59e0b);
}

.sc-gamif-profile__info {
  flex: 1;
  min-width: 200px;
}

.sc-gamif-profile__name {
  font-size: 1.5rem;
  color: var(--sc-text, #e2e8f0);
  margin: 0;
}

.sc-gamif-profile__rank {
  color: var(--sc-accent, #f59e0b);
  font-weight: 500;
}

.sc-gamif-profile__meta {
  color: var(--sc-text-muted, #94a3b8);
  font-size: 0.85rem;
  margin-top: 0.25rem;
}

.sc-gamif-profile__xp-block {
  min-width: 200px;
  text-align: right;
}

.sc-gamif-profile__xp-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--sc-accent, #f59e0b);
}

.sc-gamif-profile__xp-bar {
  height: 8px;
  background: var(--sc-bg, #0f172a);
  border-radius: 4px;
  overflow: hidden;
  margin: 0.5rem 0 0.25rem;
}

.sc-gamif-profile__xp-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--sc-accent, #f59e0b), #fbbf24);
  border-radius: 4px;
}

.sc-gamif-profile__xp-next {
  color: var(--sc-text-muted, #94a3b8);
  font-size: 0.8rem;
}

.sc-gamif-profile__section {
  margin-bottom: 2rem;
}

.sc-gamif-profile__section h2 {
  font-size: 1.25rem;
  color: var(--sc-text, #e2e8f0);
  margin: 0 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--sc-border, #334155);
}

/* Achievements grid */
.sc-gamif-profile__achievements {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 0.75rem;
}

.sc-gamif-profile__achievement {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--sc-bg-card, #1e293b);
  border: 1px solid var(--sc-border, #334155);
  border-radius: 10px;
  transition: all 0.2s;
}

.sc-gamif-profile__achievement--locked {
  opacity: 0.4;
  filter: grayscale(0.8);
}

.sc-gamif-profile__achievement--unlocked {
  border-color: rgba(245, 158, 11, 0.2);
}

.sc-gamif-profile__ach-icon {
  font-size: 1.5rem;
  min-width: 2rem;
  text-align: center;
}

.sc-gamif-profile__ach-info {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.sc-gamif-profile__ach-info strong {
  color: var(--sc-text, #e2e8f0);
  font-size: 0.9rem;
}

.sc-gamif-profile__ach-info span {
  color: var(--sc-text-muted, #94a3b8);
  font-size: 0.8rem;
}

.sc-gamif-profile__ach-info small {
  color: var(--sc-text-muted, #94a3b8);
  font-size: 0.7rem;
  margin-top: 0.2rem;
}

.sc-gamif-profile__ach-xp {
  color: var(--sc-accent, #f59e0b);
  font-weight: 700;
  font-size: 0.85rem;
}

/* Activity */
.sc-gamif-profile__activity {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.sc-gamif-profile__activity-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: var(--sc-bg-card, #1e293b);
  border-radius: 8px;
}

.sc-gamif-profile__activity-badge {
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  min-width: 5rem;
  text-align: center;
}

.sc-gamif-profile__activity-badge--xp {
  background: rgba(245, 158, 11, 0.15);
  color: var(--sc-accent, #f59e0b);
}

.sc-gamif-profile__activity-badge--level {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
}

.sc-gamif-profile__activity-text {
  flex: 1;
  color: var(--sc-text, #e2e8f0);
  font-size: 0.85rem;
}

.sc-gamif-profile__activity-time {
  color: var(--sc-text-muted, #94a3b8);
  font-size: 0.75rem;
}

/* ── Achievements page ── */
.sc-gamif-achievements__category {
  margin-bottom: 2rem;
}

.sc-gamif-achievements__cat-title {
  font-size: 1.15rem;
  color: var(--sc-text, #e2e8f0);
  margin: 0 0 0.75rem;
  font-weight: 600;
}

.sc-gamif-achievements__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.75rem;
}

.sc-gamif-achievements__item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--sc-bg-card, #1e293b);
  border: 1px solid var(--sc-border, #334155);
  border-radius: 10px;
  position: relative;
  transition: all 0.2s;
}

.sc-gamif-achievements__item:not(.sc-gamif-achievements__item--unlocked) {
  opacity: 0.5;
  filter: grayscale(0.7);
}

.sc-gamif-achievements__item--unlocked {
  border-color: rgba(245, 158, 11, 0.2);
}

.sc-gamif-achievements__item--unlocked:hover {
  border-color: var(--sc-accent, #f59e0b);
  transform: translateY(-1px);
}

.sc-gamif-achievements__icon {
  font-size: 1.75rem;
  min-width: 2.5rem;
  text-align: center;
}

.sc-gamif-achievements__text {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.sc-gamif-achievements__text strong {
  color: var(--sc-text, #e2e8f0);
  font-size: 0.9rem;
}

.sc-gamif-achievements__text span {
  color: var(--sc-text-muted, #94a3b8);
  font-size: 0.8rem;
}

.sc-gamif-achievements__reward {
  color: var(--sc-accent, #f59e0b);
  font-weight: 700;
  font-size: 0.85rem;
}

.sc-gamif-achievements__check {
  position: absolute;
  top: -0.3rem;
  right: -0.3rem;
  font-size: 0.9rem;
}

/* ── Responsive ── */
@media (max-width: 640px) {
  .sc-gamif-xpbar {
    padding: 0.3rem 0.5rem;
    font-size: 0.7rem;
  }

  .sc-gamif-profile__card {
    flex-direction: column;
    text-align: center;
  }

  .sc-gamif-profile__xp-block {
    text-align: center;
    width: 100%;
  }

  .sc-gamif__player {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .sc-gamif__player-badges {
    width: 100%;
    justify-content: flex-end;
  }
}

/* === Profile Stats Grid === */
.sc-gamif-profile__stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}

.sc-gamif-profile__stat {
  background: var(--sc-surface, #1a1a2e);
  border-radius: 12px;
  padding: 1.2rem 0.8rem;
  text-align: center;
  border: 1px solid var(--sc-border, #2a2a4a);
  transition: transform 0.2s, box-shadow 0.2s;
}

.sc-gamif-profile__stat:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.sc-gamif-profile__stat-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--sc-primary, #00d4ff);
  line-height: 1;
  margin-bottom: 0.4rem;
}

.sc-gamif-profile__stat-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--sc-text-muted, #8888aa);
  font-weight: 500;
}