/* ========================================================
   صفحة السير الذاتية التفاعلية — مكتب النجاح للاستقدام
   resumes.css
======================================================== */

/* --- شريط البحث والتصفية --- */
.filter-bar {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-top: -30px;
  margin-bottom: 35px;
  box-shadow: 0 10px 25px -5px rgba(7, 24, 48, 0.08);
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
  gap: 16px;
  align-items: flex-end;
  position: relative;
  z-index: 20;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: right;
}

.filter-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary-color);
}

.filter-bar .form-input,
.filter-bar .form-select {
  padding: 11px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  background-color: var(--bg-light);
  color: var(--text-dark);
  transition: var(--transition);
  outline: none;
  width: 100%;
}

.filter-bar .form-input:focus,
.filter-bar .form-select:focus {
  border-color: var(--gold-color);
  background-color: #ffffff;
  box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.15);
}

/* شريط إحصائيات البحث */
.resumes-stats-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 25px;
  padding: 12px 18px;
  background: var(--bg-light);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-dark);
}

.resumes-count-badge {
  background: rgba(11, 37, 69, 0.08);
  color: var(--primary-color);
  padding: 4px 12px;
  border-radius: var(--radius-full);
}

.btn-reset-filters {
  background: none;
  border: none;
  color: #dc2626;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  text-decoration: underline;
}

/* --- شبكة السير الذاتية --- */
.cv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 30px;
  margin-bottom: 50px;
}

/* --- بطاقة السيرة الذاتية الفاخرة --- */
.cv-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease, border-color 0.3s ease;
  position: relative;
}

.cv-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 30px -10px rgba(7, 24, 48, 0.15);
  border-color: var(--gold-color);
}

/* صورة السيرة الذاتية والشارات */
.cv-card-media {
  position: relative;
  height: 360px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border-color);
  overflow: hidden;
}

.cv-card-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: top center;
  background: #ffffff;
  transition: transform 0.4s ease;
}

.cv-card:hover .cv-card-media img {
  transform: scale(1.05);
}

.cv-badge-status {
  position: absolute;
  top: 14px;
  right: 14px;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  backdrop-filter: blur(8px);
  z-index: 2;
}

.cv-badge-status.available {
  background: rgba(16, 185, 129, 0.9);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.cv-badge-status.reserved {
  background: rgba(239, 68, 68, 0.9);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.cv-badge-nat {
  position: absolute;
  top: 14px;
  left: 14px;
  background: rgba(7, 24, 48, 0.85);
  backdrop-filter: blur(8px);
  color: #ffffff;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  z-index: 2;
}

.cv-media-gradient {
  position: absolute;
  bottom: 0;
  inset-inline: 0;
  height: 80px;
  background: linear-gradient(to top, rgba(7, 24, 48, 0.75), transparent);
  pointer-events: none;
}

.cv-ref-code {
  position: absolute;
  bottom: 10px;
  right: 14px;
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 700;
  background: rgba(0, 0, 0, 0.4);
  padding: 2px 8px;
  border-radius: 4px;
  z-index: 2;
}

/* محتوى البطاقة */
.cv-card-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
  text-align: right;
  gap: 12px;
}

.cv-name-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.cv-name-row h3 {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--primary-color);
  margin: 0;
}

.cv-age-tag {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
}

.cv-job-title {
  display: inline-block;
  align-self: flex-start;
  background: rgba(201, 162, 39, 0.12);
  color: var(--gold-600);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 800;
  border: 1px solid rgba(201, 162, 39, 0.25);
}

/* شبكة المعلومات السريعة */
.cv-facts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  background: var(--bg-light);
  border-radius: var(--radius-sm);
  padding: 12px;
  border: 1px solid var(--border-color);
  margin-top: 4px;
}

.cv-fact-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cv-fact-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
}

.cv-fact-val {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--text-dark);
}

/* رقاقات المهارات */
.cv-skills-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.cv-skill-chip {
  background: #ffffff;
  border: 1px solid var(--border-color);
  color: var(--slate-600);
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
}

/* أزرار الإجراءات */
.cv-card-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--border-color);
}

.btn-cv-book {
  flex: 1;
  background: linear-gradient(135deg, var(--gold-color), var(--gold-600));
  color: var(--navy-950);
  border: none;
  padding: 10px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 800;
  text-align: center;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: var(--transition);
  text-decoration: none;
}

