/**
 * MyKamus Multilingual - Member Dashboard Stylesheet
 * Personal Learning Vocabulary, Quiz Rankings, and Community Contributions
 * (c) 2026 MyKamus
 */

.member-page {
  background: #f8fafc;
  color: #0f172a;
  min-height: 100vh;
}

.member-main {
  max-width: 1100px;
  margin: 2rem auto;
  padding: 0 1.25rem 4rem;
}

/* Hero & Profile Header */
.member-hero {
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #4338ca 100%);
  border-radius: 20px;
  padding: 2rem;
  color: #ffffff;
  box-shadow: 0 12px 30px -8px rgba(30, 27, 75, 0.35);
  margin-bottom: 2rem;
  position: relative;
  overflow: hidden;
}

.member-hero::after {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.25) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.member-profile-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.5rem;
  position: relative;
  z-index: 2;
}

.member-identity {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.member-avatar-wrap {
  position: relative;
}

.member-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #6366f1;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
  background: #312e81;
}

.member-online-dot {
  position: absolute;
  bottom: 4px;
  right: 4px;
  width: 14px;
  height: 14px;
  background: #22c55e;
  border: 2.5px solid #1e1b4b;
  border-radius: 50%;
}

.member-name {
  margin: 0;
  font-size: 1.55rem;
  font-weight: 800;
  color: #ffffff;
}

.member-meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.35rem;
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: #c7d2fe;
}

.member-badge-role {
  background: rgba(99, 102, 241, 0.35);
  border: 1px solid rgba(165, 180, 252, 0.4);
  padding: 0.15rem 0.6rem;
  border-radius: 9999px;
  font-weight: 700;
  color: #fbbf24;
}

.member-sync-status {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  color: #86efac;
  background: rgba(22, 101, 52, 0.35);
  border: 1px solid rgba(134, 239, 172, 0.3);
  padding: 0.15rem 0.55rem;
  border-radius: 9999px;
}

.member-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.btn-member-action {
  padding: 0.55rem 1.15rem;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  text-decoration: none;
  transition: all 0.2s ease;
  font-family: inherit;
}

.btn-signout {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.btn-signout:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: #f87171;
  color: #fecaca;
}

/* Tabs Navigation */
.member-tabs {
  display: flex;
  gap: 0.5rem;
  background: #ffffff;
  padding: 0.45rem;
  border-radius: 14px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.03);
  margin-bottom: 1.75rem;
  overflow-x: auto;
}

.member-tab-btn {
  flex: 1;
  padding: 0.75rem 1.1rem;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: #64748b;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.18s ease;
  white-space: nowrap;
  font-family: inherit;
}

.member-tab-btn:hover {
  color: #0f172a;
  background: #f1f5f9;
}

.member-tab-btn.is-active {
  background: #4f46e5;
  color: #ffffff;
  box-shadow: 0 3px 10px rgba(79, 70, 229, 0.25);
}

.tab-badge {
  background: rgba(0, 0, 0, 0.08);
  font-size: 0.76rem;
  font-weight: 800;
  padding: 0.15rem 0.45rem;
  border-radius: 9999px;
}

.member-tab-btn.is-active .tab-badge {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

/* Tab Panels */
.tab-panel {
  display: none;
}

.tab-panel.is-active {
  display: block;
  animation: tabFadeIn 0.2s ease;
}

@keyframes tabFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Stats Cards Grid */
.member-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.m-stat-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.02);
}

.m-stat-icon {
  font-size: 2rem;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
}

.m-stat-val {
  font-size: 1.65rem;
  font-weight: 800;
  line-height: 1.1;
  color: #0f172a;
}

.m-stat-lbl {
  font-size: 0.8rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Content Container Card */
.dashboard-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.03);
}

.card-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid #f1f5f9;
}

.card-title {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 800;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Learn Words List */
.word-items-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.learned-word-row {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  transition: all 0.15s ease;
}

.learned-word-row:hover {
  border-color: #cbd5e1;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.word-info {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 220px;
}

.word-term {
  font-size: 1.1rem;
  font-weight: 800;
  color: #0f172a;
  text-decoration: none;
}

.word-term:hover {
  color: #4f46e5;
  text-decoration: underline;
}

.word-def {
  font-size: 0.88rem;
  color: #475569;
  line-height: 1.4;
}

.word-meta-pills {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.stage-pill {
  font-size: 0.74rem;
  font-weight: 800;
  padding: 0.2rem 0.55rem;
  border-radius: 9999px;
  text-transform: uppercase;
}

.stage-pill.due {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
}

.stage-pill.mastered {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #86efac;
}

.stage-pill.learning {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.btn-remove-word {
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  font-size: 0.82rem;
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  transition: all 0.15s ease;
}

.btn-remove-word:hover {
  color: #ef4444;
  background: #fee2e2;
}

/* Badges Showcase Grid */
.badges-showcase-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.badge-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
}

.badge-card.unlocked {
  background: linear-gradient(135deg, #ffffff 0%, #fefce8 100%);
  border-color: #fde047;
  box-shadow: 0 4px 14px rgba(234, 179, 8, 0.15);
}

.badge-card.locked {
  opacity: 0.55;
  filter: grayscale(0.8);
}

.badge-card-icon {
  font-size: 2.4rem;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid #e2e8f0;
}

.badge-card.unlocked .badge-card-icon {
  border-color: #facc15;
  background: #fef9c3;
  box-shadow: 0 0 12px rgba(250, 204, 21, 0.35);
}

.badge-card-title {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 800;
  color: #0f172a;
}

.badge-card-desc {
  margin: 0;
  font-size: 0.8rem;
  color: #64748b;
  line-height: 1.4;
}

.badge-status-tag {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
  margin-top: 0.35rem;
}

.badge-status-tag.unlocked {
  background: #dcfce7;
  color: #15803d;
}

.badge-status-tag.locked {
  background: #e2e8f0;
  color: #64748b;
}

/* Empty State */
.dashboard-empty {
  text-align: center;
  padding: 3rem 1.5rem;
  background: #f8fafc;
  border: 1.5px dashed #cbd5e1;
  border-radius: 14px;
  color: #64748b;
}

.dashboard-empty-icon {
  font-size: 2.6rem;
  margin-bottom: 0.5rem;
}

.dashboard-empty h3 {
  margin: 0.2rem 0;
  font-size: 1.15rem;
  color: #1e293b;
}

.dashboard-empty p {
  margin: 0.35rem 0 1.25rem;
  font-size: 0.92rem;
}
