/* ========================================
   LIFE GAME — Component Styles
   Cards, Bars, Buttons, Modals
   ======================================== */

/* ====== BUTTONS ====== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-lg);
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  letter-spacing: 0.05em;
  white-space: nowrap;
  font-family: var(--font-body);
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-start), var(--primary-end));
  color: white;
  box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-primary:hover {
  box-shadow: 0 6px 25px var(--primary-glow);
  transform: translateY(-1px);
}

.btn-danger {
  background: linear-gradient(135deg, var(--danger), #dc2626);
  color: white;
  box-shadow: 0 4px 15px var(--danger-glow);
}

.btn-danger:hover {
  box-shadow: 0 6px 25px var(--danger-glow);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-light);
}

.btn-ghost:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.btn-icon {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 1.2rem;
  padding: var(--space-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  border-radius: var(--radius-sm);
}

.btn-icon:hover {
  background: var(--bg-elevated);
}

.btn-sm {
  padding: var(--space-xs) var(--space-md);
  font-size: 0.8rem;
}

.btn-xs {
  padding: 2px var(--space-sm);
  font-size: 0.75rem;
}

.btn-lg {
  padding: var(--space-md) var(--space-xl);
  font-size: 1.1rem;
  border-radius: var(--radius-md);
}

.btn-block {
  width: 100%;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* ====== CARDS ====== */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  position: relative;
  overflow: hidden;
}

.card-glow {
  position: absolute;
  top: -50%;
  right: -50%;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, var(--primary-glow) 0%, transparent 70%);
  opacity: 0.3;
  pointer-events: none;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}

.card-header h3 {
  font-size: 1rem;
  font-weight: 700;
}

/* ====== BADGES ====== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px var(--space-sm);
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 700;
}

.badge-gold {
  background: rgba(245, 158, 11, 0.15);
  color: var(--gold);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-primary {
  background: rgba(124, 58, 237, 0.15);
  color: var(--primary);
  border: 1px solid rgba(124, 58, 237, 0.3);
}

.badge-sm {
  font-size: 0.7rem;
  padding: 1px 6px;
}

.badge-danger {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-success {
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

/* ====== INPUTS ====== */
.input-dark {
  width: 100%;
  background: var(--bg-deep);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: var(--space-md);
  color: var(--text-primary);
  font-size: 0.95rem;
  font-family: var(--font-body);
  transition: border-color var(--transition-fast);
  resize: vertical;
}

.input-dark:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.input-dark::placeholder {
  color: var(--text-muted);
}

.input-sm {
  width: 80px;
  padding: var(--space-xs) var(--space-sm);
  text-align: center;
}

select.input-dark {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}

/* ====== MODAL ====== */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  animation: fadeIn 0.2s ease;
}

.modal-content {
  position: relative;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  max-width: 400px;
  width: 90%;
  animation: popIn 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  text-align: center;
}

.modal-icon {
  font-size: 2.5rem;
  margin-bottom: var(--space-md);
}

.modal-content h3 {
  margin-bottom: var(--space-md);
  font-size: 1.2rem;
}

.interrupt-question {
  color: var(--text-secondary);
  margin-bottom: var(--space-md);
  font-size: 0.95rem;
  line-height: 1.6;
}

.modal-actions {
  display: flex;
  gap: var(--space-sm);
  margin-top: var(--space-lg);
}

.modal-actions .btn {
  flex: 1;
}

/* ====== XP POPUP ====== */
.xp-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--gold);
  text-shadow: 0 0 20px var(--gold-glow);
  pointer-events: none;
  z-index: 300;
  animation: xpFloat 1.5s ease-out forwards;
}

/* ====== TOAST ====== */
.toast {
  position: fixed;
  bottom: var(--space-xl);
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: var(--space-md) var(--space-xl);
  font-size: 0.9rem;
  color: var(--text-primary);
  z-index: 250;
  animation: slideInUp 0.3s ease, fadeOut 0.3s ease 2.5s forwards;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

/* ====== SUMMARY STATS IN REFLECTION ====== */
.summary-row {
  display: flex;
  justify-content: space-between;
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--border);
}

.summary-row:last-child {
  border-bottom: none;
}

.summary-label {
  color: var(--text-secondary);
}

.summary-value {
  font-weight: 700;
  color: var(--gold);
}

/* ====== CONFETTI PARTICLE ====== */
.confetti-piece {
  position: fixed;
  width: 8px;
  height: 8px;
  top: -10px;
  z-index: 300;
  pointer-events: none;
  animation: confetti 3s linear forwards;
}

/* ====== REVIEW FORM ====== */
.review-question {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  margin-bottom: var(--space-md);
}

.review-question label {
  display: block;
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 600;
  margin-bottom: var(--space-sm);
}

.review-submit-area {
  margin-top: var(--space-lg);
}

.review-past {
  margin-top: var(--space-lg);
}

.review-past h4 {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: var(--space-md);
}

.review-entry {
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: var(--space-md);
  margin-bottom: var(--space-sm);
}

.review-entry-date {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: var(--space-sm);
}

.review-entry-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}