.btn-cv-book:hover {
  background: linear-gradient(135deg, var(--gold-400), var(--gold-500));
  box-shadow: 0 4px 12px rgba(201, 162, 39, 0.3);
}

.btn-cv-details {
  background: #ffffff;
  color: var(--primary-color);
  border: 1px solid var(--border-color);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}

.btn-cv-details:hover {
  background: var(--bg-light);
  border-color: var(--primary-color);
}

/* حالة عدم وجود نتائج */
.cv-empty-state {
  grid-column: 1 / -1;
  background: #ffffff;
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-lg);
  padding: 60px 20px;
  text-align: center;
}

.cv-empty-icon {
  font-size: 3rem;
  margin-bottom: 12px;
}

.cv-empty-state h3 {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--primary-color);
  margin-bottom: 6px;
}

.cv-empty-state p {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

/* --- مودال تفاصيل السيرة الذاتية الكاملة --- */
.cv-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  overflow-y: auto;
  padding: 20px;
}

.cv-modal.open {
  display: flex;
  align-items: center;
  justify-content: center;
}

.cv-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(7, 24, 48, 0.75);
  backdrop-filter: blur(5px);
}

.cv-modal-container {
  position: relative;
  background: #ffffff;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 720px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
  z-index: 1001;
  overflow: hidden;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  animation: modalPop 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.cv-modal-header {
  padding: 20px 24px;
  background: linear-gradient(135deg, var(--navy-950), var(--navy-900));
  color: #ffffff;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cv-modal-header h3 {
  font-size: 1.25rem;
  font-weight: 800;
  margin: 0;
  color: #ffffff;
}

.cv-modal-close {
  background: none;
  border: none;
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.7);
  transition: color 0.2s;
}

.cv-modal-close:hover {
  color: #ffffff;
}

.cv-modal-body {
  padding: 24px;
  overflow-y: auto;
  text-align: right;
}

.cv-detail-hero {
  display: flex;
  gap: 20px;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 20px;
  margin-bottom: 20px;
}

.cv-detail-photo {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--gold-color);
  box-shadow: var(--shadow-md);
}

.cv-detail-info h4 {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--primary-color);
  margin-bottom: 4px;
}

.cv-detail-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
}

.cv-detail-table tr {
  border-bottom: 1px solid var(--border-color);
}

.cv-detail-table th {
  padding: 10px;
  font-size: 0.88rem;
  color: var(--text-muted);
  font-weight: 700;
  width: 35%;
  background: var(--bg-light);
}

.cv-detail-table td {
  padding: 10px;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-dark);
}

.cv-modal-footer {
  padding: 16px 24px;
  background: var(--bg-light);
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* استجابة الشاشات الصغيرة */
@media (max-width: 1024px) {
  .filter-bar {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .filter-bar {
    grid-template-columns: 1fr;
    padding: 18px;
    margin-top: -20px;
  }
  .cv-grid {
    grid-template-columns: 1fr;
  }
  .cv-detail-hero {
    flex-direction: column;
    text-align: center;
  }
}

/* ========================================================
   تنسيقات خطوة اختيار الجنسية أولاً قبل عرض السير
   ======================================================== */
.nat-step-section {
  background: #ffffff;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  margin-top: -30px;
  margin-bottom: 25px;
  box-shadow: 0 10px 25px -5px rgba(7, 24, 48, 0.08);
  position: relative;
  z-index: 20;
  text-align: center;
  transition: all 0.3s ease;
}

.nat-step-header {
  max-width: 680px;
  margin: 0 auto 20px;
}

.nat-step-badge {
  display: inline-block;
  background: linear-gradient(135deg, var(--gold-500), var(--gold-400));
  color: var(--navy-950);
  font-size: 0.85rem;
  font-weight: 800;
  padding: 5px 16px;
  border-radius: var(--radius-full);
  margin-bottom: 10px;
  box-shadow: 0 2px 8px rgba(201, 162, 39, 0.3);
}

.nat-step-title {
  font-size: 1.55rem;
  font-weight: 900;
  color: var(--primary-color);
  margin-bottom: 8px;
}

.nat-step-sub {
  font-size: 0.98rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0;
  font-weight: 600;
}

.nat-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 14px;
  margin-top: 24px;
}

.nat-card-btn {
  background: var(--bg-light);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: center;
  position: relative;
  outline: none;
  font-family: inherit;
}

.nat-card-btn:hover {
  border-color: var(--gold-color);
  background: #ffffff;
  transform: translateY(-4px);
  box-shadow: 0 10px 22px rgba(201, 162, 39, 0.18);
}

.nat-card-btn.active {
  border-color: var(--gold-color);
  background: rgba(201, 162, 39, 0.08);
  box-shadow: 0 0 0 2px var(--gold-color);
}

.nat-card-flag {
  font-size: 2.4rem;
  line-height: 1;
}

.nat-card-name {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--primary-color);
  margin: 0;
}

