/* ============================================
   SKILLBRIDGE — COMPONENTS CSS
   Modals, Toasts, Tabs, Avatar, Rating, etc.
   ============================================ */

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */
#toast-container {
  position: fixed; bottom: 24px; right: 24px;
  z-index: 9999; display: flex; flex-direction: column; gap: 10px;
  pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px; border-radius: var(--radius);
  background: var(--bg-card); border: 1px solid var(--border);
  box-shadow: var(--shadow-lg); min-width: 280px; max-width: 380px;
  pointer-events: all; animation: slideInRight 0.3s ease;
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.toast.removing { opacity: 0; transform: translateX(40px); }
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}
.toast-icon { width: 20px; height: 20px; flex-shrink: 0; }
.toast-message { flex: 1; font-size: 0.88rem; font-weight: 500; color: var(--text); }
.toast-close { color: var(--text-light); padding: 2px; cursor: pointer; transition: color var(--transition); }
.toast-close:hover { color: var(--text); }
.toast-close svg { width: 16px; height: 16px; }
.toast.success { border-left: 4px solid var(--secondary); }
.toast.success .toast-icon { color: var(--secondary); }
.toast.error { border-left: 4px solid #EF4444; }
.toast.error .toast-icon { color: #EF4444; }
.toast.info { border-left: 4px solid var(--primary); }
.toast.info .toast-icon { color: var(--primary); }
.toast.warning { border-left: 4px solid var(--accent); }
.toast.warning .toast-icon { color: var(--accent); }

/* ============================================
   MODAL
   ============================================ */
.modal-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(0,0,0,0.5); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px; opacity: 0; pointer-events: none;
  transition: opacity var(--transition);
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--bg-card); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl); width: 100%; max-width: 520px;
  max-height: 90vh; overflow-y: auto;
  transform: scale(0.95) translateY(10px);
  transition: transform var(--transition);
}
.modal-overlay.open .modal { transform: scale(1) translateY(0); }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 24px 0; margin-bottom: 18px;
}
.modal-title { font-size: 1.1rem; font-weight: 700; }
.modal-close {
  width: 34px; height: 34px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); transition: all var(--transition);
}
.modal-close:hover { background: var(--bg-alt); color: var(--text); }
.modal-close svg { width: 18px; height: 18px; }
.modal-body { padding: 0 24px 24px; }
.modal-footer {
  padding: 16px 24px; border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 10px;
}

/* ============================================
   TABS
   ============================================ */
