/* ── Profile Page Stylesheet ── */

.sn-profile-container {
  max-width: 1000px;
  margin: 40px auto;
  padding: 0 24px;
  font-family: 'Poppins', sans-serif;
}

/* ── Profile Header Card ── */
.sn-profile-header-card {
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(108, 77, 246, 0.15);
  border-radius: 28px;
  padding: 32px;
  display: flex;
  align-items: center;
  gap: 28px;
  box-shadow: 0 12px 30px rgba(108, 77, 246, 0.06);
  margin-bottom: 24px;
}
.sn-profile-avatar-wrapper {
  position: relative;
  flex-shrink: 0;
}
.sn-profile-avatar-wrapper img {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid #fff;
  box-shadow: 0 8px 20px rgba(108, 77, 246, 0.15);
}
.sn-profile-details h2 {
  font-size: 1.8rem;
  color: var(--text);
  margin: 0 0 4px 0;
  font-weight: 800;
}
.sn-profile-details p {
  font-size: 0.95rem;
  color: var(--muted);
  margin: 0 0 12px 0;
}
.sn-profile-class-badge {
  display: inline-block;
  background: linear-gradient(135deg, #6c4df6, #a78bfa);
  color: white;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 5px 16px;
  border-radius: 50px;
  box-shadow: 0 4px 10px rgba(108, 77, 246, 0.2);
}

/* ── Choose Class Alert Banner ── */
.sn-class-alert {
  background: #fffbeb;
  border: 1.5px dashed #f59e0b;
  border-radius: 24px;
  padding: 24px;
  margin-bottom: 28px;
  display: flex;
  gap: 20px;
  align-items: flex-start;
  animation: sn-pop-in 0.35s ease;
}
.sn-class-alert-icon {
  font-size: 2rem;
  line-height: 1;
}
.sn-class-alert-content h3 {
  margin: 0 0 6px 0;
  color: var(--muted);
  font-size: 1.15rem;
  font-weight: 700;
}
.sn-class-alert-content p {
  margin: 0 0 16px 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}
.sn-class-select-row {
  display: flex;
  gap: 12px;
  align-items: center;
  max-width: 400px;
}
.sn-class-select-row select {
  margin-bottom: 0 !important;
  flex: 1;
}
.sn-save-class-btn {
  background: #f59e0b;
  color: white;
  border: none;
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 12px 24px;
  border-radius: 14px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  box-shadow: 0 4px 10px rgba(245, 158, 11, 0.3);
}
.sn-save-class-btn:hover {
  background: #d97706;
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(245, 158, 11, 0.4);
}

/* ── Grid Layout ── */
.sn-profile-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 24px;
}

/* ── Sidebar Stats ── */
.sn-profile-sidebar-stats {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.sn-stat-card-modern {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(108, 77, 246, 0.1);
  border-radius: 20px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
}
.sn-stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #f3f0ff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}
.sn-stat-card-modern h4 {
  margin: 0 0 2px 0;
  font-size: 0.8rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.sn-stat-value {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text);
}

/* ── Main content area ── */
.sn-profile-main-content {
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(108, 77, 246, 0.15);
  border-radius: 28px;
  padding: 32px;
  box-shadow: 0 12px 30px rgba(108, 77, 246, 0.06);
}

/* ── Tabs ── */
.sn-profile-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 2px solid #f0ebff;
  padding-bottom: 16px;
  margin-bottom: 24px;
}
.sn-profile-tab {
  background: transparent;
  border: none;
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--muted);
  padding: 8px 16px;
  cursor: pointer;
  border-radius: 12px;
  transition: all 0.2s ease;
}
.sn-profile-tab:hover {
  background: #f3f0ff;
  color: var(--muted);
}
.sn-profile-tab.active {
  background: #6c4df6;
  color: white;
  box-shadow: 0 4px 10px rgba(108, 77, 246, 0.25);
}

/* ── Tab Content ── */
.sn-profile-tab-content.hidden {
  display: none !important;
}

