/* ============================================
   Tamil Learning Module — Components
   ============================================ */

/* ── Cards ── */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  padding: var(--space-2xl);
  box-shadow: var(--shadow-card);
  cursor: pointer;
  transition: transform var(--transition-slow), box-shadow var(--transition-slow);
  position: relative;
  overflow: hidden;
  border: 1px solid transparent;
}

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

.card:active {
  transform: translateY(-2px);
}

/* Locked Card */
.card--locked {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
  filter: grayscale(0.15);
}

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

.card--locked .card__lock-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  border-radius: var(--radius-xl);
}

.card__lock-icon {
  font-size: 2rem;
  opacity: 0.7;
  background: rgba(255, 255, 255, 0.85);
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
}

/* Card Icon */
.card__icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: var(--space-base);
}

.card__icon--coral { background: var(--accent-coral-light); color: var(--accent-coral); }
.card__icon--teal { background: var(--accent-teal-light); color: var(--accent-teal); }
.card__icon--violet { background: var(--accent-violet-light); color: var(--accent-violet); }
.card__icon--amber { background: var(--accent-amber-light); color: var(--accent-amber); }
.card__icon--blue { background: var(--accent-blue-light); color: var(--accent-blue); }
.card__icon--rose { background: var(--accent-rose-light); color: var(--accent-rose); }
.card__icon--emerald { background: var(--accent-emerald-light); color: var(--accent-emerald); }
.card__icon--indigo { background: var(--accent-indigo-light); color: var(--accent-indigo); }

/* Card Title */
.card__title {
  font-size: var(--fs-xl);
  font-weight: var(--fw-bold);
  margin-bottom: var(--space-sm);
  color: var(--text-primary);
}

/* Card Description */
.card__desc {
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  line-height: var(--lh-relaxed);
  margin-bottom: var(--space-base);
}

/* ── Language / Level Select Card (Large Centered) ── */
.card--select {
  text-align: center;
  padding: var(--space-3xl) var(--space-2xl);
  min-width: 260px;
  flex: 1;
  max-width: 340px;
}

.card--select .card__icon {
  width: 72px;
  height: 72px;
  font-size: 2rem;
  margin: 0 auto var(--space-lg);
}

.card--select .card__title {
  font-size: var(--fs-2xl);
}

/* ── Tags ── */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-bottom: var(--space-base);
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  letter-spacing: 0.02em;
}

.tag--coral { background: var(--accent-coral-light); color: var(--accent-coral); }
.tag--teal { background: var(--accent-teal-light); color: var(--accent-teal); }
.tag--violet { background: var(--accent-violet-light); color: var(--accent-violet); }
.tag--amber { background: var(--accent-amber-light); color: var(--accent-amber); }
.tag--blue { background: var(--accent-blue-light); color: var(--accent-blue); }
.tag--rose { background: var(--accent-rose-light); color: var(--accent-rose); }
.tag--emerald { background: var(--accent-emerald-light); color: var(--accent-emerald); }
.tag--indigo { background: var(--accent-indigo-light); color: var(--accent-indigo); }
.tag--locked { background: #f3f4f6; color: var(--text-muted); }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 10px 24px;
  border-radius: var(--radius-pill);
  font-weight: var(--fw-semibold);
  font-size: var(--fs-base);
  transition: all var(--transition-base);
  letter-spacing: 0.01em;
}

.btn--primary {
  background: var(--primary-gradient);
  color: var(--text-white);
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.3);
}

.btn--primary:hover {
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
  transform: translateY(-1px);
}

.btn--primary:active {
  transform: translateY(0);
}

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

.btn--secondary:hover {
  background: var(--bg-card);
  border-color: var(--border-medium);
}

.btn--success {
  background: linear-gradient(135deg, #10b981 0%, #36b5a0 100%);
  color: var(--text-white);
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}

.btn--success:hover {
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
  transform: translateY(-1px);
}

.btn--ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: 8px 16px;
}

.btn--ghost:hover {
  color: var(--text-primary);
  background: rgba(0, 0, 0, 0.04);
}

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

.btn--lg {
  padding: 14px 32px;
  font-size: var(--fs-md);
}

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

.btn--full {
  width: 100%;
}

/* ── Progress Bar ── */
.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--bg-primary);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.progress-bar__fill {
  height: 100%;
  border-radius: var(--radius-pill);
  background: var(--primary-gradient);
  transition: width var(--transition-slow);
  min-width: 0;
}

