/* ============================================================
   NTQ Recruitment – Frontend Styles
   ============================================================ */

/* ── Reset / base ─────────────────────────────────────────── */
.ntq-rec *,
.ntq-rec *::before,
.ntq-rec *::after {
  box-sizing: border-box;
}

/* ── Filter form ──────────────────────────────────────────── */
.ntq-filter-form {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 28px;
  padding: 20px;
  background: #f8f9fa;
  border-radius: 8px;
}

.ntq-filter-form select {
  flex: 1 1 180px;
  height: 44px;
  padding: 0 38px 0 14px;
  border: 1px solid #d0d5dd;
  border-radius: 6px;
  font-size: 14px;
  line-height: 1.5;
  background: #fff;
  color: #344054;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  width: 100%;
}

.ntq-filter-form select:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.ntq-filter-form button {
  height: 44px;
  padding: 0 24px;
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
}

.ntq-filter-form button:hover {
  background: #1d4ed8;
}

/* ── Tab filter ───────────────────────────────────────────── */
.ntq-tab-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 28px;
}

.ntq-tab-filter__item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 20px;
  background: #f3f4f6;
  color: #374151;
  border: none;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition:
    background 0.2s,
    color 0.2s;
  white-space: nowrap;
  line-height: 1.4;
}

.ntq-tab-filter__item:hover {
  background: #e5e7eb;
  color: #111827;
}

.ntq-tab-filter__item--active {
  background: #22c55e;
  color: #fff;
}

.ntq-tab-filter__item--active:hover {
  background: #16a34a;
  color: #fff;
}

.ntq-tab-filter__count {
  font-weight: 400;
  opacity: 0.85;
}

/* ── Job list container ───────────────────────────────────── */
.ntq-job-list {
  position: relative;
  min-height: 100px;
}

.ntq-job-list.ntq-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.75);
  border-radius: 8px;
  z-index: 10;
}

.ntq-job-list.ntq-loading::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 36px;
  height: 36px;
  margin: -18px 0 0 -18px;
  border: 3px solid #e5e7eb;
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: ntqSpin 0.7s linear infinite;
  z-index: 11;
}

@keyframes ntqSpin {
  to {
    transform: rotate(360deg);
  }
}

/* ── Job card ─────────────────────────────────────────────── */
.ntq-job-card {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 20px 24px;
  margin-bottom: 12px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  transition:
    box-shadow 0.2s,
    border-color 0.2s;
}

.ntq-job-card:hover {
  border-color: #2563eb;
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.08);
}

.ntq-job-card__body {
  flex: 1;
}

.ntq-job-card__title {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 700;
  color: #111827;
}

.ntq-job-card__title a {
  color: inherit;
  text-decoration: none;
}

.ntq-job-card__title a:hover {
  color: #2563eb;
}

.ntq-job-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}

.ntq-job-card__tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  background: #eff6ff;
  color: #1d4ed8;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.ntq-job-card__excerpt {
  margin: 0;
  color: #6b7280;
  font-size: 14px;
  line-height: 1.6;
}

.ntq-job-card__action {
  flex-shrink: 0;
  align-self: center;
}

.ntq-btn {
  display: inline-block;
  padding: 10px 22px;
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s;
}

.ntq-btn:hover {
  background: #1d4ed8;
  color: #fff;
}

.ntq-btn--outline {
  background: transparent;
  color: #2563eb;
  border: 2px solid #2563eb;
}

.ntq-btn--outline:hover {
  background: #2563eb;
  color: #fff;
}

/* ── No jobs message ──────────────────────────────────────── */
.ntq-no-jobs {
  padding: 32px;
  text-align: center;
  color: #6b7280;
  background: #f9fafb;
  border-radius: 8px;
  font-size: 15px;
}

/* ── Pagination ───────────────────────────────────────────── */
.ntq-pagination {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 28px;
}

.ntq-pagination__item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 6px;
  border: 1px solid #d1d5db;
  background: #fff;
  color: #374151;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.15s;
}

.ntq-pagination__item:hover {
  background: #f3f4f6;
  border-color: #9ca3af;
}

.ntq-pagination__item--active {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
  pointer-events: none;
}

.ntq-pagination__item--disabled {
  opacity: 0.35;
  pointer-events: none;
  cursor: default;
}

.ntq-pagination__item--prev,
.ntq-pagination__item--next {
  font-size: 16px;
}

/* ── Application form ─────────────────────────────────────── */
.ntq-apply-section {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 2px solid #e5e7eb;
}

.ntq-apply-section h2 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 24px;
  color: #111827;
}

.ntq-apply-form {
  max-width: 600px;
}

.ntq-form-group {
  margin-bottom: 20px;
}

.ntq-form-group label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 6px;
}

.ntq-form-group label .ntq-required {
  color: #ef4444;
  margin-left: 2px;
}

.ntq-form-group input[type="text"],
.ntq-form-group input[type="email"],
.ntq-form-group input[type="tel"],
.ntq-form-group input[type="file"],
.ntq-form-group textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  color: #111827;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}

/* ── Custom select wrapper ────────────────────────────────── */
.ntq-select-wrap {
  position: relative;
  display: block;
  width: 100%;
}

.ntq-select-wrap::after {
  content: "";
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 10px;
  height: 6px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23667085' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: contain;
  pointer-events: none;
}

