@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

:root {
  --primary: #2f3a46; /* dark grey-blue */
  --primary-ink: #1f2937;
  --ink: #0b0f14;
  --ink-2: #374151;
  --ink-3: #6b7280;
  --border: #e5e7eb;
  --bg: #f9fafb; /* light grey background */
  --card: #ffffff;
  --success: #10b981;
  --error: #ef4444;
  --radius: 12px;
  --radius-sm: 10px;
  --shadow: 0 6px 18px rgba(0, 0, 0, 0.06);

  --pad: 0.9rem;
  --pad-lg: 1.2rem;

  --footer-font: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.55;
  color: var(--ink-2);
  background-color: var(--bg);
}

main.container { max-width: 1100px; margin: 1.25rem auto; padding: 0.75rem; }

/* Utilities */
.hidden { display: none !important; }
.d-flex { display: flex; }
.text-center { text-align: center; }
.text-light { color: var(--ink-3); }
.margin-bottom-sm { margin-bottom: 0.6rem; }
.margin-top-sm { margin-top: 0.6rem; }
.margin-bottom-md { margin-bottom: 1rem; }
.padding-top-0 { padding-top: 0; }
.full-width { width: 100%; }
.text-ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Highlight badge (yellow) */
.badge-highlight {
  display: inline-block;
  background-color: #fef3c7 !important;
  color: #92400e !important;
  border: 1px solid #fde68a !important;
  padding: 0.5rem 0.6rem;
  border-radius: 8px;
  font-weight: 700;
}

/* Layout aids */
.grid { display: grid; gap: 1rem; }
.grid.two { grid-template-columns: 1.3fr 1fr; }
.grid.three { grid-template-columns: repeat(3, 1fr); }

/* Header */
.header { text-align: center; margin-bottom: 1rem; }
h1 { font-size: 2rem; font-weight: 800; color: var(--primary-ink); margin-bottom: 0.3rem; }
.header p { font-size: 1rem; color: var(--ink-3); }

/* Sections / Cards */
.form-section {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  border: 1px solid var(--border);
}

.stepper {
  display: flex;
  padding: 0.75rem var(--pad-lg);
  background-color: #f3f4f6;
  border-bottom: 1px solid var(--border);
  gap: 0.8rem;
}
.step { flex: 1; text-align: center; position: relative; }
.step-number {
  width: 34px; height: 34px; background: white; color: var(--ink-3);
  border: 2px solid var(--border); border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; margin-bottom: 0.3rem; transition: all 0.2s ease;
}
.step.active .step-number { border-color: var(--primary); background: var(--primary); color: white; }
.step.completed .step-number { border-color: var(--success); background: var(--success); color: white; }
.step-label { font-size: 0.82rem; color: var(--ink-3); font-weight: 600; }
.step.active .step-label { color: var(--primary-ink); }

.tab-content { display: none; padding: var(--pad-lg); }
.tab-content.active { display: block; }

.card {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: var(--pad);
  margin-bottom: 0.9rem;
  background: #fff;
}
.card-title {
  font-size: 1rem; font-weight: 800; color: var(--primary-ink);
  margin-bottom: 0.75rem; display: flex; align-items: center; gap: 0.45rem;
}

/* Mini card for base resume status */
.mini-card-status {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fcfcfd;
  min-height: 80px; /* Ensure consistent height */
}
.mini-card-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background-color: var(--border); /* Default grey */
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s ease;
}
.mini-card-icon::before {
  content: '📄'; /* Default file emoji */
  font-size: 1.1rem;
  line-height: 1;
}
.mini-card-status.uploaded .mini-card-icon {
  background-color: var(--success);
  color: white;
  border-color: var(--success);
}
.mini-card-status.uploaded .mini-card-icon::before {
  content: '✓'; /* Checkmark for uploaded */
  font-size: 1.1rem;
  font-weight: 900;
}

.mini-card-text { flex-grow: 1; }
.mini-card-title {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--ink-3);
  margin-bottom: 0.2rem;
}
.mini-card-value {
  font-size: 0.95rem;
  color: var(--primary-ink);
}


/* Form */
.form-group { margin-bottom: 0.75rem; }
label { display: block; margin-bottom: 0.35rem; font-weight: 700; color: var(--ink-2); font-size: 0.95rem; }
.form-control {
  width: 100%;
  padding: 0.62rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
  transition: all 0.15s;
  background: #fff;
}
.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(47, 58, 70, 0.12);
}
textarea.form-control { min-height: 120px; resize: vertical; }

