/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-xl);
  border: none;
  border-radius: var(--radius-lg);
  font-family: var(--font-family);
  font-size: var(--font-size-md);
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-button);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
  min-height: 56px;
  min-width: 120px;
  text-align: center;
  user-select: none;
  position: relative;
  overflow: hidden;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 0 rgba(0,0,0,0.2);
}

.btn:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 rgba(0,0,0,0.2);
}

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

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

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

.btn--success {
  background: var(--color-success);
  color: var(--text-light);
}

.btn--outline {
  background: transparent;
  border: 3px solid var(--color-primary);
  color: var(--color-primary);
  box-shadow: none;
}

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

.btn--large {
  font-size: var(--font-size-lg);
  padding: var(--space-lg) var(--space-xxl);
  min-height: 72px;
  min-width: 200px;
  border-radius: var(--radius-xl);
}

.btn--small {
  font-size: var(--font-size-sm);
  padding: var(--space-sm) var(--space-md);
  min-height: 40px;
  min-width: 80px;
  border-radius: var(--radius-md);
}

.btn--round {
  width: 56px;
  height: 56px;
  min-width: auto;
  min-height: auto;
  padding: 0;
  border-radius: var(--radius-round);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Cards */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: var(--space-lg);
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.card--lesson {
  cursor: pointer;
  border: 3px solid transparent;
  position: relative;
  overflow: hidden;
}

.card--lesson.locked {
  opacity: 0.6;
  cursor: not-allowed;
  filter: grayscale(0.5);
}

.card--lesson.locked:hover {
  transform: none;
  box-shadow: var(--shadow-card);
}

.card--lesson.active {
  border-color: var(--color-accent);
  box-shadow: var(--shadow-glow);
}

.card--lesson.completed {
  border-color: var(--color-success);
}

/* Progress Bar */
.progress-bar {
  width: 100%;
  height: 16px;
  background: #E0E0E0;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
}

.progress-bar__fill {
  height: 100%;
  border-radius: 8px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
  transition: width var(--transition-slow);
  position: relative;
}

.progress-bar__fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: rgba(255,255,255,0.3);
  border-radius: 8px 8px 0 0;
}

/* Badge */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-xs);
  font-weight: 700;
  text-transform: uppercase;
}

.badge--gold {
  background: linear-gradient(135deg, #FFD700, #FFA500);
  color: #5D4E00;
}

.badge--silver {
  background: linear-gradient(135deg, #C0C0C0, #A0A0A0);
  color: #3A3A3A;
}

.badge--bronze {
  background: linear-gradient(135deg, #CD7F32, #A0522D);
  color: #FFF;
}

/* Star display */
.stars {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: var(--font-size-lg);
  font-weight: 900;
  color: var(--color-accent);
}

.stars svg {
  width: 24px;
  height: 24px;
}

/* Input */
.input {
  width: 100%;
  padding: var(--space-md) var(--space-lg);
  border: 3px solid #E0E0E0;
  border-radius: var(--radius-md);
  font-size: var(--font-size-md);
  transition: border-color var(--transition-fast);
  background: var(--bg-card);
}

.input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 4px rgba(74, 144, 217, 0.2);
}

/* Modal Backdrop */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: var(--z-modal-backdrop);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
}

.modal {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  max-width: 500px;
  width: 100%;
  z-index: var(--z-modal);
  box-shadow: var(--shadow-lg);
}

/* Tooltip */
.speech-bubble {
  position: relative;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: var(--space-md) var(--space-lg);
  box-shadow: var(--shadow-card);
  font-size: var(--font-size-md);
  max-width: 300px;
}

.speech-bubble::after {
  content: '';
  position: absolute;
  bottom: -12px;
  left: 30px;
  width: 0;
  height: 0;
  border-left: 12px solid transparent;
  border-right: 12px solid transparent;
  border-top: 14px solid var(--bg-card);
}

/* Lesson number circle */
.lesson-number {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-round);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-lg);
  font-weight: 900;
  color: white;
}

/* Lock icon overlay */
.lock-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 2rem;
  opacity: 0.7;
}

/* Avatar circle */
.avatar-circle {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-round);
  border: 4px solid var(--color-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  overflow: hidden;
}

/* PIN input */
.pin-input {
  display: flex;
  gap: var(--space-sm);
  justify-content: center;
}

.pin-digit {
  width: 56px;
  height: 64px;
  border: 3px solid #E0E0E0;
  border-radius: var(--radius-md);
  text-align: center;
  font-size: var(--font-size-xl);
  font-weight: 900;
}

.pin-digit:focus {
  border-color: var(--color-primary);
  outline: none;
}