.ntq-select-wrap select {
  width: 100%;
  height: 44px;
  padding: 0 38px 0 14px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  color: #111827;
  background: #fff;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  cursor: pointer;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}

.ntq-select-wrap select:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Filter form uses the same wrapper */
.ntq-filter-form .ntq-select-wrap {
  flex: 1 1 180px;
}

.ntq-filter-form .ntq-select-wrap select {
  width: 100%;
}

.ntq-form-group input:focus,
.ntq-form-group textarea:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.ntq-form-group input[type="file"] {
  padding: 8px 12px;
  background: #f9fafb;
  cursor: pointer;
}

.ntq-field-error {
  display: block;
  margin-top: 5px;
  font-size: 12px;
  color: #ef4444;
  min-height: 16px;
}

.ntq-form-message {
  display: none;
  padding: 14px 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 20px;
}

.ntq-form-message.ntq-success {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.ntq-form-message.ntq-error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

/* ── Form actions row (right-aligned submit) ──────────────── */
.ntq-form-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 4px;
}

.ntq-submit-btn {
  padding: 12px 32px;
  background: #16a34a;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
}

.ntq-submit-btn:hover:not(:disabled) {
  background: #15803d;
}

.ntq-submit-btn:disabled {
  background: #86efac;
  cursor: not-allowed;
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 640px) {
  .ntq-job-card {
    flex-direction: column;
  }

  .ntq-job-card__action {
    width: 100%;
  }

  .ntq-job-card__action .ntq-btn {
    width: 100%;
    text-align: center;
  }

  .ntq-filter-form {
    flex-direction: column;
  }

  .ntq-filter-form select,
  .ntq-filter-form button {
    width: 100%;
  }
}

/* ── Toast notification ───────────────────────────────────── */
.ntq-toast {
  position: fixed;
  bottom: 32px;
  right: 32px;
  z-index: 99999;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  min-width: 300px;
  max-width: 420px;
  padding: 18px 20px;
  background: #fff;
  border-radius: 12px;
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.14),
    0 2px 8px rgba(0, 0, 0, 0.08);
  border-left: 4px solid #16a34a;
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 0.35s ease,
    transform 0.35s ease;
  pointer-events: none;
}

.ntq-toast.ntq-toast--error {
  border-left-color: #dc2626;
}

.ntq-toast.ntq-toast--visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.ntq-toast__icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  background: #dcfce7;
  color: #16a34a;
  font-weight: 700;
}

.ntq-toast--error .ntq-toast__icon {
  background: #fee2e2;
  color: #dc2626;
}

.ntq-toast__body {
  flex: 1;
}

.ntq-toast__title {
  font-size: 14px;
  font-weight: 700;
  color: #111827;
  margin-bottom: 3px;
}

.ntq-toast__msg {
  font-size: 13px;
  color: #6b7280;
  line-height: 1.5;
}

.ntq-toast__close {
  flex-shrink: 0;
  background: none;
  border: none;
  font-size: 18px;
  line-height: 1;
  color: #9ca3af;
  cursor: pointer;
  padding: 0;
  margin-top: 2px;
  transition: color 0.15s;
}

.ntq-toast__close:hover {
  color: #374151;
}

/* ── Success state (replace form with confirmation) ───────── */
.ntq-apply-success {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 40px 32px;
  text-align: center;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 12px;
  margin-top: 20px;
}

.ntq-apply-success__icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #16a34a;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 30px;
}

.ntq-apply-success__title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: #14532d;
}

.ntq-apply-success__sub {
  margin: 0;
  font-size: 14px;
  color: #166534;
  line-height: 1.6;
}

@media (max-width: 480px) {
  .ntq-toast {
    left: 16px;
    right: 16px;
    bottom: 16px;
    min-width: unset;
    max-width: unset;
  }
}

/* ============================================================
   Single Job Detail – two-column layout
   ============================================================ */

/* ── Meta badges bar ──────────────────────────────────────── */
.ntq-job-detail__badges {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.ntq-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
}

.ntq-badge--green svg {
  flex-shrink: 0;
  color: #16a34a;
}

.ntq-badge strong {
  font-weight: 700;
}

/* ── Two-column layout ────────────────────────────────────── */
.ntq-job-detail__layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 32px;
  align-items: start;
}

.ntq-job-detail__content {
  min-width: 0;
}

/* ── Apply card (sidebar) ─────────────────────────────────── */
.ntq-job-detail__sidebar {
  position: sticky;
  top: 24px;
}

.ntq-apply-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.ntq-apply-card__title {
  margin: 0 0 20px;
  font-size: 18px;
  font-weight: 700;
  color: #111827;
  padding-bottom: 14px;
  border-bottom: 1px solid #f0f0f0;
}

/* Override section spacing when inside sidebar card */
.ntq-apply-card .ntq-apply-section {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.ntq-apply-card .ntq-apply-form {
  max-width: none;
}

/* ── Phone + Email two-column row ─────────────────────────── */
.ntq-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* ── Custom file picker button ────────────────────────────── */
.ntq-label-hint {
  font-size: 12px;
  font-weight: 400;
  color: #6b7280;
  margin-left: 4px;
}

.ntq-file-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition:
    background 0.2s,
    border-color 0.2s;
  position: relative;
  overflow: hidden;
}

.ntq-file-label:hover {
  background: #dcfce7;
  border-color: #86efac;
}

.ntq-file-label input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.ntq-file-hint {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: #6b7280;
}

/* ── Salary tag variant (gold tint) ──────────────────────── */
.ntq-job-card__tag--salary {
  background: #fef9c3;
  color: #854d0e;
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 900px) {
  .ntq-job-detail__layout {
    grid-template-columns: 1fr;
  }

  .ntq-job-detail__sidebar {
    position: static;
  }
}

@media (max-width: 560px) {
  .ntq-form-row {
    grid-template-columns: 1fr;
  }
}
