/* ===========================================================
    JOBS_FRONT_CARD.CSS - MOBILE OPTIMIZED VERSION
    Fixed: Title on one line, centered pills, full-width cards
    =========================================================== */

/* ===========================================================
    1) CARD SHELL
    =========================================================== */
.job-card-pro {
  font-family: var(--font-family-body);
  background: var(--card-bg);
  border: 2px solid #c0c0c0;
  border-radius: 20px;
  box-shadow:
    0 2px 10px rgba(0, 0, 0, 0.08),
    0 0 8px rgba(192, 192, 192, 0.4);
  transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1),
              box-shadow 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
  padding: 0;
  overflow: hidden;
  position: relative;
  min-height: 250px;
  width: 100%;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  will-change: transform;
  box-sizing: border-box;
}

.job-card-pro:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow:
    0 6px 18px rgba(0, 0, 0, 0.12),
    0 0 12px rgba(192, 192, 192, 0.6);
  border-color: #d9d9d9;
}

.job-card-pro .card-body {
  padding: 0;
  display: flex;
  flex-direction: column;
}

.job-card-pro a[href^="mailto:"] {
  color: #010080;
}

.job-card-pro a[href^="mailto:"]:hover,
.job-card-pro a[href^="mailto:"]:focus {
  color: #4354ef;
  text-decoration: underline;
}

.job-cards-row .job-card-pro {
  min-height: 500px;
}

/* ===========================================================
    2) CARD HEADER
    =========================================================== */
