/* style.css - all the styling for the page */

/* ---------- Colors and fonts (change them here) ---------- */
:root {
  --bg: #eef3f1;
  --surface: #ffffff;
  --ink: #14302c;
  --muted: #5b706c;
  --line: #d3dfdb;
  --brand: #0f766e;
  --brand-dark: #0b5a54;
  --amber: #e9a23b;
  --danger: #b3372f;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Source Sans 3", "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.5;
}

h1, h2 {
  font-family: "Bricolage Grotesque", "Segoe UI", sans-serif;
  margin: 0;
}

.hidden {
  display: none !important;
}

/* ---------- Page header ---------- */
.page-header {
  max-width: 1080px;
  margin: 0 auto;
  padding: 40px 20px 20px;
}

.page-header h1 {
  font-size: 2.4rem;
  letter-spacing: -0.02em;
}

.page-header p {
  margin: 6px 0 0;
  color: var(--muted);
}

/* ---------- Two column layout ---------- */
.layout {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 20px 50px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 24px;
}

.panel section + section {
  margin-top: 28px;
}

h2 {
  font-size: 1.2rem;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

h2 small {
  font-family: "Source Sans 3", sans-serif;
  font-weight: 400;
  color: var(--muted);
}

.step {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--brand);
  color: white;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ---------- Tabs ---------- */
.tabs {
  display: inline-flex;
  background: var(--bg);
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 12px;
}

.tab {
  border: none;
  background: transparent;
  padding: 6px 16px;
  border-radius: 7px;
  font: inherit;
  font-size: 0.95rem;
  color: var(--muted);
  cursor: pointer;
}

.tab.active {
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

/* ---------- Inputs ---------- */
textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font: inherit;
  font-size: 0.95rem;
  resize: vertical;
}

textarea:focus {
  outline: 2px solid var(--brand);
  border-color: transparent;
}

input[type="file"] {
  display: none; /* we style the label instead */
}

.file-pick {
  display: block;
  padding: 14px;
  border: 1px dashed var(--brand);
  border-radius: 10px;
  color: var(--brand-dark);
  text-align: center;
  cursor: pointer;
}

.file-pick:hover {
  background: #f1f8f6;
}

/* Drag and drop area */
.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 26px 14px;
  border: 2px dashed var(--line);
  border-radius: 12px;
  color: var(--muted);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.dropzone strong {
  color: var(--ink);
}

.dropzone:hover,
.dropzone.dragging {
  border-color: var(--brand);
  background: #f1f8f6;
}

.dropzone:focus-within,
.file-pick:focus-within {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* ---------- Selected resume list ---------- */
.file-list {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
}

.file-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  margin-bottom: 6px;
  background: var(--bg);
  border-radius: 8px;
  font-size: 0.95rem;
}

.file-list .file-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.remove-btn {
  border: none;
  background: transparent;
  color: var(--danger);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}

/* ---------- Buttons ---------- */
.buttons {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 24px;
}

.btn-main {
  border: none;
  background: var(--brand);
  color: white;
  padding: 12px 24px;
  border-radius: 10px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-main:hover {
  background: var(--brand-dark);
}

.btn-main:disabled {
  background: #8fb9b5;
  cursor: wait;
}

.btn-plain {
  border: none;
  background: transparent;
  color: var(--muted);
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

button:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* ---------- Messages ---------- */
.message {
  margin: 16px 0 0;
  padding: 10px 14px;
  border-radius: 8px;
  background: #fbeceb;
  color: var(--danger);
  font-size: 0.95rem;
}

/* ---------- Results ---------- */
.empty {
  color: var(--muted);
  margin: 0;
}

.summary {
  margin: 0 0 16px;
  color: var(--muted);
}

.result {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 14px;
  margin-bottom: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
}

/* the best candidate is highlighted */
.result.top {
  border-color: var(--amber);
  background: #fffaf0;
}

.rank {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--bg);
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.result.top .rank {
  background: var(--amber);
}

.name-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.name {
  font-weight: 600;
  word-break: break-word;
}

.chip {
  padding: 1px 10px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
}

.chip.strong { background: #d5f0e3; color: #0b6b3a; }
.chip.fair   { background: #fdeccb; color: #8a5a06; }
.chip.low    { background: #eceeee; color: #5b706c; }

.bar {
  height: 10px;
  background: var(--bg);
  border-radius: 10px;
  overflow: hidden;
}

/* the bar grows from 0 to its width (set from JavaScript) */
.fill {
  height: 100%;
  width: 0;
  background: var(--brand);
  border-radius: 10px;
  transition: width 0.8s ease;
}

.result.top .fill {
  background: var(--amber);
}

.score {
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 700;
  font-size: 1.3rem;
}

.skipped {
  margin: 16px 0 0;
  font-size: 0.9rem;
  color: var(--muted);
}

/* ---------- Loading spinner ---------- */
.loading {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
}

.spinner {
  width: 22px;
  height: 22px;
  border: 3px solid var(--line);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ---------- Small screens ---------- */
@media (max-width: 860px) {
  .layout {
    grid-template-columns: 1fr;
  }
}

/* Respect users who prefer less motion */
@media (prefers-reduced-motion: reduce) {
  .fill, .dropzone { transition: none; }
  .spinner { animation-duration: 3s; }
}
