/* ============================================================
   PolyDM Hub — Components CSS v3 (LIGHT MODE BEE THEME)
   ============================================================ */

/* ── Dashboard Components ─────────────────────────────────── */
.dashboard-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: calc(100vh - 66px);
  padding-top: 66px;
}
@media (max-width: 1024px) {
  .dashboard-layout { grid-template-columns: 1fr; }
}

.dashboard-sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: var(--space-xl) 0;
  position: sticky;
  top: 66px;
  height: calc(100vh - 66px);
  overflow-y: auto;
}

.sidebar-nav { padding: 0 var(--space-md); }
.sidebar-nav-group { margin-bottom: var(--space-xl); }
.sidebar-nav-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0 var(--space-md);
  margin-bottom: var(--space-sm);
}
.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 10px var(--space-md);
  border-radius: var(--radius-lg);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all var(--t-fast);
  margin-bottom: 2px;
}
.sidebar-nav-item:hover {
  color: var(--primary-dark);
  background: var(--primary-soft);
}
.sidebar-nav-item.active {
  color: var(--primary-dark);
  background: var(--surface-3);
  font-weight: 700;
  border-left: 3px solid var(--primary);
}
.sidebar-nav-item .nav-icon { font-size: 1rem; width: 20px; text-align: center; }
.sidebar-nav-item .nav-badge {
  margin-left: auto;
  font-size: 0.7rem;
  background: var(--surface-3);
  color: var(--primary-dark);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.dashboard-main { padding: var(--space-2xl); background: var(--bg); }

/* ── Dashboard widgets ────────────────────────────────────── */
.widget-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-lg);
  margin-bottom: var(--space-2xl);
}
@media (max-width: 1200px) { .widget-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px)  { .widget-grid { grid-template-columns: 1fr; } }

.widget {
  background: var(--surface);
  border: 1.5px solid var(--border-card);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  transition: all var(--t);
  box-shadow: var(--shadow-xs);
}
.widget:hover { transform: translateY(-2px); box-shadow: var(--shadow-primary); border-color: var(--primary); }