.job-card-header-pro {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-auto-rows: auto;
  align-items: start;
  gap: 10px 16px;
  margin-bottom: 16px;
  padding: 15px;
  min-height: 120px;
  background:
    linear-gradient(#0000 23px, rgba(255, 255, 255, 0.08) 24px) 0 0 / 24px 24px,
    linear-gradient(90deg, #0000 23px, rgba(255, 255, 255, 0.08) 24px) 0 0 / 24px 24px,
    linear-gradient(0deg, rgba(255, 255, 255, 0.03), rgba(0, 0, 0, 0.03)),
    var(--primary-color-hover);
  border: 1px solid var(--primary-color-hover);
  border-radius: 12px 12px 0 0;
  color: #fff;
  transition: all 0.3s ease;
}

/* ===========================================================
    3) TITLE & COMPANY INFO
    =========================================================== */
.job-card-header-pro > .job-title-container-pro {
  grid-column: 1 / 2;
  margin: 0;
  min-width: 0; /* Allows proper shrinking */
}

.job-card-header-pro .job-title-container-pro a,
.job-card-header-pro .job-title-pill__text {
  color: #00FFEA;
  font-weight: 700;
  font-size: 1.25rem;
  line-height: 1.3;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  word-wrap: break-word;
}

.job-card-header-pro .job-title-pro {
  margin-bottom: 4px;
}

.job-card-header-pro .job-title-pro a {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  word-wrap: break-word;
}

.job-card-header-pro .job-company-pro {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.job-card-header-pro .header-location {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.85);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-basis: 100%;
  margin-top: 4px;
}

.job-card-header-pro .job-company-pro i,
.job-card-header-pro .header-location i {
  font-size: 0.9rem;
  opacity: 0.9;
}

.job-card-header-pro .header-location .location-text {
  color: #ffffff;
  font-weight: 700;
  line-height: 1.2;
}

.job-card-header-pro .header-location .fa {
  font-size: 1rem;
  line-height: 1;
}

.job-card-header-pro .header-location i.fa,
.job-card-header-pro .header-location i.fa-map-marker,
.job-card-header-pro .header-location i.fa-map-marker-alt,
.job-card-header-pro .header-location i.fa-location-dot {
  color: #dc3545;
}

.job-company-and-salary {
  line-height: 1.1;
}

.job-company-and-salary .job-company-pro {
  display: block;
}

.job-company-and-salary .salary-inline {
  display: block;
  font-weight: 600;
}

/* ===========================================================
    4) COMPANY LOGO
    =========================================================== */
.job-card-header-pro > .company-logo-pro {
  grid-column: 2 / 3;
  grid-row: 1 / span 5;
  align-self: start;
  justify-self: end;
  overflow: hidden;
  padding: 4px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
}

.company-logo-pro {
  width: 80px;
  height: 80px;
  flex-shrink: 0;
}

.company-logo-pro img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 6px;
}

/* ===========================================================
    5) META CHIPS (INDUSTRY/SUBINDUSTRY)
    =========================================================== */
.job-card-header-pro > .header-meta-container,
.job-card-header-pro > .header-meta {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
}

.job-card-header-pro > .header-meta {
  flex-direction: row;
  margin-top: 8px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.job-card-header-pro .header-meta {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
}

.job-card-header-pro .meta-chip--header {
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.32);
  color: #fff;
  border-radius: 999px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0.42rem 0.65rem; 
  font-size: 0.9rem;  
  line-height: 1;      
}

.job-card-header-pro .meta-chip--header i {
  color: #D9E0FF;
  opacity: 1;
}

.job-card-header-pro .meta-chip--header .meta-label {
  color: #C9D2FF;
  font-weight: 700;
  margin-right: 0.2rem;
}

.job-card-header-pro .meta-chip--header .meta-value {
  color: #fff;
  font-weight: 800;
}

.job-card-header-pro .meta-chip--header:hover {
  background: rgba(255, 255, 255, 0.20);
  border-color: rgba(255, 255, 255, 0.45);
}

/* ===========================================================
    6) SKILL HINTS
    =========================================================== */
.job-card-header-pro > .skill-hints-container,
.job-card-header-pro > .skill-hints {
  grid-column: 1 / -1;
  margin-top: 4px;
}

.job-card-header-pro > .skill-hints,
.job-card-header-pro > .header-meta {
  grid-column: unset !important;
}

.skill-hints {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.skill-hint {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 8px 14px;
  border-radius: 9999px;
  background: #fff;
  color: var(--primary-color);
  border: 1px solid rgba(1, 0, 128, 0.18);
  font-weight: 700;
  font-size: 0.9rem;
  line-height: 1;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.08);
  transition: transform 0.15s ease, box-shadow 0.15s ease,
              border-color 0.15s ease, background-color 0.15s ease;
}

.skill-hint:hover {
  background: #f7f9ff;
  border-color: rgba(1, 0, 128, 0.35);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(16, 24, 40, 0.12);
}

.skill-hint:active {
  transform: translateY(0);
}

.skill-hint:focus-visible {
  outline: 2px solid rgba(1, 0, 128, 0.45);
  outline-offset: 2px;
}

/* ===========================================================
    FRONT CARD - QUICK OVERVIEW SECTION
    =========================================================== */
.front-summary-section {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border-left: 4px solid #010080;
  border-radius: 12px;
  padding: 16px 18px;
  margin: 0 15px;
  margin-bottom: 16px;
}

.front-summary-text-clean {
  font-size: 0.95rem;
  line-height: 1.6;
  color: #334155;
  margin: 0;
}

/* Section Header */
.section-header-modern {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.section-header-modern i {
  color: #010080;
  font-size: 1.3rem;
}

.section-title-modern {
  font-size: 1.05rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ===========================================================
    7) JOB SHORT DESCRIPTION
    =========================================================== */
.job-short-decs {
  margin: 0 15px;
  padding: 15px;
  background: #fafafa;
  border: 1px solid #E3E6F7;
  border-radius: 10px;
}

.job-short-decs p {
  color: #283b7d;
}

/* ===========================================================
    8) META GRID (JOB DETAILS)
    =========================================================== */
.job-meta-grid-pro {
  background: #fff;
  border: 1px solid #E3E6F7;
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
  margin: 15px;
  box-shadow: none;
  backdrop-filter: none;
}

.meta-box {
  background: #fff;
  border: 1px solid #E0E5F4;
  border-radius: 10px;
  padding: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 56px;
}

.meta-box-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
}

.meta-box-header i {
  font-size: 1.3rem;
  width: 22px;
  text-align: center;
}

.meta-box-label {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--primary-color);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.meta-box-value {
  font-size: 1.05rem;
  font-weight: 400;
  color: var(--secondary-color);
  text-align: right;
}

.meta-box--salary {
  border-color: #28a745;
  background: rgba(40, 167, 69, 0.06);
}

.meta-box--salary .meta-box-value {
  color: #1f7a32;
  font-size: 1.15rem;
}

.meta-box--location i {
  color: #dc3545;
}

.meta-box--job-type i {
  color: var(--primary-color);
}

.meta-box--experience i {
  color: #138496;
}

.meta-box--arrangement i {
  color: #6b7280;
}

.meta-box-pair {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
}

.meta-box-pair .meta-box {
  flex: 1;
}

/* ===========================================================
    MODERN INFO PILLS - CENTERED SINGLE ROW
    =========================================================== */

.job-info-pills {
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
  margin: 0 15px 16px;
  padding: 0;
  justify-content: center;
  align-items: center;
}

.info-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #334155;
  white-space: nowrap;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  min-width: 0;
  flex: 1;
  max-width: 140px;
}