.progress-bar--sm {
  height: 6px;
}

.progress-bar--lg {
  height: 12px;
}

/* ── Badges ── */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  font-size: 2rem;
  position: relative;
}

.badge--earned {
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.2);
}

.badge--locked {
  opacity: 0.35;
  filter: grayscale(1);
}

.badge__label {
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  text-align: center;
  margin-top: var(--space-sm);
  color: var(--text-secondary);
}

/* ── Star Display ── */
.stars {
  display: flex;
  gap: 4px;
  font-size: 1.25rem;
}

.star--filled {
  color: var(--accent-amber);
  text-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

.star--empty {
  color: #e5e7eb;
}

/* ── XP Display ── */
.xp-display {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  background: var(--accent-amber-light);
  color: var(--accent-amber);
  font-weight: var(--fw-semibold);
  font-size: var(--fs-sm);
}

/* ── Upload Zone ── */
.upload-zone {
  border: 2px dashed var(--border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-3xl);
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-base);
  background: var(--bg-primary);
}

.upload-zone:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.upload-zone.active {
  border-color: var(--primary);
  background: var(--primary-light);
}

.upload-zone__icon {
  font-size: 2.5rem;
  margin-bottom: var(--space-md);
  opacity: 0.6;
}

.upload-zone__text {
  font-size: var(--fs-sm);
  color: var(--text-secondary);
}

.upload-zone__text strong {
  color: var(--primary);
}

/* ── Text Area ── */
.textarea {
  width: 100%;
  min-height: 120px;
  padding: var(--space-base);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  font-family: var(--font-family);
  font-size: var(--fs-base);
  color: var(--text-primary);
  resize: vertical;
  transition: border-color var(--transition-base);
  background: var(--bg-card);
}

.textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* ── Coming Soon Tooltip ── */
.coming-soon-card {
  position: relative;
}

.coming-soon-card::after {
  content: 'Coming Soon';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  padding: 8px 20px;
  border-radius: var(--radius-pill);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  font-family: var(--font-en);
  opacity: 0;
  transition: opacity var(--transition-base);
  pointer-events: none;
  z-index: 5;
}

.coming-soon-card:hover::after {
  opacity: 1;
}

.coming-soon-card {
  pointer-events: auto !important;
  cursor: not-allowed;
}

/* ── Medal Icons ── */
.medal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 1.1rem;
  font-weight: var(--fw-bold);
}

.medal--gold { background: linear-gradient(135deg, #fbbf24, #f59e0b); color: #fff; }
.medal--silver { background: linear-gradient(135deg, #d1d5db, #9ca3af); color: #fff; }
.medal--bronze { background: linear-gradient(135deg, #d97706, #b45309); color: #fff; }

/* ── Leaderboard Table ── */
.leaderboard-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 8px;
}

.leaderboard-table th {
  text-align: left;
  padding: var(--space-md) var(--space-base);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.leaderboard-table td {
  padding: var(--space-md) var(--space-base);
  background: var(--bg-card);
  font-size: var(--fs-base);
}

.leaderboard-table tr td:first-child {
  border-radius: var(--radius-md) 0 0 var(--radius-md);
}

.leaderboard-table tr td:last-child {
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.leaderboard-table .row--current {
  box-shadow: inset 0 0 0 2px var(--primary);
}

.leaderboard-table .row--current td {
  background: var(--primary-light);
}

/* ── Reward Section ── */
.reward-section {
  text-align: center;
  padding: var(--space-3xl);
}

.reward-section__emoji {
  font-size: 4rem;
  margin-bottom: var(--space-lg);
}

.reward-section__title {
  font-size: var(--fs-2xl);
  font-weight: var(--fw-bold);
  margin-bottom: var(--space-sm);
}

.reward-section__subtitle {
  color: var(--text-secondary);
  margin-bottom: var(--space-xl);
}

.reward-section__stats {
  display: flex;
  justify-content: center;
  gap: var(--space-2xl);
  margin-bottom: var(--space-xl);
}

.reward-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
}

.reward-stat__value {
  font-size: var(--fs-3xl);
  font-weight: var(--fw-extrabold);
}

.reward-stat__label {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ── Section Titles ── */
.section-title {
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--space-base);
}
