/* =========================
   EERP Frontend UI (Theme-inherit)
   ========================= */

/* Kế thừa font từ Theme (Flatsome) cho toàn bộ plugin */
.eerp-wrap,
.eerp-wrap *,
.eerp-single,
.eerp-single *,
.eerp-modal,
.eerp-modal * {
  font-family: inherit !important;
  box-sizing: border-box;
}

/* Đảm bảo input/button cũng nhận font của theme */
.eerp-wrap button,
.eerp-wrap input,
.eerp-wrap select,
.eerp-wrap textarea,
.eerp-single button,
.eerp-single input,
.eerp-single select,
.eerp-single textarea,
.eerp-modal button,
.eerp-modal input,
.eerp-modal select,
.eerp-modal textarea {
  font-family: inherit !important;
}

/* --- Layout --- */
.eerp-wrap {
  width: 100%;
  margin-bottom: 30px;
}

.eerp-header {
  margin: 0 0 24px;
}

.eerp-heading {
  margin: 0 0 8px;
  font-size: 26px;
  line-height: 1.3;
  font-weight: 700;
  color: #111827;
}

.eerp-subheading {
  margin: 0 0 16px;
  color: #6b7280; /* Màu xám dịu */
  font-size: 16px;
  line-height: 1.6;
}

/* --- Search bar --- */
.eerp-search {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px; /* Bo góc nhẹ */
  padding: 12px 16px;
  background: #fff;
  max-width: 100%;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.eerp-search:focus-within {
  border-color: #3b82f6; /* Màu xanh khi focus */
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.eerp-search-input {
  border: 0 !important;
  outline: 0 !important;
  flex: 1;
  min-width: 0;
  background: transparent !important;
  padding: 0 !important;
  color: #374151;
  font-size: 15px;
  box-shadow: none !important; /* Xóa shadow mặc định của theme */
}

.eerp-search-input::placeholder {
  color: #9ca3af;
}

.eerp-search-btn {
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 18px;
  padding: 4px;
  color: #6b7280;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}

.eerp-search-btn:hover {
  color: #111827;
}

/* --- Filters (Tags) --- */
.eerp-filters {
  margin-top: 16px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.eerp-filter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 99px;
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #4b5563;
  font-weight: 500;
  font-size: 14px;
  text-decoration: none !important;
  transition: all 0.2s ease;
}

.eerp-filter:hover {
  background: #f9fafb;
  border-color: #d1d5db;
  color: #111827;
}

.eerp-filter.is-active {
  background: #eff6ff; /* Xanh nhạt */
  border-color: #bfdbfe;
  color: #2563eb; /* Xanh đậm */
}

.eerp-filter .eerp-ico svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
  opacity: 0.8;
}

/* --- Grid Job Lists --- */
.eerp-jobs-grid {
  margin-top: 24px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

@media (max-width: 1024px) {
  .eerp-jobs-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .eerp-jobs-grid {
    grid-template-columns: 1fr;
  }
}

/* --- Job Card --- */
.eerp-job-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.eerp-job-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  border-color: #d1d5db;
}

.eerp-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.eerp-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 600;
  background: #eff6ff;
  color: #3b82f6;
  border: 1px solid transparent;
}

.eerp-badge--muted {
  background: #f3f4f6;
  color: #6b7280;
}

.eerp-time {
  font-size: 12px;
  color: #9ca3af;
}

.eerp-job-title {
  margin: 0 0 8px;
  font-size: 18px;
  line-height: 1.4;
  font-weight: 700;
}

.eerp-job-title a {
  color: #111827;
  text-decoration: none;
  transition: color 0.2s;
}

.eerp-job-title a:hover {
  color: #2563eb;
}

.eerp-job-excerpt {
  margin: 0;
  color: #6b7280;
  font-size: 14px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.eerp-card-divider {
  margin-top: auto;
  height: 1px;
  background: #f3f4f6;
  margin-bottom: 16px;
  margin-top: 16px;
}

.eerp-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.eerp-loc {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #6b7280;
  font-size: 13px;
  font-weight: 500;
}

.eerp-apply {
  font-size: 13px;
  font-weight: 600;
  color: #2563eb;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 4px;
}

.eerp-apply:hover {
  text-decoration: underline;
}

/* --- Load More --- */
.eerp-loadmore-wrap {
  margin: 32px 0 16px;
  text-align: center;
}

.eerp-loadmore {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 24px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid #d1d5db;
  color: #374151;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.eerp-loadmore:hover {
  background: #f9fafb;
  border-color: #9ca3af;
}

.eerp-loadmore[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}

/* --- CTA Section --- */
.eerp-cta {
  margin-top: 48px;
  padding: 40px 24px;
  background: #f9fafb;
  border-radius: 16px;
  text-align: center;
  border: 1px solid #f3f4f6;
}

.eerp-cta-icon {
  width: 48px;
  height: 48px;
  background: #eff6ff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  font-size: 24px;
}

.eerp-cta-title {
  margin: 0 0 8px;
  font-size: 24px;
  font-weight: 700;
  color: #111827;
}

.eerp-cta-desc {
  max-width: 600px;
  margin: 0 auto 24px;
  color: #6b7280;
  font-size: 16px;
}

.eerp-cta-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.eerp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none !important;
  transition: all 0.2s;
  border: 1px solid transparent;
  cursor: pointer;
}

.eerp-btn-primary {
  background: #2563eb;
  color: #fff !important;
  border-color: #2563eb;
}

.eerp-btn-primary:hover {
  background: #1d4ed8;
  border-color: #1d4ed8;
}

.eerp-btn-secondary {
  background: #fff;
  color: #374151 !important;
  border-color: #d1d5db;
}

.eerp-btn-secondary:hover {
  background: #f9fafb;
  border-color: #9ca3af;
}

/* =========================
   SINGLE JOB PAGE
   ========================= */
.eerp-single {
  padding: 40px 0;
}

.eerp-single__container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.eerp-single__grid {
  display: grid;
  grid-template-columns: 1fr 350px;
  gap: 32px;
}

@media (max-width: 960px) {
  .eerp-single__grid {
    grid-template-columns: 1fr;
  }
}

.eerp-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  margin-bottom: 24px;
}