.nat-card-role {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
  line-height: 1.3;
}

.nat-card-badge {
  font-size: 0.78rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  margin-top: 4px;
}

.nat-card-badge.has-cvs {
  background: rgba(16, 185, 129, 0.12);
  color: #047857;
}

.nat-card-badge.empty-cvs {
  background: rgba(100, 116, 139, 0.1);
  color: var(--text-muted);
}

/* شريط الجنسية النشطة بعد الاختيار */
.active-nat-banner {
  background: linear-gradient(135deg, var(--navy-900), var(--navy-950));
  border: 1.5px solid rgba(201, 162, 39, 0.45);
  border-radius: var(--radius-lg);
  padding: 16px 24px;
  margin-top: -30px;
  margin-bottom: 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  box-shadow: 0 10px 25px rgba(7, 24, 48, 0.15);
  position: relative;
  z-index: 20;
}

.active-nat-info {
  display: flex;
  align-items: center;
  gap: 14px;
}

.active-nat-flag {
  font-size: 2.6rem;
  line-height: 1;
}

.active-nat-texts {
  text-align: right;
}

.active-nat-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--gold-300);
  display: block;
}

.active-nat-name {
  font-size: 1.4rem;
  font-weight: 900;
  color: #ffffff;
  margin: 0;
}

.active-nat-count {
  background: rgba(201, 162, 39, 0.2);
  border: 1px solid rgba(201, 162, 39, 0.4);
  color: var(--gold-300);
  font-size: 0.85rem;
  font-weight: 800;
  padding: 5px 14px;
  border-radius: var(--radius-full);
}

.btn-change-nat {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #ffffff;
  font-family: inherit;
  font-weight: 800;
  font-size: 0.9rem;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-change-nat:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--gold-color);
  color: var(--gold-300);
  transform: translateY(-1px);
}

/* بطاقة الحث على اختيار الجنسية */
.cv-prompt-card {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  background: #f8fafc;
  border: 2px dashed #cbd5e1;
  border-radius: var(--radius-lg);
  margin-block: 10px;
}

.cv-prompt-emoji {
  font-size: 3.5rem;
  margin-bottom: 12px;
  display: block;
}

.cv-prompt-card h3 {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--primary-color);
  margin-bottom: 8px;
}

.cv-prompt-card p {
  font-size: 0.95rem;
  color: var(--text-muted);
  max-width: 520px;
  margin: 0 auto;
  line-height: 1.6;
  font-weight: 600;
}

/* --- أدوات المقارنة والمشاركة والطباعة الحديثة للسير الذاتية --- */
.cv-secondary-tools {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed #e2e8f0;
}

.btn-cv-tool {
  flex: 1;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  color: #0b2545;
  border-radius: 8px;
  padding: 6px 10px;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: all 0.2s ease;
}

.btn-cv-tool:hover {
  background: #fefce8;
  border-color: var(--gold-color);
  color: #854d0e;
}

.btn-cv-tool.active-compare {
  background: #0b2545;
  border-color: var(--gold-color);
  color: #ffffff;
}

.cv-compare-bar {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9500;
  background: linear-gradient(135deg, #071830, #0b2545);
  color: #ffffff;
  border: 2px solid var(--gold-color);
  border-radius: 16px;
  padding: 12px 20px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.45);
  display: none;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  max-width: 92vw;
}

.cv-compare-bar.show {
  display: flex;
}

.compare-table-wrap {
  overflow-x: auto;
}

.compare-table {
  width: 100%;
  border-collapse: collapse;
  text-align: center;
  font-size: 0.9rem;
}

.compare-table th,
.compare-table td {
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
}

.compare-table th {
  background: #f1f5f9;
  color: #0b2545;
  font-weight: 800;
  width: 130px;
}