/* ── Tab 1: Learning Progress Item ── */
.sn-learning-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.sn-learning-item {
  display: flex;
  align-items: center;
  gap: 16px;
  background: #faf9ff;
  padding: 16px 20px;
  border-radius: 16px;
  border: 1px solid rgba(108, 77, 246, 0.06);
}
.sn-learning-icon {
  font-size: 1.6rem;
}
.sn-learning-detail {
  flex: 1;
}
.sn-learning-detail h4 {
  margin: 0 0 6px 0;
  font-size: 0.95rem;
  color: var(--text);
  font-weight: 700;
}
.sn-learning-progress-bar {
  height: 8px;
  background: #e8e3ff;
  border-radius: 10px;
  overflow: hidden;
}
.sn-learning-progress-bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #6c4df6, #a78bfa);
  border-radius: 10px;
}
.sn-learning-percent {
  font-size: 1rem;
  font-weight: 800;
  color: var(--muted);
}

/* ── Tab 2: Achievements Badges ── */
.sn-badge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 20px;
}
.sn-badge-item {
  background: #faf9ff;
  border: 1px solid rgba(108, 77, 246, 0.06);
  border-radius: 18px;
  padding: 20px;
  text-align: center;
  transition: transform 0.2s ease;
}
.sn-badge-item:hover {
  transform: translateY(-3px);
}
.sn-badge-item.unearned {
  opacity: 0.55;
  filter: grayscale(1);
}
.badge-emoji {
  font-size: 2.2rem;
  display: block;
  margin-bottom: 8px;
}
.sn-badge-item h4 {
  margin: 0 0 4px 0;
  font-size: 0.85rem;
  color: var(--text);
  font-weight: 700;
}
.sn-badge-item p {
  margin: 0;
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.4;
}

/* ── Tab 3: Progress Graph ── */
.sn-progress-chart-mock {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  height: 200px;
  border-bottom: 2px solid #e2e8f0;
  padding: 0 20px;
  margin-top: 20px;
}
.sn-progress-bar-vertical {
  width: 32px;
  background: #f3f0ff;
  border-top-left-radius: 6px;
  border-top-right-radius: 6px;
  position: relative;
  height: 100%;
}
.sn-progress-bar-vertical::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--val, 0%);
  background: linear-gradient(180deg, #a78bfa, #6c4df6);
  border-top-left-radius: 6px;
  border-top-right-radius: 6px;
  animation: sn-grow-bar 0.8s ease-out;
}
.sn-progress-bar-vertical span {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 600;
}
@keyframes sn-grow-bar {
  from { height: 0; }
  to { height: var(--val); }
}

/* ── Responsive Styling ── */
@media (max-width: 768px) {
  .sn-profile-grid {
    grid-template-columns: 1fr;
  }
  .sn-profile-header-card {
    flex-direction: column;
    text-align: center;
    padding: 24px;
  }
  .sn-class-alert {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .sn-class-select-row {
    width: 100%;
    flex-direction: column;
  }
  .sn-save-class-btn {
    width: 100%;
  }
}

/* ── Dark Mode ── */
body[data-theme="dark"] .sn-profile-header-card,
body[data-theme="dark"] .sn-profile-main-content {
  background: rgba(15, 23, 42, 0.75);
  border-color: rgba(255, 255, 255, 0.08);
}
body[data-theme="dark"] .sn-profile-details h2,
body[data-theme="dark"] .sn-stat-value,
body[data-theme="dark"] .sn-learning-detail h4,
body[data-theme="dark"] .sn-badge-item h4 {
  color: #f8fafc;
}
body[data-theme="dark"] .sn-stat-card-modern {
  background: rgba(30, 41, 59, 0.6);
  border-color: rgba(255, 255, 255, 0.05);
}
body[data-theme="dark"] .sn-stat-icon {
  background: rgba(108, 77, 246, 0.15);
}
body[data-theme="dark"] .sn-learning-item,
body[data-theme="dark"] .sn-badge-item {
  background: rgba(30, 41, 59, 0.4);
  border-color: rgba(255, 255, 255, 0.05);
}
body[data-theme="dark"] .sn-profile-tab:not(.active):hover {
  background: rgba(255, 255, 255, 0.05);
}
body[data-theme="dark"] .sn-profile-tabs {
  border-bottom-color: rgba(255, 255, 255, 0.08);
}
body[data-theme="dark"] .sn-learning-progress-bar {
  background: #1e293b;
}
body[data-theme="dark"] .sn-progress-bar-vertical {
  background: #1e293b;
}
body[data-theme="dark"] .sn-class-alert {
  background: #1e1b10;
  border-color: #d97706;
}
body[data-theme="dark"] .sn-class-alert-content h3 {
  color: #f59e0b;
}
body[data-theme="dark"] .sn-class-alert-content p {
  color: #f59e0b;
  opacity: 0.85;
}
