/* css/dashboard.css */

.dashboard {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
}

/* ── Header ── */
.dash-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background: rgba(8,13,26,0.85);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 10;
  flex-shrink: 0;
}

.dash-logo {
  font-family: 'Sora', sans-serif;
  font-size: 20px;
  font-weight: 800;
  background: linear-gradient(135deg, #fff 30%, #60a5fa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.dash-user-area {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 2px solid var(--border);
  object-fit: cover;
}

.avatar-placeholder {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), var(--green));
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; flex-shrink: 0;
}

.dash-username {
  font-size: 13px; color: var(--muted);
  max-width: 140px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}

.dash-points {
  font-size: 13px;
  font-weight: 600;
  color: #fbbf24;
  background: rgba(251,191,36,0.1);
  padding: 4px 8px;
  border-radius: 12px;
  border: 1px solid rgba(251,191,36,0.2);
}

.lesson-detail-card {
  margin: 18px 0 12px;
  padding: 18px;
  border-radius: 18px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
}

.lesson-detail-text {
  color: var(--text-secondary);
  line-height: 1.7;
  white-space: pre-wrap;
}

.logout-btn {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 10px;
  padding: 7px 14px;
  cursor: pointer;
  font-size: 13px;
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
  transition: all 0.2s;
  white-space: nowrap;
}

.logout-btn:hover {
  background: rgba(239,68,68,0.12);
  border-color: rgba(239,68,68,0.28);
  color: #fca5a5;
}

/* ── Main content area ── */
.dash-main {
  flex: 1;
  overflow: hidden;           /* home-tab handles its own scroll */
  transition: opacity 0.15s ease, transform 0.15s ease;
  /* leave room for bottom nav */
  padding-bottom: 80px;
  display: flex;
  flex-direction: column;
}

/* Home tab fills entire dash-main */
.home-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 100%;
}

/* ══════════════════════════════════════════════════
   BOTTOM NAV  (mirrors Flutter _StyledBottomNav)
══════════════════════════════════════════════════ */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-around;
  background: rgba(10,14,28,0.96);
  border-top: 1px solid rgba(255,255,255,0.07);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 -8px 32px rgba(0,0,0,0.4);
  padding: 10px 8px calc(10px + env(safe-area-inset-bottom));
}

.bn-item {
  display: flex; flex-direction: column;
  align-items: center; gap: 4px;
  padding: 8px 14px;
  border: none; background: transparent;
  cursor: pointer; border-radius: 14px;
  transition: background 0.2s;
  color: rgba(240,244,255,0.4);
  min-width: 56px;
  position: relative;
}

.bn-item:hover {
  background: rgba(255,255,255,0.05);
  color: rgba(240,244,255,0.65);
}

.bn-item.active {
  background: rgba(75,123,255,0.13);
  color: #4b7bff;
}

.bn-icon {
  width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.2s cubic-bezier(0.34,1.56,0.64,1);
}

.bn-icon svg {
  width: 22px; height: 22px;
  stroke: currentColor;
  transition: stroke 0.2s;
}

.bn-item.active .bn-icon { transform: translateY(-1px) scale(1.08); }
.bn-item.active .bn-icon svg { stroke-width: 2.5; }

.bn-label {
  font-family: 'DM Sans', sans-serif;
  font-size: 10.5px; font-weight: 500;
  letter-spacing: -0.1px;
  transition: font-weight 0.15s;
  white-space: nowrap;
}

.bn-item.active .bn-label { font-weight: 700; }

.bn-item.active::after {
  content: "";
  position: absolute;
  top: 6px; right: 10px;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: #4b7bff;
  opacity: 0.7;
}

/* ── Placeholder tabs ── */
.placeholder-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 32px;
  gap: 12px;
}

.placeholder-emoji { font-size: 56px; }

.placeholder-title {
  font-family: 'Sora', sans-serif;
  font-size: 22px; font-weight: 700;
}

.placeholder-sub { color: var(--muted); font-size: 14px; }

.placeholder-badge {
  margin-top: 8px;
  background: rgba(255,255,255,0.07);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 5px 16px;
  font-size: 12px; font-weight: 600;
  color: var(--muted);
}

/* ── Responsive ── */
@media (max-width: 480px) {
  .dash-header  { padding: 12px 16px; }
  .bn-item      { padding: 8px 10px; min-width: 48px; }
  .bn-label     { font-size: 10px; }
  .dash-username { display: none; }
}