.widget-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  background: var(--surface-3);
  margin-bottom: var(--space-sm);
}
.widget-value {
  font-family: var(--font);
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--primary-dark);
}
.widget-label { font-size: 0.8rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.widget-change {
  font-size: 0.78rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}
.widget-change.up { color: #2E8A2E; }
.widget-change.down { color: #C0392B; }

/* ── User Profile Header ──────────────────────────────────── */
.profile-header {
  background: var(--surface);
  border: 1.5px solid var(--border-card);
  border-radius: var(--radius-2xl);
  padding: var(--space-2xl);
  display: flex;
  align-items: center;
  gap: var(--space-xl);
  margin-bottom: var(--space-2xl);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.profile-header::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 240px; height: 100%;
  background: radial-gradient(circle at right, var(--primary-soft) 0%, transparent 70%);
}
.profile-avatar {
  width: 80px; height: 80px;
  border-radius: var(--radius-full);
  background: var(--grad-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-dark);
  border: 3px solid var(--primary-light);
  box-shadow: var(--shadow-primary);
  flex-shrink: 0;
}
.profile-info { flex: 1; position: relative; z-index: 1; }
.profile-name {
  font-family: var(--font);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.profile-role { font-size: 0.875rem; color: var(--text-muted); margin-bottom: var(--space-md); }
.profile-stats { display: flex; gap: var(--space-xl); flex-wrap: wrap; }
.profile-stat-item { display: flex; flex-direction: column; gap: 2px; }
.profile-stat-val {
  font-family: var(--font);
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--primary-dark);
}
.profile-stat-key { font-size: 0.75rem; color: var(--text-muted); }

/* ── Streak Widget ────────────────────────────────────────── */
.streak-widget {
  background: var(--surface-2);
  border: 1.5px solid var(--border-bright);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}
.streak-fire { font-size: 2.5rem; }
.streak-count {
  font-family: var(--font);
  font-size: 2rem;
  font-weight: 900;
  color: var(--secondary);
}
.streak-label { font-size: 0.8rem; color: var(--text-muted); }

/* ── Admin Components ─────────────────────────────────────── */
.admin-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: calc(100vh - 66px);
  padding-top: 66px;
}
@media (max-width: 1024px) {
  .admin-layout { grid-template-columns: 1fr; }
}

.admin-sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: var(--space-xl) 0;
  position: sticky;
  top: 66px;
  height: calc(100vh - 66px);
  overflow-y: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  background: var(--surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.admin-table th {
  background: var(--bg-alt);
  border-bottom: 1.5px solid var(--border);
  padding: 12px 16px;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.admin-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  transition: background var(--t-fast);
}
.admin-table tr:hover td { background: var(--surface-2); }
.admin-table tr:last-child td { border-bottom: none; }

/* ── Chart Placeholder ────────────────────────────────────── */
.chart-container {
  position: relative;
  background: var(--surface);
  border: 1.5px solid var(--border-card);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
}
.chart-bars {
  display: flex;
  align-items: flex-end;
  gap: var(--space-sm);
  height: 120px;
  padding-top: var(--space-md);
}
.chart-bar {
  flex: 1;
  background: var(--grad-primary);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  opacity: 0.85;
  transition: opacity var(--t-fast);
  min-height: 8px;
}
.chart-bar:hover { opacity: 1; }
.chart-bar.teal { background: var(--grad-amber); }
.chart-bar.accent { background: var(--grad-accent); }

/* ── Q&A Components ───────────────────────────────────────── */
.qa-item {
  background: var(--surface);
  border: 1.5px solid var(--border-card);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  transition: all var(--t);
  box-shadow: var(--shadow-xs);
}
.qa-item:hover { border-color: var(--primary); box-shadow: var(--shadow-primary); }

.qa-header { display: flex; gap: var(--space-md); align-items: flex-start; }
.qa-votes {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.vote-btn {
  width: 32px; height: 32px;
  border-radius: var(--radius-md);
  background: var(--bg-alt);
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  transition: all var(--t-fast);
}
.vote-btn:hover { border-color: var(--primary); color: var(--primary-dark); background: var(--surface-3); }
.vote-count { font-family: var(--font); font-weight: 700; font-size: 1rem; color: var(--text-primary); }

.qa-body { flex: 1; }
.qa-title {
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-sm);
  font-size: 1rem;
  cursor: pointer;
  transition: color var(--t-fast);
}
.qa-title:hover { color: var(--primary); }
.qa-excerpt { font-size: 0.875rem; color: var(--text-secondary); margin-bottom: var(--space-md); line-height: 1.6; }
.qa-footer { display: flex; align-items: center; gap: var(--space-md); flex-wrap: wrap; }
.qa-meta { font-size: 0.78rem; color: var(--text-muted); }
.qa-answer-count {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.78rem;
  color: var(--secondary);
  font-weight: 600;
}

/* ── Blog Components ──────────────────────────────────────── */
.blog-card {
  background: var(--surface);
  border: 1.5px solid var(--border-card);
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition: all var(--t);
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow-xs);
}
.blog-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary);
  box-shadow: var(--shadow-primary), var(--shadow-md);
  color: inherit;
}
.blog-card-image {
  height: 200px;
  background: linear-gradient(135deg, var(--surface-2), var(--surface-3));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  position: relative;
  overflow: hidden;
}
.blog-card-image img { width: 100%; height: 100%; object-fit: cover; }
.blog-card-content { padding: var(--space-xl); flex: 1; display: flex; flex-direction: column; gap: var(--space-md); }
.blog-card-title {
  font-family: var(--font);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.4;
}
.blog-card-excerpt { font-size: 0.875rem; color: var(--text-secondary); line-height: 1.6; flex: 1; }
.blog-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--space-md);
  border-top: 1px solid var(--border-subtle);
}
.blog-card-author {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.78rem;
  color: var(--text-muted);
}
.blog-card-date { font-size: 0.75rem; color: var(--text-muted); }