.tabs { display: flex; border-bottom: 2px solid var(--border); margin-bottom: 24px; gap: 4px; }
.tab-btn {
  padding: 10px 18px; font-size: 0.9rem; font-weight: 500;
  color: var(--text-muted); border-bottom: 2px solid transparent;
  margin-bottom: -2px; transition: all var(--transition);
  background: none; cursor: pointer;
}
.tab-btn:hover { color: var(--primary); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ============================================
   AVATAR + STATUS
   ============================================ */
.avatar {
  border-radius: 50%; background: var(--bg-alt);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; color: var(--primary); flex-shrink: 0;
  overflow: hidden; position: relative;
}
.avatar-sm { width: 32px; height: 32px; font-size: 0.75rem; }
.avatar-md { width: 44px; height: 44px; font-size: 0.9rem; }
.avatar-lg { width: 64px; height: 64px; font-size: 1.2rem; }
.avatar-xl { width: 96px; height: 96px; font-size: 1.8rem; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }

.avatar-with-status { position: relative; display: inline-block; }
.status-dot {
  position: absolute; bottom: 2px; right: 2px;
  width: 10px; height: 10px; border-radius: 50%;
  border: 2px solid var(--bg-card);
}
.status-dot.online { background: var(--secondary); }
.status-dot.away { background: var(--accent); }
.status-dot.offline { background: var(--text-light); }

/* ============================================
   STAR RATING
   ============================================ */
.star-rating { display: flex; gap: 2px; }
.star { font-size: 1rem; color: var(--border); transition: color var(--transition); cursor: pointer; }
.star.filled { color: var(--accent); }
.star.half { color: var(--accent); }
.rating-display { display: flex; align-items: center; gap: 6px; }
.rating-display .stars { display: flex; gap: 1px; }
.rating-display .stars span { font-size: 0.9rem; }
.rating-display .score { font-weight: 700; font-size: 0.9rem; color: var(--text); }
.rating-display .count { font-size: 0.8rem; color: var(--text-muted); }

/* ============================================
   SKELETON LOADER
   ============================================ */
.skeleton {
  background: linear-gradient(90deg, var(--bg-alt) 25%, var(--border) 50%, var(--bg-alt) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}
@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.skeleton-text { height: 14px; margin-bottom: 8px; }
.skeleton-text.w-full { width: 100%; }
.skeleton-text.w-3-4 { width: 75%; }
.skeleton-text.w-1-2 { width: 50%; }
.skeleton-avatar { border-radius: 50%; }
.skeleton-card { height: 180px; border-radius: var(--radius-md); }

/* ============================================
   DROPDOWN
   ============================================ */
.dropdown { position: relative; display: inline-block; }
.dropdown-menu {
  position: absolute; top: calc(100% + 8px); right: 0;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-md);
  min-width: 200px; z-index: 200; overflow: hidden;
  opacity: 0; pointer-events: none; transform: translateY(-6px);
  transition: all var(--transition);
}
.dropdown-menu.open { opacity: 1; pointer-events: all; transform: translateY(0); }
.dropdown-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; font-size: 0.88rem; font-weight: 500;
  color: var(--text-muted); cursor: pointer;
  transition: all var(--transition); text-decoration: none;
}
.dropdown-item:hover { background: var(--bg-alt); color: var(--text); }
.dropdown-item.danger:hover { background: #FEE2E2; color: #DC2626; }
.dropdown-item svg { width: 16px; height: 16px; }
.dropdown-divider { height: 1px; background: var(--border); margin: 4px 0; }

/* ============================================
   NOTIFICATION BELL
   ============================================ */
.notif-badge {
  position: relative; display: inline-block;
}
.notif-dot {
  position: absolute; top: -2px; right: -2px;
  width: 8px; height: 8px; border-radius: 50%;
  background: #EF4444; border: 2px solid var(--bg);
}
.notif-count {
  position: absolute; top: -6px; right: -8px;
  background: #EF4444; color: #fff;
  font-size: 0.65rem; font-weight: 700;
  min-width: 18px; height: 18px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px;
}

/* ============================================
   PROGRESS RING (SVG)
   ============================================ */
.progress-ring-container {
  display: inline-flex; align-items: center; justify-content: center;
  position: relative;
}
.progress-ring { transform: rotate(-90deg); }
.progress-ring-bg { fill: none; stroke: var(--bg-alt); }
.progress-ring-fill {
  fill: none; stroke: var(--primary);
  stroke-linecap: round;
  transition: stroke-dashoffset 0.6s ease;
}
.progress-ring-text {
  position: absolute; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
}
.progress-ring-percent { font-size: 1.4rem; font-weight: 800; color: var(--text); }
.progress-ring-label { font-size: 0.7rem; color: var(--text-muted); font-weight: 500; }

/* ============================================
   SESSION CARD
   ============================================ */
.session-card {
  display: flex; align-items: center; gap: 14px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px;
  transition: all var(--transition);
}
.session-card:hover { border-color: var(--primary); box-shadow: var(--shadow); }
.session-meta { flex: 1; }
.session-title { font-size: 0.9rem; font-weight: 600; color: var(--text); margin-bottom: 3px; }
.session-time { font-size: 0.8rem; color: var(--text-muted); }
.session-type { font-size: 0.75rem; }

/* ============================================
   COURSE CARD
   ============================================ */
.course-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-md); overflow: hidden;
  transition: all var(--transition);
}
.course-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.course-thumbnail {
  height: 140px;
  background: linear-gradient(135deg, var(--primary-light), var(--secondary-light));
  display: flex; align-items: center; justify-content: center;
  font-size: 3rem;
}
.course-body { padding: 16px; }
.course-title { font-size: 0.92rem; font-weight: 600; margin-bottom: 6px; color: var(--text); }
.course-meta { display: flex; gap: 12px; font-size: 0.78rem; color: var(--text-muted); margin-bottom: 12px; flex-wrap: wrap; }
.course-progress { margin-top: 10px; }
.course-progress-text { display: flex; justify-content: space-between; font-size: 0.78rem; color: var(--text-muted); margin-bottom: 5px; }

/* ============================================
   FORUM POST CARD
   ============================================ */