/* Buttons */
.action-buttons { display: flex; gap: 0.6rem; margin-top: 0.4rem; flex-wrap: wrap; }
.action-buttons.right { justify-content: flex-end; }
.action-buttons.space-between { justify-content: space-between; }
.btn {
  background: var(--primary); color: white; padding: 0.62rem 1rem;
  border: none; border-radius: 8px; cursor: pointer; font-size: 0.98rem;
  font-weight: 800; transition: all 0.15s; display: inline-flex;
  align-items: center; justify-content: center; gap: 0.45rem; text-decoration: none;
}
.btn:hover { filter: brightness(0.95); }
.btn-outline {
  background: transparent; border: 1px solid var(--primary); color: var(--primary);
}
.btn-outline:hover { background: #f3f4f6; }

/* Results */
#resumeResults { padding: var(--pad); }
.resume-paper {
  background: white; padding: 1.25rem; box-shadow: var(--shadow);
  border-radius: 10px; max-width: 816px; margin: 0 auto; border: 1px solid var(--border);
}
.resume-header {
  text-align: center; border-bottom: 2px solid var(--border);
  padding-bottom: 0.6rem; margin-bottom: 0.9rem;
}
.resume-name { font-size: 1.7rem; font-weight: 900; color: var(--primary-ink); }
.resume-title { font-size: 1rem; color: var(--ink-2); font-weight: 700; margin: 0.2rem 0 0.5rem 0; }
.resume-contact { font-size: 0.9rem; color: var(--ink-3); }
.resume-contact a { color: var(--primary-ink); text-decoration: none; }
.resume-section { margin-bottom: 1rem; }
.section-title {
  font-size: 0.92rem; font-weight: 900; color: var(--primary-ink);
  border-bottom: 1px solid var(--border); padding-bottom: 0.25rem; margin-bottom: 0.6rem;
  text-transform: uppercase; letter-spacing: 0.05em;
}
.summary-content { font-size: 0.95rem; line-height: 1.65; color: var(--ink-2); }
.skills-list { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.skill-item {
  background: #f3f4f6; color: var(--primary-ink); padding: 0.18rem 0.55rem;
  border-radius: 999px; font-size: 0.82rem; font-weight: 800; border: 1px solid var(--border);
}
.job-item { margin-bottom: 1rem; }
.job-header { display: flex; justify-content: space-between; flex-wrap: wrap; margin-bottom: 0.15rem; gap: 0.2rem; }
.job-title { font-weight: 900; font-size: 0.98rem; color: var(--ink-2); }
.job-company { font-weight: 800; }
.job-meta { color: var(--ink-3); font-size: 0.88rem; }
.job-description { margin-top: 0.35rem; }
.job-bullet { position: relative; padding-left: 1.1rem; margin-bottom: 0.35rem; font-size: 0.95rem; color: var(--ink-2); }
.job-bullet:before { content: '•'; position: absolute; left: 0; color: var(--primary); font-size: 1.05em; line-height: 1; }

/* Results actions */
.action-buttons-container { padding: var(--pad); border-top: 1px solid var(--border); background-color: var(--bg); }
.action-buttons { max-width: 816px; margin: 0 auto; align-items: center; }

/* Radio group */
.radio-group { display: flex; flex-direction: column; gap: 0.6rem; }
.radio-label {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.7rem; border: 1px solid var(--border);
  border-radius: 8px; cursor: pointer; transition: all 0.15s;
}
.radio-label:hover { background-color: #f9fafb; border-color: var(--primary); }
.radio-label input[type='radio'], .radio-label input[type='checkbox'] {
  margin-right: 0.2rem; accent-color: var(--primary); width: 1.05em; height: 1.05em;
}
.radio-label small { color: var(--ink-3); }

/* Navbar */
.navbar {
  background: white; box-shadow: var(--shadow); padding: 0 0.75rem; position: sticky;
  top: 0; z-index: 100; border-bottom: 1px solid var(--border);
}
.nav-container { max-width: 1100px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; height: 58px; gap: 0.6rem; }
.nav-brand { font-size: 1.05rem; font-weight: 900; color: var(--primary-ink); text-decoration: none; }
.nav-links { display: flex; align-items: center; gap: 0.6rem; }
.nav-link { text-decoration: none; color: var(--ink-2); font-weight: 800; transition: color 0.15s; }
.nav-link:hover { color: var(--primary); }
.nav-links span { color: var(--ink-3); }

/* Flash messages */
.flash-message {
  padding: 0.7rem; margin-bottom: 0.9rem; border-radius: 10px;
  border: 1px solid transparent; display: flex; align-items: center;
}
.flash-message i { margin-right: 0.5rem; }
.flash-success { background-color: #ecfdf5; color: #065f46; border-color: #a7f3d0; }
.flash-error { background-color: #fef2f2; color: #991b1b; border-color: #fecaca; }

/* Dashboard */
.dashboard-header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0.6rem; margin-bottom: 0.9rem; }
.empty-state { text-align: center; color: var(--ink-3); padding: 1.25rem 0.75rem; border: 2px dashed var(--border); border-radius: 10px; }
.resume-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 0.9rem; }
.resume-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: var(--shadow); display: flex; flex-direction: column; transition: box-shadow 0.15s ease-in-out;
}
.resume-card:hover { box-shadow: 0 10px 22px rgba(0,0,0,0.08); }
.resume-card-content { padding: 1rem; flex-grow: 1; text-decoration: none; color: inherit; }
.resume-card-title { font-size: 1rem; font-weight: 900; color: var(--primary-ink); }
.resume-card-subtitle { color: var(--ink-2); margin: 0.2rem 0 0.55rem; }
.resume-card-date { color: var(--ink-3); font-size: 0.8rem; }
.resume-card-actions { padding: 0.75rem 1rem; border-top: 1px solid var(--border); background-color: #f9fafb; display: flex; gap: 0.5rem; justify-content: flex-end; }
.btn-sm { padding: 0.4rem 0.7rem; font-size: 0.9rem; }
.btn-danger { color: var(--error); border-color: var(--error); }
.btn-danger:hover { background-color: #fef2f2; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); background: #fff; margin-top: 1.25rem; }
.footer-inner {
  max-width: 1100px; margin: 0 auto; padding: 0.9rem 0.75rem;
  display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; justify-content: space-between;
  font-family: var(--footer-font);
}
.footer-links { display: flex; gap: 1rem; flex-wrap: wrap; }
.footer-links a {
  color: var(--primary-ink);
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.footer-links a:hover { color: var(--primary); }
.footer-copy {
  color: var(--ink-3);
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

/* Progress Overlay */
.loading-container {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(249, 250, 251, 0.96);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
}
.progress-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem 1.4rem;
  width: 100%;
  max-width: 520px;
}
.progress-title {
  font-size: 1.2rem;
  font-weight: 900;
  color: var(--primary-ink);
  text-align: center;
  margin-bottom: 0.9rem;
}
.progress-tracker { list-style: none; padding: 0; margin: 0; }
.progress-step {
  display: flex;
  align-items: center;
  font-size: 0.98rem;
  color: var(--ink-3);
  margin-bottom: 0.6rem;
  transition: color 0.25s ease;
}
.progress-icon {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-radius: 50%;
  margin-right: 0.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s ease;
}
.progress-step.in-progress { color: var(--ink-2); font-weight: 800; }
.progress-step.in-progress .progress-icon { border-color: var(--primary); animation: spin 1s linear infinite; }
.progress-step.completed { color: var(--ink-2); }
.progress-step.completed .progress-icon { background-color: var(--success); border-color: var(--success); color: white; }
.progress-step.completed .progress-icon::before { content: '✓'; font-size: 0.85rem; line-height: 1; }

@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* Print */
@media print {
  body { background-color: #ffffff; font-size: 10pt; }
  .no-print { display: none !important; }
  main.container, .form-section, .resume-paper { margin: 0; padding: 0; box-shadow: none; border: none; }
  .resume-paper { max-width: 100%; }
  .resume-contact a { text-decoration: none; color: var(--ink-2); }
}

/* Responsive */
@media (max-width: 920px) {
  main.container { margin: 1rem auto; padding: 0.6rem; }
  .grid.two { grid-template-columns: 1fr; } /* Stack grid on smaller screens */
}

@media (max-width: 768px) {
  body { font-size: 15px; }
  .header h1 { font-size: 1.7rem; }
  .header p { font-size: 1rem; }
  .tab-content, #resumeResults { padding: 1rem; }

  /* Stepper improvements for mobile */
  .stepper {
    flex-direction: row; /* Keep horizontal on mobile, but wrap */
    flex-wrap: wrap;
    justify-content: center; /* Center items */
    gap: 0.7rem 1.2rem; /* Add horizontal spacing between steps */
    padding: 0.75rem; /* Adjust padding */
  }
  .step {
    flex: none; /* Don't grow to fill space */
    width: auto; /* Allow content to dictate width */
    display: flex; /* Flex container for number and label */
    align-items: center; /* Align vertically */
    gap: 0.4rem; /* Space between number and label */
    text-align: left; /* Align text left within its flex item */
  }
  .step-number {
    width: 28px; /* Smaller size */
    height: 28px;
    font-size: 0.8rem; /* Smaller font */
    margin-bottom: 0; /* Remove bottom margin when horizontal */
  }
  .step-label {
    font-size: 0.8rem; /* Smaller label font */
  }

  .job-header { flex-direction: column; align-items: flex-start; gap: 0.1rem; }
  .resume-paper { padding: 1rem; }
  .resume-name { font-size: 1.5rem; }
  .action-buttons { flex-direction: column; }
  .action-buttons .btn, .action-buttons .btn-outline { width: 100%; justify-content: center; }
  .nav-container { height: auto; padding: 0.5rem 0; flex-wrap: wrap; }
  .nav-links { width: 100%; justify-content: space-between; flex-wrap: wrap; }
}


.mini-card-status {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fcfcfd;
  min-height: 80px;
}

.mini-card-icon {
  width: 30px;
  height: 30px;
  border-radius: 6px;           /* square with subtle rounding */
  background-color: #e5e7eb;    /* neutral when not uploaded */
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 1rem;
  box-shadow: inset 0 0 0 2px rgba(0,0,0,0.02);
}

.mini-card-icon::before {
  content: '☐';                 /* empty box style when not uploaded */
  color: #4b5563;
  font-size: 1rem;
  line-height: 1;
}

.mini-card-status.uploaded .mini-card-icon {
  background-color: #0ea24c;    /* vivid green box */
  box-shadow: none;
}

.mini-card-status.uploaded .mini-card-icon::before {
  content: '✓';
  color: #ffffff;               /* white check */
  font-size: 1.05rem;
  line-height: 1;
  font-weight: 900;
}
