/* ============================================================
   CareerHub Pakistan — cms-additions.css
   Extra styles for CMS-driven cards, badges, chatbot toggle
   ============================================================ */

/* ── Card image placeholder ──────────────────────────────── */
.card-img { position: relative; overflow: hidden; height: 160px; background: var(--bg-alt, #f3f4f6); }
.card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-img-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 3rem;
  background: linear-gradient(135deg, #f0f4ff 0%, #e8f0fe 100%);
}
body.dark .card-img-placeholder { background: linear-gradient(135deg, #1e1e2e, #2a2a3e); }

/* ── Featured / urgency badges ───────────────────────────── */
.featured-badge {
  position: absolute; top: 10px; left: 10px;
  background: linear-gradient(135deg, #f59e0b, #f97316);
  color: white; font-size: 0.7rem; font-weight: 700;
  padding: 3px 8px; border-radius: 99px;
}
.free-badge { background: linear-gradient(135deg, #10b981, #059669) !important; }

.badge {
  position: absolute; top: 10px; right: 10px;
  font-size: 0.68rem; font-weight: 700;
  padding: 3px 8px; border-radius: 99px; color: white;
}
.badge-urgent { background: #ef4444; animation: pulse 1.5s infinite; }
.badge-soon   { background: #f59e0b; }
.badge-expired { background: #6b7280; }
@keyframes pulse { 0%,100% { opacity:1; } 50% { opacity:0.7; } }

/* ── Card body ────────────────────────────────────────────── */
.card-body { padding: 16px; flex: 1; }
.card-meta  { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.card-tag   {
  font-size: 0.7rem; font-weight: 600; padding: 3px 9px;
  border-radius: 99px; background: var(--bg-alt, #f3f4f6);
  color: var(--text-secondary, #6b7280);
  border: 1px solid var(--border, #e5e7eb);
}
.card-tag.fund-fully-funded { background: #d1fae5; color: #065f46; border-color: #6ee7b7; }
.card-tag.fund-partial      { background: #fef3c7; color: #92400e; border-color: #fcd34d; }
.card-tag.paid   { background: #d1fae5; color: #065f46; border-color: #6ee7b7; }
.card-tag.unpaid { background: #fee2e2; color: #991b1b; border-color: #fca5a5; }
body.dark .card-tag { background: #2a2a3e; color: #9ca3af; border-color: #374151; }

.card-title { font-size: 0.95rem; font-weight: 700; margin: 0 0 8px; line-height: 1.4; color: var(--text-main, #111); }
.card-desc  { font-size: 0.82rem; color: var(--text-secondary, #6b7280); margin: 0 0 10px; line-height: 1.5;
               display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-details { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.card-details span { font-size: 0.75rem; color: var(--text-secondary, #6b7280); display: flex; align-items: center; gap: 4px; }
.card-details i { color: var(--primary, #6366f1); font-size: 0.7rem; }

/* Tags row */
.tag {
  display: inline-block; font-size: 0.68rem;
  background: var(--bg-alt, #f3f4f6); color: var(--text-secondary, #6b7280);
  padding: 2px 7px; border-radius: 4px; margin: 2px 2px 0 0;
  border: 1px solid var(--border, #e5e7eb);
}
body.dark .tag { background: #1e1e2e; color: #9ca3af; border-color: #374151; }

/* ── Card footer ──────────────────────────────────────────── */
.card-footer { padding: 12px 16px; border-top: 1px solid var(--border, #e5e7eb); display: flex; align-items: center; gap: 8px; }
.card-footer.exam-links { flex-wrap: wrap; gap: 6px; }
.btn-fav {
  margin-left: auto; background: none; border: 1px solid var(--border, #e5e7eb);
  color: var(--text-secondary, #6b7280); width: 36px; height: 36px;
  border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all 0.2s; flex-shrink: 0;
}
.btn-fav:hover, .btn-fav.active { background: #fef3c7; border-color: #f59e0b; color: #f59e0b; }

/* ── Results info bar ─────────────────────────────────────── */
.results-info {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px; padding: 10px 0;
  border-bottom: 1px solid var(--border, #e5e7eb);
  font-size: 0.875rem; color: var(--text-secondary, #6b7280);
}

/* ── View toggle ──────────────────────────────────────────── */
.view-toggle { display: flex; gap: 4px; }
.view-btn {
  width: 34px; height: 34px; border: 1px solid var(--border, #e5e7eb);
  background: var(--bg-card, #fff); color: var(--text-secondary, #6b7280);
  border-radius: 6px; cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.view-btn.active { background: var(--primary, #6366f1); color: white; border-color: var(--primary, #6366f1); }

/* List view */
.cards-list { display: flex; flex-direction: column; gap: 12px; }
.cards-list .card { display: flex; flex-direction: row; }
.cards-list .card-img { width: 120px; height: auto; min-height: 100px; flex-shrink: 0; }
.cards-list .card-img-placeholder { height: 100%; }
.cards-list .card-body { padding: 12px; }
@media (max-width: 600px) {
  .cards-list .card { flex-direction: column; }
  .cards-list .card-img { width: 100%; height: 140px; }
}

/* ── Empty / error states ────────────────────────────────── */
.empty-state, .error-state {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 60px 20px; text-align: center;
  color: var(--text-secondary, #6b7280); gap: 12px;
}
.empty-state i, .error-state i { font-size: 3rem; opacity: 0.4; }
.empty-state h3, .error-state h3 { font-size: 1.1rem; margin: 0; color: var(--text-main, #111); }
.empty-state p, .error-state p  { font-size: 0.875rem; margin: 0; }

/* ── Skeleton cards ──────────────────────────────────────── */
.skeleton-card {
  background: var(--bg-card, #fff); border-radius: 12px; overflow: hidden;
  height: 320px; position: relative;
}
.skeleton-card::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, var(--bg-alt,#f3f4f6) 25%, var(--bg-main,#f9fafb) 50%, var(--bg-alt,#f3f4f6) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ── Dark mode overrides ─────────────────────────────────── */
body.dark .skeleton-card::after {
  background: linear-gradient(90deg, #1e1e2e 25%, #2a2a3e 50%, #1e1e2e 75%);
  background-size: 200% 100%;
}
body.dark .card-title { color: #f3f4f6; }
body.dark .card-footer { border-color: #374151; }
body.dark .view-btn { background: #1e1e2e; border-color: #374151; color: #9ca3af; }
body.dark .results-info { border-color: #374151; }

/* ── btn-clear ───────────────────────────────────────────── */
.btn-clear {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 8px;
  border: 1px solid var(--border, #e5e7eb);
  background: var(--bg-card, #fff); color: var(--text-secondary, #6b7280);
  font-size: 0.8rem; cursor: pointer; transition: all 0.2s;
}
.btn-clear:hover { background: #fee2e2; border-color: #fca5a5; color: #ef4444; }

/* ── Mobile bottom-nav spacing fix (chatbot button room) ─── */
@media (max-width: 768px) {
  .chatbot-toggle-btn { bottom: 74px; }
  .chatbot-panel { bottom: 136px; }
}