/* Job Hero */
.eerp-job-hero__top {
  display: flex;
  justify-content: space-between;
  margin-bottom: 16px;
}

.eerp-pill--soft {
  background: #eff6ff;
  color: #2563eb;
  padding: 4px 12px;
  border-radius: 99px;
  font-size: 13px;
  font-weight: 600;
}

.eerp-hero-icon {
  width: 40px;
  height: 40px;
  background: #f3f4f6;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6b7280;
}

.eerp-job-hero__title {
  margin: 0 0 12px;
  font-size: 32px;
  font-weight: 800;
  color: #111827;
  line-height: 1.2;
}

.eerp-job-hero__meta {
  display: flex;
  gap: 20px;
  color: #6b7280;
  font-size: 14px;
}

.eerp-meta {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Section */
.eerp-section__title {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 16px;
  color: #111827;
  display: flex;
  align-items: center;
  gap: 10px;
}

.eerp-section__title:before {
  content: "";
  display: block;
  width: 6px;
  height: 24px;
  background: #2563eb;
  border-radius: 3px;
}

.eerp-section__content {
  color: #374151;
  font-size: 15px;
  line-height: 1.7;
}

.eerp-section__content p {
  margin-bottom: 16px;
}

.eerp-section__content ul {
  padding-left: 20px;
  margin-bottom: 16px;
}

.eerp-section--highlight {
  border-top: 4px solid #3b82f6;
}

/* Sidebar Summary */
.eerp-summary {
  position: sticky;
  top: 100px; /* Cách top để không bị che bởi header sticky của theme */
}

.eerp-summary__title {
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 16px;
  color: #111827;
}

.eerp-srow {
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f3f4f6;
}

.eerp-srow:last-child {
  border-bottom: 0;
  margin-bottom: 0;
}

.eerp-srow__label {
  font-size: 12px;
  text-transform: uppercase;
  color: #9ca3af;
  font-weight: 600;
  margin-bottom: 4px;
  letter-spacing: 0.05em;
}

.eerp-srow__value {
  font-size: 15px;
  font-weight: 600;
  color: #1f2937;
}

.eerp-btn--block {
  width: 100%;
  justify-content: center;
}

.eerp-expired-badge {
  background: #fef2f2;
  color: #ef4444;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  margin-left: 8px;
  font-weight: 700;
}

.eerp-expired-note {
  background: #fef2f2;
  border: 1px solid #fee2e2;
  color: #b91c1c;
  padding: 12px;
  border-radius: 8px;
  font-size: 13px;
  margin-top: 16px;
  line-height: 1.5;
}

.eerp-expired-note a {
  color: #b91c1c;
  text-decoration: underline;
  font-weight: 600;
}

.eerp-share {
  margin-top: 24px;
}

.eerp-share__title {
  font-size: 12px;
  font-weight: 600;
  color: #9ca3af;
  margin-bottom: 8px;
}

.eerp-share__btns {
  display: flex;
  gap: 8px;
}

.eerp-share__btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  color: #4b5563;
  transition: all 0.2s;
  text-decoration: none;
}

