/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius);
  font-size: var(--fs-md);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  gap: 8px;
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: #5A4BD1;
}

.btn-secondary {
  background: var(--secondary);
  color: white;
}

.btn-secondary:hover {
  background: #00B5B0;
}

.btn-accent {
  background: var(--accent);
  color: white;
}

.btn-accent:hover {
  background: #E8608B;
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--primary);
  color: var(--primary);
}

.btn-outline:hover {
  background: var(--primary);
  color: white;
}

.btn-coin {
  background: var(--warning);
  color: var(--bg-dark);
  font-size: var(--fs-sm);
}

.btn-coin:hover {
  background: #F0B93B;
}

.btn-block {
  width: 100%;
}

.btn-sm {
  padding: 8px 16px;
  font-size: var(--fs-sm);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Cards */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 16px;
}

/* Category & Difficulty Selection */
.category-card {
  border: 2px solid transparent;
  transition: var(--transition);
}

.category-card.active {
  border-color: var(--primary);
  background: rgba(108, 92, 231, 0.08);
  box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.15);
}

.category-card:hover {
  border-color: rgba(108, 92, 231, 0.4);
}

label.card.active {
  border: 2px solid var(--primary);
  background: rgba(108, 92, 231, 0.08);
  box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.15);
}

label.card {
  border: 2px solid transparent;
  transition: var(--transition);
}

label.card:hover {
  border-color: rgba(108, 92, 231, 0.4);
}

/* Inputs */
.input {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-size: var(--fs-md);
  transition: var(--transition);
  outline: none;
  background: white;
}

.input:focus {
  border-color: var(--primary);
}

.input-group {
  display: flex;
  gap: 8px;
}

/* Badges */
.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: var(--fs-xs);
  font-weight: 600;
}

.badge-primary {
  background: rgba(162, 155, 254, 0.2);
  color: var(--primary);
}

.badge-success {
  background: rgba(0, 184, 148, 0.2);
  color: var(--success);
}

.badge-warning {
  background: rgba(253, 203, 110, 0.2);
  color: #E17D24;
}

/* Loading */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* Toast */
.toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 24px;
  border-radius: var(--radius);
  color: white;
  font-weight: 600;
  z-index: 2000;
  animation: slideDown 0.3s ease;
  white-space: nowrap;
}

.toast-success {
  background: var(--success);
}

.toast-error {
  background: var(--danger);
}

.toast-info {
  background: var(--primary);
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translate(-50%, -20px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal {
  background: white;
  border-radius: var(--radius);
  padding: 24px;
  max-width: 90%;
  width: 360px;
}

.modal__title {
  font-size: var(--fs-lg);
  font-weight: 700;
  margin-bottom: 12px;
}

.modal__body {
  margin-bottom: 20px;
  color: var(--text-light);
}

.modal__actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* Coin Display */
.coin-display {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 700;
  color: #F39C12;
}

/* Progress Bar */
.progress-bar {
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar__fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s ease;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-light);
}

.empty-state__icon {
  font-size: 3rem;
  margin-bottom: 12px;
}

.empty-state__text {
  font-size: var(--fs-md);
}

/* Utility */
.hidden {
  display: none !important;
}

.text-center {
  text-align: center;
}

.mt-sm {
  margin-top: var(--space-sm);
}

.mt-md {
  margin-top: var(--space-md);
}

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

.mb-sm {
  margin-bottom: var(--space-sm);
}

.mb-md {
  margin-bottom: var(--space-md);
}

.mb-lg {
  margin-bottom: var(--space-lg);
}
