/* =============================================
   Screenly — features.css
   JD Matcher + Line Analysis new feature panels
   ============================================= */

/* ── Shared feature section wrapper ── */
.feature-section {
  padding: 64px var(--page-pad) 80px;
  animation: fade-in 0.5s ease forwards;
}

.feature-container { max-width: var(--page-max); margin: 0 auto; }

.feature-header {
  display: flex; align-items: center; gap: 16px;
  margin-bottom: 36px; padding-bottom: 24px;
  border-bottom: 2px solid var(--border);
}

.feature-icon {
  width: 52px; height: 52px; border-radius: var(--radius);
  background: var(--accent-light); border: 1px solid var(--accent);
  color: var(--accent); display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; flex-shrink: 0;
}

.feature-title { font-family: var(--font-display); font-size: 1.75rem; font-weight: 900; letter-spacing: -0.5px; color: var(--text); }
.feature-subtitle { font-size: 0.95rem; color: var(--text-muted); margin-top: 4px; }

/* ── JD input area ── */
.jd-input-wrap {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px; margin-bottom: 28px;
  box-shadow: var(--shadow-card);
}

.jd-label {
  display: block; font-size: 0.82rem; font-weight: 900;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-muted); margin-bottom: 10px;
}

.jd-textarea {
  width: 100%; min-height: 180px;
  background: var(--bg); border: 1px solid var(--border-dark);
  border-radius: var(--radius-sm); padding: 14px 16px;
  font-family: var(--font-body); font-size: 0.95rem; color: var(--text);
  resize: vertical; line-height: 1.6;
  transition: border-color var(--transition);
  outline: none;
}

.jd-textarea:focus { border-color: var(--accent); }
.jd-textarea::placeholder { color: var(--text-dim); }

.jd-submit-btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 40px; background: var(--accent); color: #fff;
  font-family: var(--font-body); font-weight: 700; font-size: 1rem;
  border-radius: var(--radius-sm); cursor: pointer; border: none;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition), opacity var(--transition);
  margin-top: 14px;
}

.jd-submit-btn:hover:not(:disabled) { background: #a93226; transform: translateY(-2px); box-shadow: 0 8px 24px rgba(192,57,43,0.3); }
.jd-submit-btn:disabled { opacity: 0.55; cursor: not-allowed; }

/* ── JD match score hero ── */
.match-score-hero {
  display: flex; align-items: center; gap: 40px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 32px;
  margin-bottom: 28px; box-shadow: var(--shadow-card); flex-wrap: wrap;
}

.match-score-circle { flex-shrink: 0; text-align: center; }
.match-score-circle .score-svg { width: 160px; height: 160px; }

.match-score-fill {
  fill: none; stroke-width: 10; stroke-linecap: round;
  stroke-dasharray: 439.8; stroke-dashoffset: 439.8;
  transition: stroke-dashoffset 1.5s cubic-bezier(0.4,0,0.2,1);
  stroke: var(--accent);
  transform: rotate(-90deg);
  transform-origin: 80px 80px;
}

.match-verdicts { flex: 1; min-width: 260px; }
.match-verdict-item { margin-bottom: 16px; }
.match-verdict-label {
  font-size: 0.78rem; font-weight: 900; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--text-muted); margin-bottom: 4px;
}
.match-verdict-text { font-size: 0.95rem; color: var(--text); line-height: 1.55; }

/* ── Skill grid visualisation ── */
.skill-grid-wrap {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px; margin-bottom: 24px;
  box-shadow: var(--shadow-card);
}

.skill-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px; margin-top: 16px;
}

.skill-tile {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); font-size: 0.85rem;
  font-family: var(--font-body); font-weight: 700;
  position: relative; overflow: hidden;
}

.skill-tile.both     { background: var(--success-light); border-color: rgba(26,122,74,0.3); color: var(--text); }
.skill-tile.jd-only  { background: var(--danger-light);  border-color: rgba(192,57,43,0.3); color: var(--danger); }
.skill-tile.res-only { background: var(--bg-subtle);     border-color: var(--border-dark);  color: var(--text-muted); }

.skill-tile-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.both     .skill-tile-dot { background: var(--success); }
.jd-only  .skill-tile-dot { background: var(--danger); }
.res-only .skill-tile-dot { background: var(--border-dark); }

.skill-tile-importance {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  font-size: 0.65rem; font-family: var(--font-mono); color: var(--text-dim);
  text-transform: uppercase; letter-spacing: 0.05em;
}

/* ── Recommendations list ── */
.recommendations-list { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.recommendation-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 16px; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 0.9rem; color: var(--text); line-height: 1.55;
}
.rec-num {
  flex-shrink: 0; width: 24px; height: 24px; border-radius: 50%;
  background: var(--accent); color: #fff;
  font-size: 0.75rem; font-weight: 900; font-family: var(--font-mono);
  display: flex; align-items: center; justify-content: center;
  margin-top: 1px;
}

/* ── Line analysis ── */
.line-trigger-btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 36px; background: var(--accent2); color: #fff;
  font-family: var(--font-body); font-weight: 700; font-size: 1rem;
  border-radius: var(--radius-sm); cursor: pointer; border: none;
  transition: transform var(--transition), box-shadow var(--transition), opacity var(--transition);
}
.line-trigger-btn:hover:not(:disabled) { opacity: 0.85; transform: translateY(-2px); box-shadow: 0 8px 24px rgba(44,62,80,0.3); }
.line-trigger-btn:disabled { opacity: 0.55; cursor: not-allowed; }

