/* --- Global Variables & Body Setup --- */
:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --bg-page: #f8fafc;
  --card-bg: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --header-height: 60px;
  --footer-height: 60px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background-color: var(--bg-page);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* =========================================================
   HEADER & TOP BAR
   ========================================================= */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--header-height);
  background: #ffffff;
  padding: 0 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 50;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.logo img {
  height: 36px;
}

/* Header PC Autocomplete Search */
.header-search-container {
  display: none;
  position: relative;
  width: 100%;
  max-width: 440px;
  margin: 0 20px;
}

.header-search-input-wrap {
  position: relative;
  width: 100%;
}

.header-search-input-wrap i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: 14px;
}

.header-search-input-wrap input {
  width: 100%;
  padding: 8px 14px 8px 36px;
  background-color: #f1f5f9;
  border: 1px solid transparent;
  border-radius: 9999px;
  font-size: 13px;
  outline: none;
  transition: all 0.2s ease;
}

.header-search-input-wrap input:focus {
  background-color: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Suggestions Dropdown (Scrollable) */
.search-suggestions-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: 100%;
  max-height: 320px;
  overflow-y: auto;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  z-index: 100;
}

.search-suggestion-item {
  display: block;
  padding: 10px 14px;
  border-bottom: 1px solid #f1f5f9;
  text-decoration: none;
  color: var(--text-main);
  transition: background 0.15s ease;
}

.search-suggestion-item:last-child {
  border-bottom: none;
}

.search-suggestion-item:hover,
.search-suggestion-item.active {
  background-color: #eff6ff;
}

.search-suggestion-item strong {
  display: block;
  font-size: 13px;
  color: var(--primary);
}

.search-suggestion-item span {
  font-size: 11px;
  color: var(--text-muted);
}

/* Top Profile Menu Dropdown */
.profile-menu {
  position: absolute;
  top: calc(var(--header-height) + 4px);
  right: 12px;
  background: #ffffff;
  border: 1px solid var(--border);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  border-radius: 12px;
  padding: 6px;
  width: 210px;
  z-index: 60;
}

/* =========================================================
   RESPONSIVE 3-COLUMN APP CONTAINER
   ========================================================= */
.app-container {
  display: flex;
  width: 100%;
  margin-top: var(--header-height);
  flex: 1;
}

.sidebar {
  display: none;
  background: #ffffff;
  border-right: 1px solid var(--border);
  padding: 20px;
}

.main-content {
  flex: 1;
  padding: 10px 8px calc(var(--footer-height) + 20px) 8px;
  width: 100%;
  max-width: 100%;
}

.description-sidebar {
  display: none;
  background: #ffffff;
  border-left: 1px solid var(--border);
  padding: 20px 16px;
}

@media (min-width: 1024px) {
  .header-search-container {
    display: block;
  }

  .app-container {
    max-width: 1440px;
    margin-left: auto;
    margin-right: auto;
  }

  .sidebar {
    display: block;
    width: 260px;
    position: sticky;
    top: var(--header-height);
    height: calc(100vh - var(--header-height));
    overflow-y: auto;
  }

  .main-content {
    padding: 18px 24px;
    max-width: 780px;
  }

  .description-sidebar {
    display: block;
    width: 320px;
    position: sticky;
    top: var(--header-height);
    height: calc(100vh - var(--header-height));
    overflow-y: auto;
  }

  .mobile-footer,
  #footerSearchBox,
  .mobile-filter-bar,
  #filterPickerModal {
    display: none !important;
  }
}

/* =========================================================
   COMPACT JOB CARDS
   ========================================================= */
.job-card {
  background: var(--card-bg);
  margin-bottom: 10px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  position: relative;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.15s ease;
}

.job-card:hover {
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.06);
}

.job-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.job-card h3 {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.25;
}

.job-title {
  color: #1e293b;
  text-decoration: none;
}

.time-badge {
  background: #f1f5f9;
  color: #64748b;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.job-company {
  font-size: 12.5px;
  color: #475569;
  margin: 3px 0 6px 0;
}

/* Compact Info Badges Row */
.job-info-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin: 6px 0;
  padding: 6px 10px;
  background: #f8fafc;
  border-radius: 6px;
  font-size: 12px;
  color: #334155;
}