.info-pill i {
  font-size: 1rem;
  line-height: 1;
  flex-shrink: 0;
}

.info-pill__text {
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1;
  color: inherit;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Individual pill colors */
.info-pill--job-type {
  background: linear-gradient(135deg, #ede9fe 0%, #f3f0ff 100%);
  border-color: #a78bfa;
  color: #6b21a8;
}

.info-pill--job-type i {
  color: #7c3aed;
}

.info-pill--experience {
  background: linear-gradient(135deg, #dbeafe 0%, #e0f2fe 100%);
  border-color: #60a5fa;
  color: #1e40af;
}

.info-pill--experience i {
  color: #2563eb;
}

.info-pill--arrangement {
  background: linear-gradient(135deg, #d1fae5 0%, #d9f99d 100%);
  border-color: #4ade80;
  color: #15803d;
}

.info-pill--arrangement i {
  color: #16a34a;
}

/* Hover effects - desktop only */
@media (hover: hover) {
  .info-pill:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  }

  .info-pill--job-type:hover {
    background: linear-gradient(135deg, #ddd6fe 0%, #ede9fe 100%);
    border-color: #9333ea;
  }

  .info-pill--experience:hover {
    background: linear-gradient(135deg, #bfdbfe 0%, #dbeafe 100%);
    border-color: #3b82f6;
  }

  .info-pill--arrangement:hover {
    background: linear-gradient(135deg, #bbf7d0 0%, #d1fae5 100%);
    border-color: #22c55e;
  }
}

/* ===========================================================
    9) RECRUITER INFO
    =========================================================== */
.recruiter-info {
  margin-top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 20px;
  background: #edf1fb;
  border-top: 1px solid rgba(40, 59, 125, 0.12);
  border-radius: 0;
  padding: 18px 24px;
  font-size: 1rem;
  font-weight: 500;
  color: #283b7d;
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.02);
}

.recruiter-label {
  font-size: 14px;
  font-weight: 500;
  display: inline-flex;
  padding: 5px 10px;
  color: var(--primary-color);
  border-radius: 50px;
}

.recruiter-info .contact-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 18px;
  text-align: right;
  width: 100%;
}

.recruiter-info i {
  color: #283b7d;
  font-size: 1.1rem;
  vertical-align: middle;
}

.recruiter-info a,
.recruiter-info span {
  color: #283b7d;
  font-weight: 600;
  font-size: 1.05rem;
  text-decoration: none;
  transition: color 0.2s ease-in-out;
}

.recruiter-info a:hover {
  color: #1d2b5f;
}

/* ===========================================================
    10) FOOTER
    =========================================================== */
.job-footer-pro {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px;
  border-top: 1px solid var(--border-color-pro);
  margin-top: 0;
}

.job-posted-date-pro {
  font-size: 0.85rem;
  color: var(--light-color);
  background: rgba(255, 255, 255, 0.20);
  padding: 5px;
  position: absolute;
  right: 0;
  bottom: 0;
}

.job-footer-actions {
  display: flex;
  align-items: center;
  gap: 20px;
  justify-content: space-between;
  width: 100%;
}

.job-footer-pro .btn {
  font-family: var(--font-family-heading);
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 10px;
  padding: 8px 16px;
  transition: all 0.3s ease-in-out;
}

.job-footer-actions .bi.bi-heart {
  background: #010080;
  color: #ffffff;
  padding: 3px 7px;
  border-radius: 5px;
  text-align: center;
}

.like-button-pro {
  background: none;
  border: none;
  color: var(--text-color-subtle);
  padding: 0;
  transition: color 0.2s ease, transform 0.2s ease, background-color 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  cursor: pointer;
}

.like-button-pro:hover,
.like-button-pro:focus {
  color: var(--danger-color);
  transform: scale(1.2);
  background-color: rgba(var(--danger-color-rgb), 0.1);
  outline: none;
}

.like-button-pro:focus-visible {
  outline: 2px solid rgba(var(--danger-color-rgb), 0.35);
  outline-offset: 2px;
}

.like-button-pro:active {
  transform: scale(1);
}

.like-button-pro .bi-heart-fill {
  color: var(--danger-color);
  filter: drop-shadow(0 0 3px rgba(var(--danger-color-rgb), 0.4));
}

.job-footer-actions .btn-primary {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.job-footer-actions .btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(40, 59, 125, 0.25);
}

/* ===========================================================
    11) RESPONSIVE - MOBILE OPTIMIZED
    =========================================================== */

/* Tablet and below - single column */
@media (max-width: 991.98px) {
  .job-cards-row {
    grid-template-columns: 1fr !important;
  }

  .job-card-pro {
    min-height: 520px;
  }

  .flip {
    min-height: 520px;
  }
}

/* Mobile optimizations */
@media (max-width: 767.98px) {
  /* Card sizing - works within container padding */
  .job-card-pro {
    min-height: 500px;
    border-radius: 16px;
    width: 100%;
    max-width: 100%;
    margin: 0;
    box-sizing: border-box;
  }

  .flip {
    min-height: 500px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  /* Header - keep grid layout with space for 2-line title */
  .job-card-header-pro {
    grid-template-columns: 1fr 70px;
    padding: 14px;
    gap: 8px 12px;
    min-height: 145px; /* Increased for 2-line title */
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
  }

  /* Logo - smaller on mobile */
  .company-logo-pro {
    width: 70px;
    height: 70px;
    grid-row: 1 / span 3;
  }

  /* Title container - prevent overflow */
  .job-card-header-pro > .job-title-container-pro {
    grid-column: 1 / 2;
    margin: 0;
    min-width: 0; /* Critical: allows proper grid/flex shrinking */
    overflow: hidden;
  }

  /* Title - allow 2 lines with ellipsis overflow */
  .job-card-header-pro .job-title-pill__text {
    font-size: 1.05rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    word-wrap: break-word;
    word-break: break-word;
    max-width: 100%;
    hyphens: auto;
  }

  .job-card-header-pro .job-title-pro a {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    word-wrap: break-word;
    word-break: break-word;
  }

  /* Company and location */
  .job-card-header-pro .job-company-pro,
  .job-card-header-pro .header-location {
    font-size: 0.8rem;
  }

  /* Industry chips */
  .job-card-header-pro .meta-chip--header {
    font-size: 0.75rem;
    padding: 0.3rem 0.55rem;
  }

  /* Skill hints */
  .skill-hint {
    font-size: 0.75rem;
    padding: 6px 10px;
  }

  /* Quick Overview section */
  .front-summary-section {
    margin: 0 12px 12px;
    padding: 12px 14px;
    box-sizing: border-box !important;
    max-width: calc(100% - 24px) !important;
    overflow: hidden !important;
  }

  .front-summary-text-clean {
    font-size: 0.85rem;
    line-height: 1.5;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
  }

  .section-title-modern {
    font-size: 0.9rem;
  }

  .section-header-modern i {
    font-size: 1.1rem;
  }

  /* Meta grid */
  .job-meta-grid-pro {
    margin: 0 12px;
    padding: 12px;
    gap: 10px;
    box-sizing: border-box !important;
    max-width: calc(100% - 24px) !important;
    overflow: hidden !important;
  }

  .meta-box-pair {
    gap: 10px;
    margin-bottom: 10px;
  }

  .meta-box {
    padding: 10px;
    height: 50px;
  }

  .meta-box-header i {
    font-size: 1.1rem;
  }

  .meta-box-label {
    font-size: 0.75rem;
  }

  .meta-box-value {
    font-size: 0.9rem;
  }

  .meta-box--salary .meta-box-value {
    font-size: 1rem;
  }

  /* Info pills - CENTERED on mobile */
  .job-info-pills {
    gap: 8px;
    margin: 0 12px 14px;
    justify-content: center;
    flex-wrap: nowrap;
    box-sizing: border-box !important;
    max-width: calc(100% - 24px) !important;
    overflow: hidden !important;
  }

  .info-pill {
    flex: 1;
    min-width: 0;
    max-width: none;
    padding: 10px 8px;
    font-size: 0.75rem;
  }

  .info-pill i {
    font-size: 0.95rem;
  }

  .info-pill__text {
    font-size: 0.75rem;
  }

  /* Recruiter info */
  .recruiter-info {
    padding: 14px 16px;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .recruiter-info .contact-group {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    width: 100%;
  }

  .recruiter-info a,
  .recruiter-info span {
    font-size: 0.85rem;
  }

  .recruiter-info i {
    font-size: 0.9rem;
  }

  /* Footer */
  .job-footer-pro {
    padding: 12px 14px;
    margin-top: 0;
  }

  .job-footer-actions {
    gap: 12px;
  }

  .like-button-pro {
    width: 38px;
    height: 38px;
  }

  .job-footer-actions .btn-primary {
    font-size: 0.85rem;
    padding: 8px 14px;
  }

  /* Posted date */
  .job-posted-date-pro {
    font-size: 0.75rem;
  }

  /* Disable hover effects on mobile */
  .job-card-pro:hover {
    transform: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08), 0 0 8px rgba(192, 192, 192, 0.4);
  }

  .job-cards-row .col-12 .flip.highlighted {
    transform: none;
  }

  .job-cards-row .col-12 .flip.dimmed {
    opacity: 1;
  }
}

/* Very small screens */
@media (max-width: 375px) {
  .job-cards-row {
    padding: 0 8px !important;
  }

  .job-card-header-pro {
    grid-template-columns: 1fr 60px;
    padding: 12px;
    gap: 6px 10px;
    min-height: 140px; /* Accommodate 2-line title */
  }

  .company-logo-pro {
    width: 60px;
    height: 60px;
  }

  .job-card-header-pro .job-title-pill__text {
    font-size: 0.95rem;
    line-height: 1.3;
    /* 2-line clamp already inherited from parent media query */
  }

  .job-card-header-pro .job-company-pro,
  .job-card-header-pro .header-location {
    font-size: 0.75rem;
  }

  .info-pill {
    padding: 8px 6px;
    font-size: 0.7rem;
  }

  .info-pill i {
    font-size: 0.85rem;
  }

  .info-pill__text {
    font-size: 0.7rem;
  }
}

/* Landscape mode on mobile */
@media (max-width: 767.98px) and (orientation: landscape) {
  .job-card-pro,
  .flip {
    min-height: 450px;
  }

  .job-card-header-pro {
    min-height: 110px;
  }
}