/* Cards */
.card {
  background: var(--bg-card);
  border: 2px solid var(--border-card);
  border-bottom: 4px solid var(--border-card-bottom);
  border-radius: var(--radius-card);
  padding: var(--space-4);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 14px var(--space-6);
  border-radius: var(--radius-button);
  font-weight: var(--weight-heavy);
  font-size: var(--type-body);
  border: 2px solid transparent;
  border-bottom-width: 4px;
  transition: transform 100ms ease, border-bottom-width 100ms ease, opacity 120ms ease;
  min-width: var(--touch-min);
  -webkit-tap-highlight-color: transparent;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.btn-compact {
  min-height: 40px;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-button);
  font-size: var(--type-caption);
}

.btn-pill {
  border-radius: var(--radius-full);
}

.btn:active {
  border-bottom-width: 2px;
  transform: translateY(2px);
}

.btn-primary {
  background: var(--color-primary);
  border-color: var(--color-primary-dark);
  color: var(--color-text-on-dark);
}

.btn-secondary {
  background: var(--bg-surface);
  border-color: #D8C0CC;
  color: var(--color-primary);
}

.btn-outline {
  background: var(--bg-card);
  color: var(--color-primary);
  border: 2px solid var(--border-card);
  border-bottom: 4px solid var(--border-card-bottom);
}

/* Mode cards */
.mode-card {
  position: relative;
  overflow: hidden;
  margin-left: 20px;
  margin-right: 20px;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-card);
  font-family: var(--font-body);
}

.mode-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
}

.mode-card > * {
  position: relative;
  z-index: 1;
}

.mode-card-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.mode-card-icon {
  width: var(--icon-learn-mode);
  height: var(--icon-learn-mode);
  object-fit: contain;
  flex: 0 0 auto;
}

.mode-card-copy {
  flex: 1;
  min-width: 0;
}

.mode-card-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin-bottom: var(--space-1);
  padding: 3px var(--space-2);
  border-radius: var(--radius-full);
  font-size: var(--type-micro);
  font-weight: var(--weight-heavy);
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.mode-card-title {
  color: var(--color-text-primary);
  font-size: var(--type-section);
  font-weight: var(--weight-heavy);
  line-height: 1.2;
}

.mode-card-subtitle {
  color: var(--color-text-secondary);
  font-size: var(--type-body-sm);
  font-weight: var(--weight-bold);
  line-height: 1.25;
  margin-top: 2px;
}

.mode-card-cta {
  white-space: nowrap;
  flex: 0 0 auto;
}

.mode-card-review {
  background: var(--gradient-review);
}

.mode-card-repair {
  background: var(--gradient-repair);
}

.mode-card-practice {
  background: var(--gradient-practice);
}

.mode-card-exam {
  color: var(--color-text-on-dark);
  background: var(--gradient-exam);
  border-color: rgba(255, 255, 255, 0.18);
  border-bottom-color: rgba(82, 14, 68, 0.65);
  box-shadow: 0 10px 24px rgba(139, 26, 74, 0.18);
}

.mode-card-exam::after {
  opacity: 0.55;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.18), transparent 42%);
}

.mode-card-exam .mode-card-title,
.mode-card-exam .mode-card-subtitle {
  color: var(--color-text-on-dark);
}

.mode-card-exam .mode-card-subtitle {
  opacity: 0.82;
}

.mode-card-exam .mode-card-badge {
  color: rgba(255, 255, 255, 0.86);
  background: rgba(255, 255, 255, 0.16);
}

.mode-card-exam .mode-card-cta {
  color: var(--color-text-on-dark);
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.28);
  border-bottom-color: rgba(255, 255, 255, 0.16);
}

@media (max-width: 360px) {
  .mode-card {
    padding: 11px var(--space-3);
  }

  .mode-card-row {
    gap: 10px;
  }

  .mode-card-icon {
    width: var(--icon-summary);
    height: var(--icon-summary);
  }

  .mode-card-title {
    font-size: var(--type-body);
  }

  .mode-card-subtitle {
    font-size: var(--type-caption);
  }
}

@media (max-width: 380px) {
  .mode-card-exam .mode-card-row {
    display: grid;
    grid-template-columns: var(--icon-summary) minmax(0, 1fr);
    align-items: center;
  }

  .mode-card-exam .mode-card-icon {
    width: var(--icon-summary);
    height: var(--icon-summary);
    grid-row: 1 / span 2;
  }

  .mode-card-exam .mode-card-copy {
    min-width: 0;
  }

  .mode-card-exam .mode-card-title {
    white-space: nowrap;
  }

  .mode-card-exam .mode-card-cta {
    grid-column: 2;
    justify-self: start;
    margin-top: var(--space-2);
  }
}

.btn-full {
  width: 100%;
}

.btn:disabled {
  background: var(--bg-surface) !important;
  border-color: var(--border-card) !important;
  color: var(--text-hint) !important;
  pointer-events: none;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: var(--type-body-sm);
  font-weight: 700;
}

.badge-gold {
  background: var(--color-gold);
  color: #2D2D2D;
}

.badge-primary {
  background: var(--color-primary);
  color: #FFFFFF;
}

/* Progress bars */
.progress-track {
  width: 100%;
  height: 12px;
  background: var(--bg-progress-track);
  border-radius: 8px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 8px;
  background: var(--color-gold);
  box-shadow: inset 0 -2px 0 rgba(0,0,0,0.1), inset 0 2px 0 rgba(255,255,255,0.3);
  transition: width 250ms ease;
}

/* Stat row */
.stat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: var(--border-light);
}

.stat-row-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.stat-row-label svg {
  flex-shrink: 0;
}

/* Icon button */
.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--touch-min);
  height: var(--touch-min);
  border-radius: var(--radius-full);
  background: transparent;
  transition: background var(--transition-fast);
}

.icon-btn:active {
  background: var(--bg-surface);
}
