/* ==========================================================================
   PINTAR MATH KIDS - UI COMPONENTS
   ========================================================================== */

/* 1. 3D Preschool Buttons */
.btn-3d {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.25rem;
  padding: 14px 28px;
  border-radius: var(--radius-full);
  border: none;
  cursor: pointer;
  outline: none;
  text-decoration: none;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), background-color var(--transition-fast);
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.2);
}

.btn-3d:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.2) !important;
}

.btn-primary {
  background-color: var(--coral-accent);
  color: #FFFFFF;
  box-shadow: var(--shadow-3d-coral);
}

.btn-primary:hover {
  background-color: #FFAC33;
}

.btn-secondary {
  background-color: var(--primary-teal);
  color: #FFFFFF;
  box-shadow: var(--shadow-3d-teal);
}

.btn-secondary:hover {
  background-color: #3CD0C4;
}

.btn-yellow {
  background-color: var(--sunny-yellow);
  color: var(--text-main);
  box-shadow: var(--shadow-3d-yellow);
}

.btn-yellow:hover {
  background-color: #FFC87A;
}

.btn-pulse {
  animation: pulseGlow 2s infinite;
}

.btn-icon {
  width: 54px;
  height: 54px;
  padding: 0;
  border-radius: 50%;
  font-size: 1.5rem;
}

/* 2. Header Stats Bar & Profile Pill */
.stats-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  z-index: 20;
}

.profile-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--primary-teal-light);
  padding: 6px 14px 6px 8px;
  border-radius: var(--radius-full);
  border: 2px solid var(--primary-teal);
}

.avatar-mini {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.player-name {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--primary-teal-dark);
}

.counters-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.counter-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #FFFFFF;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.1rem;
  border: 1px solid rgba(0,0,0,0.05);
}

.counter-pill.stars { color: #D97E00; border-color: #FFE0A3; }
.counter-pill.coins { color: #B26A00; border-color: #FFE5B4; }
.counter-pill.streak { color: #E76F51; border-color: #FFDBD5; }

/* Custom Coin Icon Badge - Universal Font Support Fix */
.coin-icon-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  background: linear-gradient(135deg, #FFE066, #FF9F1C);
  color: #FFFFFF;
  border-radius: 50%;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 0.75rem;
  border: 2px solid #D97E00;
  box-shadow: 0 2px 4px rgba(0,0,0,0.12);
  line-height: 1;
  user-select: none;
}

/* 3. Cards & Game Tiles */
.game-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  box-shadow: var(--shadow-md);
  border: 3px solid #FFFFFF;
  transition: transform var(--transition-bounce), box-shadow var(--transition-bounce);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.game-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: var(--shadow-lg);
}

.game-card-icon {
  font-size: 4rem;
  margin-bottom: 12px;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.1));
}

.game-card-title {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
}

.game-card-subtitle {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

/* 4. Progress Bars */
.progress-bar-container {
  width: 100%;
  height: 20px;
  background: #EAEAEA;
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--coral-accent), var(--sunny-yellow));
  border-radius: var(--radius-full);
  transition: width 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* 5. Modals & Overlays */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(43, 45, 66, 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: #FFFFFF;
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  max-width: 480px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow-lg);
  transform: scale(0.8);
  transition: transform 0.3s var(--transition-bounce);
  border: 4px solid var(--primary-teal-light);
}

.modal-overlay.active .modal-card {
  transform: scale(1);
}

/* 6. PWA Install Banner */
.pwa-install-banner {
  display: none;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, var(--soft-purple), #7B2CBF);
  color: #FFFFFF;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  box-shadow: var(--shadow-md);
  animation: popIn 0.5s ease forwards;
}

.pwa-install-banner.active {
  display: flex;
}

.pwa-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pwa-icon {
  font-size: 1.8rem;
}

.pwa-text-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1rem;
}

.pwa-text-sub {
  font-size: 0.82rem;
  opacity: 0.9;
}