/* ── Tool Card ────────────────────────────────────────────── */
.tool-card {
  background: var(--surface);
  border: 1.5px solid var(--border-card);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  transition: all var(--t);
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow-xs);
}
.tool-card:hover {
  transform: translateY(-4px);
  border-color: var(--secondary);
  box-shadow: var(--shadow-primary), var(--shadow-md);
  color: inherit;
}
.tool-card-icon {
  font-size: 2.5rem;
  width: 64px; height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-3);
  border-radius: var(--radius-lg);
}
.tool-card-name {
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}
.tool-card-desc { font-size: 0.875rem; color: var(--text-secondary); line-height: 1.5; }
.tool-card-tags { display: flex; gap: var(--space-sm); flex-wrap: wrap; }

/* ── Project Card ─────────────────────────────────────────── */
.project-card {
  background: var(--surface);
  border: 1.5px solid var(--border-card);
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition: all var(--t);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-xs);
}
.project-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary);
  box-shadow: var(--shadow-primary), var(--shadow-md);
}
.project-card-header {
  padding: var(--space-xl) var(--space-xl) var(--space-md);
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
}
.project-card-icon {
  width: 56px; height: 56px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  background: var(--surface-3);
  flex-shrink: 0;
}
.project-card-info { flex: 1; }
.project-card-name {
  font-family: var(--font);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.project-card-body {
  padding: 0 var(--space-xl) var(--space-xl);
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}
.project-card-desc { font-size: 0.875rem; color: var(--text-secondary); line-height: 1.6; }
.project-card-footer {
  border-top: 1px solid var(--border-subtle);
  padding: var(--space-md) var(--space-xl);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ── Semester Timeline ────────────────────────────────────── */
.semester-timeline {
  position: relative;
  padding-left: 40px;
}
.semester-timeline::before {
  content: '';
  position: absolute;
  left: 14px;
  top: 0; bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, var(--primary), var(--secondary));
}
.timeline-item {
  position: relative;
  margin-bottom: var(--space-2xl);
}
.timeline-dot {
  position: absolute;
  left: -34px;
  top: 4px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--grad-primary);
  border: 3px solid var(--surface);
  box-shadow: 0 0 12px var(--primary-glow);
}
.timeline-content {
  background: var(--surface);
  border: 1.5px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--shadow-xs);
}

/* ── Notification ─────────────────────────────────────────── */
.notification-item {
  display: flex;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--border-subtle);
  transition: background var(--t-fast);
  cursor: pointer;
}
.notification-item:hover { background: var(--surface-2); }
.notification-item.unread { background: var(--surface-3); }
.notification-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--primary);
  flex-shrink: 0;
  margin-top: 6px;
}
.notification-text { font-size: 0.875rem; color: var(--text-secondary); line-height: 1.5; }
.notification-time { font-size: 0.75rem; color: var(--text-muted); margin-top: 4px; }

/* ── XP / Level ───────────────────────────────────────────── */
.xp-bar-container { background: var(--surface); border: 1.5px solid var(--border-card); border-radius: var(--radius-xl); padding: var(--space-xl); box-shadow: var(--shadow-xs); }
.xp-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--space-md); }
.xp-level {
  font-family: var(--font);
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--primary-dark);
}
.xp-value { font-size: 0.8rem; color: var(--text-muted); }
.xp-progress { height: 10px; background: var(--bg-alt); border-radius: var(--radius-full); overflow: hidden; margin-bottom: var(--space-sm); }
.xp-fill { height: 100%; background: var(--grad-primary); border-radius: var(--radius-full); }
.xp-range { display: flex; justify-content: space-between; font-size: 0.75rem; color: var(--text-muted); }