/* Auto-analysis notice (spinner + text shown while analysis runs) */
.line-auto-notice {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 20px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); width: fit-content;
  font-size: 0.9rem; color: var(--text-muted);
}
.line-auto-spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid var(--border-dark);
  border-top-color: var(--accent2);
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

.line-stats-row { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; margin-bottom: 24px; }

/* ── Line filter bar ── */
.line-filter-bar {
  display: flex; align-items: center; gap: 8px;
  flex-wrap: wrap; margin-bottom: 16px;
}

.line-filter-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 999px; cursor: pointer;
  font-size: 0.8rem; font-family: var(--font-body); font-weight: 700;
  color: var(--text-muted);
  transition: background var(--transition), border-color var(--transition), color var(--transition);
  white-space: nowrap;
}
.line-filter-btn:hover { background: var(--bg-subtle); color: var(--text); }
.line-filter-btn.active {
  background: var(--accent); border-color: var(--accent); color: #fff;
}
/* When the active button wraps a badge, the badge text colour should inherit */
.line-filter-btn.active .line-rating-badge {
  background: transparent; border-color: rgba(255,255,255,0.5); color: #fff;
}

/* Count bubble on each filter button */
.filter-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 4px;
  border-radius: 999px;
  background: var(--bg-subtle); border: 1px solid var(--border-dark);
  font-size: 0.7rem; font-family: var(--font-mono); font-weight: 700;
  color: var(--text-muted); line-height: 1;
}
.line-filter-btn.active .filter-count {
  background: rgba(255,255,255,0.2); border-color: rgba(255,255,255,0.3); color: #fff;
}

.line-list { display: flex; flex-direction: column; gap: 10px; }

.line-item {
  border-radius: var(--radius-sm); border: 1px solid var(--border);
  overflow: hidden; background: var(--bg-card);
}

.line-item-header {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; cursor: pointer;
  transition: background var(--transition);
}
.line-item-header:hover { background: var(--bg-subtle); }

.line-rating-badge {
  padding: 2px 8px; border-radius: 3px;
  font-size: 0.72rem; font-family: var(--font-mono);
  font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
  flex-shrink: 0;
}
.line-rating-badge.good           { background: var(--success-light); color: var(--success); border: 1px solid var(--success); }
.line-rating-badge.weak           { background: var(--warning-light); color: var(--warning); border: 1px solid var(--warning); }
.line-rating-badge.missing_metric { background: rgba(41,128,185,0.1); color: #2980b9; border: 1px solid #2980b9; }
.line-rating-badge.passive        { background: var(--danger-light);  color: var(--danger);  border: 1px solid var(--danger); }
.line-rating-badge.repetitive     { background: rgba(142,68,173,0.1); color: #8e44ad; border: 1px solid #8e44ad; }

.line-original { font-size: 0.875rem; color: var(--text); flex: 1; line-height: 1.5; }

.line-item-body {
  padding: 12px 14px; border-top: 1px solid var(--border);
  display: none;
}
.line-item-body.open { display: block; }

.line-issue   { font-size: 0.875rem; color: var(--text-muted); margin-bottom: 10px; line-height: 1.5; }
.line-rewrite {
  font-size: 0.875rem; color: var(--text);
  background: var(--success-light); border: 1px solid rgba(26,122,74,0.2);
  border-radius: var(--radius-sm); padding: 9px 12px; line-height: 1.55;
}
.line-rewrite::before { content: '✦ Rewrite: '; color: var(--success); font-weight: 700; }

/* ═══════════════════════════════════════════════════════════════════
   TOOLS MINI-NAV
   Sticky pill bar shown after analysis; lets users jump between
   Analysis → Line Review → Job Matcher → Refined Resume
   ═══════════════════════════════════════════════════════════════════ */
.tools-nav {
  position: sticky;
  top: 0;                       /* sits just below the main nav if needed */
  z-index: 90;
  display: flex; justify-content: center;
  padding: 10px var(--page-pad);
  background: rgba(var(--bg-rgb, 255,255,255), 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  /* entrance animation */
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
}
.tools-nav.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.tools-nav-inner {
  display: flex; align-items: center; gap: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 8px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.07);
}

.tools-nav-label {
  font-size: 0.72rem; font-weight: 900; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--text-dim);
  padding: 0 8px 0 4px;
  border-right: 1px solid var(--border);
  margin-right: 4px;
  white-space: nowrap;
}

.tools-nav-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  font-family: var(--font-body); font-size: 0.82rem; font-weight: 700;
  color: var(--text-muted);
  text-decoration: none;
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background var(--transition), color var(--transition),
              border-color var(--transition), transform var(--transition);
  white-space: nowrap;
}
.tools-nav-btn:hover {
  background: var(--bg-subtle);
  color: var(--text);
  transform: translateY(-1px);
}
.tools-nav-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.tools-nav-icon {
  font-size: 0.95rem;
  line-height: 1;
}

/* Mobile: collapse labels to icons only below 540px */
@media (max-width: 540px) {
  .tools-nav-label { display: none; }
  .tools-nav-btn span:not(.tools-nav-icon) { display: none; }
  .tools-nav-btn { padding: 7px 10px; }
  .tools-nav-inner { gap: 2px; }
}