.post-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px 20px;
  transition: all var(--transition); cursor: pointer;
}
.post-card:hover { border-color: var(--primary); box-shadow: var(--shadow); }
.post-header { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 10px; }
.post-body { flex: 1; }
.post-title { font-size: 0.95rem; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.post-excerpt { font-size: 0.85rem; color: var(--text-muted); line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.post-footer { display: flex; align-items: center; gap: 16px; margin-top: 12px; }
.post-stat { display: flex; align-items: center; gap: 5px; font-size: 0.8rem; color: var(--text-muted); }
.post-stat svg { width: 14px; height: 14px; }

/* ============================================
   LEADERBOARD TABLE
   ============================================ */
.leaderboard-table { width: 100%; border-collapse: collapse; }
.leaderboard-table th {
  text-align: left; font-size: 0.78rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--text-muted); padding: 10px 14px;
  border-bottom: 2px solid var(--border);
}
.leaderboard-table td {
  padding: 12px 14px; border-bottom: 1px solid var(--border);
  font-size: 0.88rem; color: var(--text);
}
.leaderboard-table tr:last-child td { border-bottom: none; }
.leaderboard-table tr:hover td { background: var(--bg-alt); }
.rank-badge {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.8rem;
}
.rank-1 { background: linear-gradient(135deg, #F59E0B, #D97706); color: #fff; }
.rank-2 { background: linear-gradient(135deg, #9CA3AF, #6B7280); color: #fff; }
.rank-3 { background: linear-gradient(135deg, #CD7F32, #A0522D); color: #fff; }

/* ============================================
   JOB CARD
   ============================================ */
.job-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 22px;
  transition: all var(--transition);
}
.job-card:hover { border-color: var(--primary); box-shadow: var(--shadow); transform: translateY(-2px); }
.job-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; }
.job-title { font-size: 1rem; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.job-company { font-size: 0.85rem; color: var(--primary); font-weight: 500; }
.job-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.job-tag {
  padding: 3px 10px; border-radius: var(--radius-full);
  font-size: 0.75rem; font-weight: 500;
  background: var(--bg-alt); color: var(--text-muted);
}
.job-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; }
.job-salary { font-size: 0.85rem; font-weight: 600; color: var(--secondary); }
.job-meta { font-size: 0.78rem; color: var(--text-muted); }

/* ============================================
   TOKEN WIDGET
   ============================================ */
.token-balance {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 20px; background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: var(--radius-md); color: #fff; margin-bottom: 16px;
}
.token-icon { font-size: 2rem; }
.token-label { font-size: 0.78rem; opacity: 0.8; margin-bottom: 3px; }
.token-amount { font-size: 1.8rem; font-weight: 800; line-height: 1; }

.token-tx {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 0; border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
}
.token-tx:last-child { border-bottom: none; }
.token-tx-desc { color: var(--text-muted); }
.token-tx-amount { font-weight: 700; }
.token-tx-amount.earn { color: var(--secondary); }
.token-tx-amount.spend { color: #EF4444; }

/* ============================================
   BADGE CARDS (Gamification)
   ============================================ */
.badge-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 20px;
  text-align: center; transition: all var(--transition);
}
.badge-card.locked { opacity: 0.5; filter: grayscale(1); }
.badge-card:hover:not(.locked) { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--accent); }
.badge-card .badge-icon { font-size: 2.4rem; margin-bottom: 10px; }
.badge-card .badge-name { font-size: 0.85rem; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.badge-card .badge-desc { font-size: 0.75rem; color: var(--text-muted); }

/* ============================================
   CALENDAR MINI
   ============================================ */
.mini-calendar { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; }
.mini-calendar-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid var(--border);
  font-weight: 700; font-size: 0.9rem; color: var(--text);
}
.mini-calendar-grid {
  display: grid; grid-template-columns: repeat(7, 1fr);
  padding: 10px;
}
.cal-day-label {
  text-align: center; font-size: 0.7rem; font-weight: 600;
  color: var(--text-muted); padding: 6px 0; text-transform: uppercase;
}
.cal-day {
  text-align: center; padding: 7px 3px; font-size: 0.82rem;
  cursor: pointer; border-radius: var(--radius-sm);
  color: var(--text-muted); transition: all var(--transition);
}
.cal-day:hover { background: var(--primary-light); color: var(--primary); }
.cal-day.today { background: var(--primary); color: #fff; font-weight: 700; }
.cal-day.has-event::after {
  content: ''; display: block; width: 4px; height: 4px;
  border-radius: 50%; background: var(--secondary);
  margin: 2px auto 0;
}
.cal-day.other-month { opacity: 0.3; }

/* ============================================
   ACCESSIBILITY TOOLBAR
   ============================================ */
.a11y-toolbar {
  position: fixed; bottom: 24px; left: 24px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-md); box-shadow: var(--shadow-lg);
  padding: 12px; display: flex; flex-direction: column; gap: 8px;
  z-index: 300;
}
.a11y-btn {
  width: 38px; height: 38px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-alt); color: var(--text-muted);
  font-size: 0.85rem; font-weight: 700;
  transition: all var(--transition); cursor: pointer; border: none;
}
.a11y-btn:hover { background: var(--primary-light); color: var(--primary); }

/* High contrast mode */
[data-contrast="high"] {
  --border: #000; --text-muted: #000;
}
[data-theme="dark"][data-contrast="high"] {
  --border: #fff; --text-muted: #fff;
}

/* ============================================
   CONFETTI CANVAS
   ============================================ */
#confetti-canvas {
  position: fixed; inset: 0; pointer-events: none; z-index: 9999;
}

/* ============================================
   OFFLINE BANNER
   ============================================ */
.offline-banner {
  position: fixed; top: var(--nav-height); left: 0; right: 0;
  background: var(--accent); color: #fff; padding: 10px 20px;
  text-align: center; font-size: 0.88rem; font-weight: 600;
  z-index: 80; display: none;
}
.offline-banner.show { display: block; }

/* ============================================
   FILTER PANEL
   ============================================ */
.filter-panel {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 20px; margin-bottom: 24px;
}
.filter-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.filter-group { display: flex; flex-direction: column; gap: 5px; min-width: 160px; }
.filter-label { font-size: 0.78rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.filter-select {
  padding: 8px 12px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--bg);
  color: var(--text); font-size: 0.88rem; outline: none;
  cursor: pointer; transition: border-color var(--transition);
}
.filter-select:focus { border-color: var(--primary); }

/* ============================================
   ONBOARDING STEPS
   ============================================ */
.onboarding-steps {
  display: flex; align-items: center; justify-content: center;
  gap: 8px; margin-bottom: 32px;
}
.onboarding-step {
  display: flex; align-items: center; gap: 8px;
}
.step-circle {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.82rem; font-weight: 700;
  border: 2px solid var(--border); color: var(--text-muted);
  transition: all var(--transition);
}
.step-circle.active { border-color: var(--primary); background: var(--primary); color: #fff; }
.step-circle.done { border-color: var(--secondary); background: var(--secondary); color: #fff; }
.step-label { font-size: 0.8rem; font-weight: 500; color: var(--text-muted); }
.onboarding-step.active .step-label { color: var(--primary); }
.step-connector { height: 2px; width: 32px; background: var(--border); border-radius: 1px; }
.step-connector.done { background: var(--secondary); }

/* ============================================
   AI MATCH BADGE
   ============================================ */
.ai-match-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: var(--radius-full);
  font-size: 0.72rem; font-weight: 700;
  background: linear-gradient(135deg, var(--primary-light), var(--secondary-light));
  color: var(--primary); border: 1px solid var(--primary);
}

/* ============================================
   SEARCH BAR
   ============================================ */
.search-bar {
  position: relative; width: 100%;
}
.search-bar svg {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px; color: var(--text-muted); pointer-events: none;
}
.search-bar input {
  width: 100%; padding: 11px 14px 11px 44px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg-card); color: var(--text); font-size: 0.9rem;
  outline: none; transition: border-color var(--transition), box-shadow var(--transition);
}
.search-bar input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,70,229,0.1); }

/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state {
  text-align: center; padding: 48px 24px;
  color: var(--text-muted);
}
.empty-state-icon { font-size: 3.5rem; margin-bottom: 16px; opacity: 0.5; }
.empty-state h3 { font-size: 1.1rem; color: var(--text); margin-bottom: 8px; }
.empty-state p { font-size: 0.9rem; margin-bottom: 20px; max-width: 300px; margin-left: auto; margin-right: auto; }