.job-bottom-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px dashed var(--border);
}

.validity-green {
  background-color: #dcfce7;
  color: #15803d;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}

.validity-red {
  background-color: #fee2e2;
  color: #b91c1c;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}

.validity-expired-text {
  color: #ef4444;
  font-size: 11.5px;
  font-weight: 600;
}

.expired-card {
  opacity: 0.88;
  background: #fffafa;
  border-color: #fecaca;
}

.visa-badge {
  background-color: #e0f2fe;
  color: #0369a1;
  font-size: 10.5px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

/* Buttons */
.buttons {
  display: flex;
  gap: 6px;
  align-items: center;
}

.apply-btn,
.view-btn,
.contact-now-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 11px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 6px;
  text-decoration: none;
  cursor: pointer;
  border: none;
}

.view-btn {
  background-color: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
}

.view-btn:hover {
  background-color: #e2e8f0;
}

.apply-btn {
  background-color: var(--primary);
  color: #ffffff;
}

.apply-btn:hover {
  background-color: var(--primary-hover);
}

.contact-now-btn {
  background-color: #ef4444;
  color: #ffffff;
}

/* =========================================================
   COMPACT 5-PILL MOBILE FILTER BAR
   ========================================================= */
.mobile-filter-bar {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  padding: 4px 1px 10px 1px;
  width: 100%;
}

.mob-filter-chip {
  background-color: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 6px 2px;
  font-size: 10.5px;
  font-weight: 600;
  color: #334155;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: all 0.15s ease;
}

.mob-filter-chip:active,
.mob-filter-chip.is-active {
  background-color: #eff6ff;
  border-color: #2563eb;
  color: #1d4ed8;
}

.mob-filter-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.mob-filter-chip i.fa-chevron-down {
  font-size: 8px;
  color: #94a3b8;
}

/* =========================================================
   FULL-SCREEN / BOTTOM-SHEET PICKER MODAL (MOBILE)
   ========================================================= */
#filterPickerModal {
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

#filterPickerContent {
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.filter-modal-search {
  width: 100%;
  padding: 10px 14px 10px 36px;
  background-color: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  font-size: 13px;
  outline: none;
}

.filter-modal-search:focus {
  background-color: #ffffff;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.filter-options-list {
  max-height: 55vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.filter-option-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid #f1f5f9;
  font-size: 13px;
  color: #1e293b;
  cursor: pointer;
}

.filter-option-item:active,
.filter-option-item.selected {
  background-color: #eff6ff;
  color: #1d4ed8;
  font-weight: 600;
}

/* =========================================================
   SETTINGS BOTTOM-SHEET MODAL (APP-LIKE DESIGN)
   ========================================================= */
#settingsModal {
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

#settingsModalContent {
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

#settingsModal.open #settingsModalContent {
  transform: translateY(0);
}

.settings-card-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background-color: #ffffff;
  border: 1px solid #f1f5f9;
  border-radius: 14px;
  text-decoration: none;
  transition: all 0.15s ease;
  margin-bottom: 8px;
}

.settings-card-item:hover,
.settings-card-item:active {
  background-color: #f8fafc;
  border-color: #cbd5e1;
}

.settings-icon-box {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  flex-shrink: 0;
}

/* =========================================================
   MOBILE BOTTOM NAVIGATION BAR
   ========================================================= */
.mobile-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: calc(var(--footer-height) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: #ffffff;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 45;
}

.mobile-footer a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: #64748b;
  font-size: 10px;
  font-weight: 500;
  height: 100%;
}

.mobile-footer a i {
  font-size: 18px;
  margin-bottom: 2px;
}

.mobile-footer a.active,
.mobile-footer a:hover {
  color: var(--primary);
}

/* Slide-Up Mobile Search Box */
#footerSearchBox {
  display: none;
  position: fixed;
  bottom: calc(var(--footer-height) + 8px);
  left: 12px;
  right: 12px;
  z-index: 50;
}

#footerSearchBox.active {
  display: block;
}

#jobSearch {
  width: 100%;
  padding: 10px 14px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
  outline: none;
  font-size: 14px;
}