/* ═══════════════════════════════════════════════════════════
   ResumeForge — Component Library
   Toast · Modal · Dropdown · Progress · Chips · Skeleton
═══════════════════════════════════════════════════════════ */

/* ════════════════════════════════════════════════════════════
   TOAST NOTIFICATIONS
════════════════════════════════════════════════════════════ */
#toast-container {
  position: fixed; bottom: 24px; right: 24px; z-index: 99999;
  display: flex; flex-direction: column; gap: 10px;
  pointer-events: none; max-width: 380px; width: calc(100vw - 48px);
}
.toast {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 16px; border-radius: 12px;
  background: #fff; border: 1px solid #e2e8f0;
  box-shadow: 0 8px 28px rgba(0,0,0,.1), 0 2px 8px rgba(0,0,0,.06);
  pointer-events: all; position: relative; overflow: hidden;
  transform: translateX(calc(100% + 32px)); opacity: 0;
  transition: transform .35s cubic-bezier(.34,1.56,.64,1), opacity .3s ease;
}
.toast.show { transform: translateX(0); opacity: 1; }
.toast.hide { transform: translateX(calc(100% + 32px)); opacity: 0; transition: transform .25s ease, opacity .2s ease; }
/* Left accent bar */
.toast::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; border-radius: 12px 0 0 12px; }
.toast-success::before { background: #10b981; }
.toast-error::before   { background: #ef4444; }
.toast-info::before    { background: #6366f1; }
.toast-warning::before { background: #f59e0b; }
/* Icon */
.toast-icon {
  width: 32px; height: 32px; border-radius: 8px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: .85rem;
}
.toast-success .toast-icon { background: #d1fae5; color: #059669; }
.toast-error   .toast-icon { background: #fee2e2; color: #dc2626; }
.toast-info    .toast-icon { background: #eef2ff; color: #6366f1; }
.toast-warning .toast-icon { background: #fef3c7; color: #d97706; }
/* Content */
.toast-body { flex: 1; min-width: 0; }
.toast-title { font-size: .8125rem; font-weight: 700; color: #1e293b; line-height: 1.3; }
.toast-msg   { font-size: .775rem; color: #64748b; margin-top: 2px; line-height: 1.4; }
/* Close */
.toast-close {
  width: 24px; height: 24px; border-radius: 6px; border: none;
  background: transparent; color: #94a3b8; cursor: pointer; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: .75rem;
  transition: all .15s;
}
.toast-close:hover { background: #f1f5f9; color: #475569; }
/* Progress bar */
.toast-progress {
  position: absolute; bottom: 0; left: 4px; right: 0; height: 3px;
  background: #e2e8f0; border-radius: 0 0 12px 0;
}
.toast-progress-bar {
  height: 100%; border-radius: 0 0 12px 0;
  transition: width linear;
}
.toast-success .toast-progress-bar { background: #10b981; }
.toast-error   .toast-progress-bar { background: #ef4444; }
.toast-info    .toast-progress-bar { background: #6366f1; }
.toast-warning .toast-progress-bar { background: #f59e0b; }

/* ════════════════════════════════════════════════════════════
   MODAL
════════════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0; z-index: 9000;
  background: rgba(15,23,42,.45); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; padding: 24px;
  opacity: 0; transition: opacity .2s ease;
}
.modal-overlay.open { opacity: 1; }
.modal {
  background: #fff; border-radius: 16px; padding: 0;
  width: 100%; max-width: 540px; max-height: 90vh;
  overflow: hidden; display: flex; flex-direction: column;
  box-shadow: 0 24px 64px rgba(0,0,0,.18);
  transform: scale(.95) translateY(8px); transition: transform .25s cubic-bezier(.34,1.2,.64,1);
}
.modal-overlay.open .modal { transform: scale(1) translateY(0); }
.modal-header {
  display: flex; align-items: center; gap: 12px;
  padding: 20px 24px; border-bottom: 1px solid #e2e8f0; flex-shrink: 0;
}
.modal-title { flex: 1; font-size: 1rem; font-weight: 700; color: #1e293b; }
.modal-close {
  width: 32px; height: 32px; border-radius: 8px; border: none;
  background: #f1f5f9; color: #64748b; cursor: pointer; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: .8rem;
  transition: all .15s;
}
.modal-close:hover { background: #e2e8f0; color: #1e293b; }
.modal-body { flex: 1; overflow-y: auto; padding: 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid #e2e8f0; display: flex; gap: 10px; justify-content: flex-end; flex-shrink: 0; }

/* ════════════════════════════════════════════════════════════
   PROGRESS RING / BAR
════════════════════════════════════════════════════════════ */
.progress-ring { position: relative; display: inline-flex; }
.progress-ring svg { transform: rotate(-90deg); }
.progress-ring-circle { fill: none; stroke-linecap: round; transition: stroke-dashoffset .5s ease; }
.progress-ring-label {
  position: absolute; inset: 0; display: flex;
  flex-direction: column; align-items: center; justify-content: center;
}
.progress-ring-pct   { font-size: .9rem; font-weight: 800; color: #1e293b; line-height: 1; }
.progress-ring-text  { font-size: .6rem; color: #94a3b8; font-weight: 500; text-transform: uppercase; letter-spacing: .05em; }

/* Horizontal progress bar */
.progress-h { height: 6px; background: #e2e8f0; border-radius: 3px; overflow: hidden; }
.progress-h-bar { height: 100%; border-radius: 3px; transition: width .4s ease; }
.progress-h-bar.primary { background: linear-gradient(90deg,#6366f1,#8b5cf6); }
.progress-h-bar.success { background: #10b981; }
.progress-h-bar.warning { background: #f59e0b; }

/* ════════════════════════════════════════════════════════════
   COMPLETION CHECKLIST (wizard sidebar overlay)
════════════════════════════════════════════════════════════ */
.completeness-panel {
  background: #fff; border: 1px solid #e2e8f0; border-radius: 12px;
  padding: 14px 16px; margin-bottom: 16px;
}
.completeness-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
}
.completeness-title { font-size: .78rem; font-weight: 700; color: #1e293b; }
.completeness-pct   { font-size: .82rem; font-weight: 800; color: #6366f1; }
.completeness-list  { display: flex; flex-direction: column; gap: 5px; }
.check-item {
  display: flex; align-items: center; gap: 8px;
  font-size: .76rem; color: #64748b;
}
.check-item i { font-size: .7rem; width: 14px; text-align: center; }
.check-item.done { color: #059669; }
.check-item.done i { color: #10b981; }
.check-item.missing { color: #94a3b8; }
.check-item.missing i { color: #cbd5e1; }

/* ════════════════════════════════════════════════════════════
   ATS SCORE PANEL
════════════════════════════════════════════════════════════ */
.ats-panel {
  background: linear-gradient(135deg, #f8fafc 0%, #f0f4ff 100%);
  border: 1px solid #e2e8f0; border-radius: 12px; padding: 16px;
  margin-bottom: 16px;
}
.ats-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; gap: 10px; }
.ats-title {
  display: flex; align-items: center; gap: 7px;
  font-size: .82rem; font-weight: 700; color: #1e293b;
}
.ats-title i { color: #6366f1; }
.ats-score-badge {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 12px; border-radius: 20px;
  font-size: .8rem; font-weight: 800;
}
.ats-score-badge.good    { background: #d1fae5; color: #065f46; }
.ats-score-badge.ok      { background: #fef3c7; color: #92400e; }
.ats-score-badge.poor    { background: #fee2e2; color: #991b1b; }
.ats-tips { display: flex; flex-direction: column; gap: 6px; }
.ats-tip {
  display: flex; align-items: flex-start; gap: 8px;
  font-size: .75rem; line-height: 1.45; padding: 6px 8px;
  border-radius: 7px; background: #fff; border: 1px solid #e2e8f0;
}
.ats-tip i { font-size: .72rem; flex-shrink: 0; margin-top: 1px; }
.ats-tip.pass { border-color: #a7f3d0; background: #f0fdf4; color: #065f46; }
.ats-tip.pass i { color: #10b981; }
.ats-tip.fail { border-color: #fca5a5; background: #fef2f2; color: #991b1b; }
.ats-tip.fail i { color: #ef4444; }
.ats-tip.warn { border-color: #fcd34d; background: #fefce8; color: #92400e; }
.ats-tip.warn i { color: #f59e0b; }

/* ════════════════════════════════════════════════════════════
   MOBILE TOPBAR (hamburger)
════════════════════════════════════════════════════════════ */
.mobile-topbar {
  display: none; height: 54px; padding: 0 16px;
  align-items: center; justify-content: space-between;
  background: #fff; border-bottom: 1px solid #e2e8f0;
  position: sticky; top: 0; z-index: 100;
}
.mobile-logo { font-size: 1rem; font-weight: 800; color: #1e293b; display: flex; align-items: center; gap: 8px; }
.mobile-logo span { color: #6366f1; }
.mobile-logo .logo-icon { width: 28px; height: 28px; border-radius: 7px; font-size: .72rem; }
.hamburger {
  width: 36px; height: 36px; border-radius: 8px; border: 1.5px solid #e2e8f0;
  background: #fff; display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: #64748b; font-size: .85rem; transition: all .15s;
}
.hamburger:hover { background: #f8fafc; color: #1e293b; }
/* Sidebar overlay on mobile */
.sidebar-overlay {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,.3);
  z-index: 199; backdrop-filter: blur(2px);
}
.sidebar-overlay.show { display: block; }
@media (max-width: 768px) {
  .mobile-topbar { display: flex; }
  .main-content  { padding-top: 0; }
}

/* ════════════════════════════════════════════════════════════
   CHAR COUNT
════════════════════════════════════════════════════════════ */
.field-wrap { position: relative; }
.char-count {
  position: absolute; bottom: 8px; right: 10px;
  font-size: .66rem; color: #cbd5e1; pointer-events: none;
  transition: color .15s;
}
.char-count.warn { color: #f59e0b; }
.char-count.over { color: #ef4444; }

/* ════════════════════════════════════════════════════════════
   FIELD ERROR STATE
════════════════════════════════════════════════════════════ */
input.field-error, select.field-error, textarea.field-error {
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 3px rgba(239,68,68,.12) !important;
  animation: shake .3s ease;
}
@keyframes shake {
  0%,100% { transform: translateX(0); }
  25%      { transform: translateX(-4px); }
  75%      { transform: translateX(4px); }
}
.field-error-msg { font-size: .72rem; color: #dc2626; margin-top: 3px; display: flex; align-items: center; gap: 4px; }
.field-error-msg i { font-size: .68rem; }

/* ════════════════════════════════════════════════════════════
   SKELETON LOADER
════════════════════════════════════════════════════════════ */
.skeleton { background: #e2e8f0; border-radius: 4px; animation: shimmer 1.4s infinite; }
@keyframes shimmer {
  0%   { background-color: #e2e8f0; }
  50%  { background-color: #f1f5f9; }
  100% { background-color: #e2e8f0; }
}

/* ════════════════════════════════════════════════════════════
   DRAG & DROP UPLOAD
════════════════════════════════════════════════════════════ */
.drop-zone {
  border: 2px dashed #e2e8f0; border-radius: 10px; padding: 20px;
  text-align: center; transition: all .2s; cursor: pointer;
  background: #f8fafc;
}
.drop-zone:hover, .drop-zone.drag-over {
  border-color: #a5b4fc; background: #eef2ff;
}
.drop-zone.drag-over { border-style: solid; }

/* ════════════════════════════════════════════════════════════
   SESSION EXPIRY WARNING BANNER
════════════════════════════════════════════════════════════ */
#session-warning {
  display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 9999;
  background: #1e293b; color: #f1f5f9; padding: 14px 24px;
  align-items: center; justify-content: center; gap: 16px;
  font-size: .875rem;
}
#session-warning.show { display: flex; }
#session-warning strong { color: #fbbf24; }
#session-warning .btn { flex-shrink: 0; }

/* ════════════════════════════════════════════════════════════
   KEYBOARD SHORTCUT HINT
════════════════════════════════════════════════════════════ */
.kbd {
  display: inline-flex; align-items: center;
  padding: 2px 6px; border-radius: 4px;
  background: #f1f5f9; border: 1px solid #e2e8f0;
  font-size: .68rem; font-weight: 600; color: #475569;
  font-family: 'Courier New', monospace;
}

/* ════════════════════════════════════════════════════════════
   PROFILE PAGE CARD
════════════════════════════════════════════════════════════ */
.profile-avatar-lg {
  width: 72px; height: 72px; border-radius: 50%;
  background: linear-gradient(135deg,#6366f1,#8b5cf6);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 1.75rem; font-weight: 800;
  flex-shrink: 0; box-shadow: 0 6px 20px rgba(99,102,241,.3);
}
.profile-section {
  background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 24px; margin-bottom: 20px;
}
.profile-section-title {
  display: flex; align-items: center; gap: 8px;
  font-size: .875rem; font-weight: 700; color: #1e293b;
  margin-bottom: 18px; padding-bottom: 12px; border-bottom: 1px solid #e2e8f0;
}
.profile-section-title i { color: #6366f1; }
.danger-zone { border-color: #fca5a5 !important; }
.danger-zone .profile-section-title { color: #dc2626; }
.danger-zone .profile-section-title i { color: #dc2626; }