.eerp-share__btn:hover {
  background: #f9fafb;
  color: #111827;
  border-color: #d1d5db;
}

/* HR Contact */
.eerp-hr {
  margin-top: 20px;
  padding: 16px;
  background: #f9fafb;
  border-radius: 8px;
  border: 1px solid #f3f4f6;
}

.eerp-hr__title {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 4px;
}

.eerp-hr__name {
  font-size: 14px;
  color: #374151;
}

.eerp-hr__email {
  font-size: 14px;
  color: #2563eb;
}

/* =========================
   MODAL (Popup)
   ========================= */
body.eerp-modal-open {
  overflow: hidden;
}

.eerp-modal {
  position: fixed !important;
  inset: 0 !important;
  z-index: 999999 !important; /* Cao hơn cả header của theme */
  display: none;
}

.eerp-modal.is-open {
  display: block;
}

.eerp-modal__overlay {
  position: absolute !important;
  inset: 0 !important;
  background: rgba(0, 0, 0, 0.5) !important;
  backdrop-filter: blur(2px);
}

.eerp-modal__dialog {
  position: relative !important;
  width: min(900px, 95%) !important;
  max-height: 90vh !important;
  margin: 4vh auto !important;
  background: #fff !important;
  border-radius: 16px !important;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25) !important;
  display: flex !important;
  flex-direction: column !important;
}

.eerp-modal__header {
  padding: 24px 24px 16px !important;
  border-bottom: 1px solid #f3f4f6 !important;
}

.eerp-modal__title {
  margin: 0 0 8px !important;
  font-size: 24px !important;
  font-weight: 700 !important;
  color: #111827 !important;
  line-height: 1.2 !important;
}

.eerp-modal__desc {
  margin: 0 !important;
  color: #6b7280 !important;
  font-size: 14px !important;
}

.eerp-modal__close {
  position: absolute !important;
  top: 16px !important;
  right: 16px !important;
  width: 32px !important;
  height: 32px !important;
  border-radius: 50% !important;
  background: #f3f4f6 !important;
  border: none !important;
  font-size: 20px !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  color: #6b7280 !important;
  transition: all 0.2s !important;
}

.eerp-modal__close:hover {
  background: #e5e7eb !important;
  color: #111827 !important;
}

.eerp-modal__body {
  padding: 24px !important;
  overflow-y: auto !important;
  overscroll-behavior: contain !important;
}

/* FORM STYLES */
.eerp-form-section {
  margin-bottom: 24px;
}

.eerp-form-section__hd {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.eerp-form-ico {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #eff6ff;
  color: #2563eb;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.eerp-form-section__hd h4 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: #1f2937;
}

.eerp-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 640px) {
  .eerp-form-grid {
    grid-template-columns: 1fr;
  }
}

.eerp-field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 6px;
}

.eerp-req {
  color: #ef4444;
}

.eerp-field input,
.eerp-field select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  transition: all 0.2s;
  background-color: #fff;
  color: #1f2937;
  height: 42px; /* Chiều cao cố định cho input */
}

.eerp-field input:focus,
.eerp-field select:focus {
  border-color: #3b82f6;
  outline: none;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Upload Area */
.eerp-upload__drop {
  border: 2px dashed #d1d5db;
  border-radius: 8px;
  padding: 32px;
  text-align: center;
  background: #f9fafb;
  cursor: pointer;
  transition: all 0.2s;
}

.eerp-upload__drop:hover,
.eerp-upload.is-drag .eerp-upload__drop {
  border-color: #3b82f6;
  background: #eff6ff;
}

.eerp-upload__icon {
  font-size: 32px;
  margin-bottom: 12px;
}

.eerp-upload__text {
  font-weight: 600;
  color: #374151;
}

.eerp-upload__hint {
  font-size: 12px;
  color: #6b7280;
  margin-top: 4px;
}

.eerp-upload__file {
  margin-top: 12px;
  font-size: 13px;
  color: #2563eb;
  font-weight: 600;
}

/* Form Actions */
.eerp-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid #f3f4f6;
}

.eerp-btn--ghost {
  background: transparent;
  color: #4b5563;
  border: 1px solid #d1d5db;
}

.eerp-btn--ghost:hover {
  background: #f3f4f6;
  color: #111827;
}

.eerp-form-note {
  margin-top: 12px;
  text-align: center;
  font-size: 14px;
  font-weight: 500;
}

.eerp-form-note.is-success {
  color: #059669;
}

.eerp-form-note.is-error {
  color: #dc2626;
}