/* =============================================================
   SAYJOBCITY — All Calculators v3 CSS
   Mobile-first responsive · Separated search + sort · Modal
   ============================================================= */

/* ── PAGE WRAPPER ── */
.page-all-calcs {
  padding: 20px 0 60px;
  overflow-x: hidden;
}

/* ── HIDE breadcrumb on all-calcs page ── */
.page-all-calcs .calcs-breadcrumb {
  display: none !important;
}

/* ── PAGE HEADER ── */
.page-all-calcs-header {
  margin-bottom: 16px;
}
.page-all-calcs-header h1 {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-dark);
  margin: 0;
}

/* =============================================================
   SEARCH + SORT TOP ROW (Desktop: search half-width, sort right)
   ============================================================= */
.calcs-top-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

/* Desktop: search bar exactly half the container width */
.calcs-search-row {
  width: 50%;
  flex: none;
  background: var(--bg-white);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,.04);
  margin-bottom: 0;
}
.calcs-search-row svg {
  flex-shrink: 0;
  color: var(--text-muted);
}
.calcs-search-row input[type="search"] {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 14px;
  color: var(--text-dark);
  outline: none;
  min-width: 0;
}
.calcs-search-row input[type="search"]::placeholder {
  color: var(--text-light);
}
.calcs-search-row .btn-sm {
  flex-shrink: 0;
  padding: 6px 16px;
  font-size: 13px;
}

/* Sort select — inline on desktop */
.calcs-sort-inline {
  flex-shrink: 0;
}
.sort-select {
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: var(--bg-white);
  color: var(--text-dark);
  font-size: 13px;
  padding: 7px 12px;
  cursor: pointer;
  outline: none;
  white-space: nowrap;
  height: 100%;
}
.sort-select:focus {
  border-color: var(--primary);
}

/* HIDE old search bar if it somehow renders */
.calcs-search-bar { display: none !important; }

/* =============================================================
   LAYOUT: sidebar + main grid
   ============================================================= */
.calcs-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 24px;
  align-items: start;
}

/* =============================================================
   SIDEBAR
   ============================================================= */
.calcs-sidebar {
  position: sticky;
  top: calc(var(--header-height, 64px) + 16px);
  overflow-x: hidden;
}
.calcs-cat-list {
  display: flex;
  flex-direction: column;
  background: var(--bg-white);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 16px;
}
.calcs-cat-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  text-decoration: none;
  color: var(--text-dark);
  font-size: 13px;
  font-weight: 500;
  border-bottom: 1px solid var(--border-light);
  transition: background .15s, color .15s;
  cursor: pointer;
}
.calcs-cat-item:last-child { border-bottom: none; }
.calcs-cat-item:hover { background: var(--bg-light); color: var(--primary); }
.calcs-cat-item.active { background: var(--primary); color: #ffffff; font-weight: 700; }
.cci-icon { font-size: 16px; flex-shrink: 0; line-height: 1; }
.cci-name { flex: 1; }
.cci-count { font-size: 11px; color: var(--text-muted); font-weight: 500; background: var(--bg-light); padding: 2px 6px; border-radius: 20px; }
.calcs-cat-item.active .cci-count { background: rgba(255,255,255,.25); color: #ffffff; }

/* Request box in sidebar */
.cant-find-box {
  background: var(--bg-white);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 16px;
}
.cant-find-box h4 { font-size: 13px; font-weight: 700; margin: 0 0 6px; color: var(--text-dark); }
.cant-find-box p  { font-size: 12px; color: var(--text-muted); margin: 0 0 12px; line-height: 1.5; }

/* =============================================================
   MAIN GRID
   ============================================================= */
.calcs-main-header {
  margin-bottom: 14px;
}
.calcs-main-header h2 {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-dark);
  margin: 0;
}

/* Tools grid */
.calcs-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

/* Tool cards */
.tool-card {
  background: var(--bg-white);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-decoration: none;
  color: var(--text-dark);
  transition: box-shadow .2s, border-color .2s, transform .15s;
  overflow: hidden; /* FIX: prevent plugin sliders/inputs from bleeding outside card */
}
.tool-card:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 16px rgba(200,96,42,.1);
  transform: translateY(-1px);
}
.tool-card-top { display: flex; align-items: flex-start; gap: 12px; }
.tool-card-icon {
  width: 40px; height: 40px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0;
  overflow: hidden; /* FIX: clip any leaking content inside icon box */
}
.tool-card-name { font-size: 13px; font-weight: 700; color: var(--text-dark); line-height: 1.3; margin-bottom: 3px; }
.tool-card-desc { font-size: 12px; color: var(--text-muted); line-height: 1.4; }
.tool-card-footer { margin-top: auto; border-top: 1px solid var(--border-light); padding-top: 8px; }
.tool-card-link { font-size: 12px; font-weight: 600; color: var(--primary); }

/* ── FIX: Hide any range slider inputs injected by calculator plugins into cards ── */
/* The BMI calculator (and similar) plugin sliders must NOT render inside listing cards */
.calcs-grid-3 .tool-card input[type="range"],
.calcs-grid-3 .tool-card input[type="range"] + *,
#toolsGrid .tool-card input[type="range"],
#toolsGrid .tool-card input[type="range"] + *,
.page-all-calcs .tool-card input[type="range"],
.page-all-calcs .tool-card input[type="range"] + * {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
  width: 0 !important;
  position: absolute !important;
  pointer-events: none !important;
}

/* No results */
.calcs-no-results {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.calcs-no-results p:first-child { font-size: 36px; margin-bottom: 10px; }

/* =============================================================
   SKELETON LOADING
   ============================================================= */
.tool-card-skeleton {
  flex-direction: row;
  align-items: center;
  gap: 12px;
  pointer-events: none;
}
.skeleton-icon {
  width: 40px; height: 40px;
  border-radius: 8px;
  background: linear-gradient(90deg, var(--bg-light) 25%, #e2e8f0 50%, var(--bg-light) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
  flex-shrink: 0;
}
.skeleton-lines { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.skeleton-line {
  height: 12px; border-radius: 6px;
  background: linear-gradient(90deg, var(--bg-light) 25%, #e2e8f0 50%, var(--bg-light) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
}
.skeleton-line.w80 { width: 80%; }
.skeleton-line.w60 { width: 60%; }
@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* =============================================================
   PAGINATION
   ============================================================= */
.pagination-wrap {
  margin-top: 28px;
  display: flex;
  justify-content: center;
}
.pagination {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
}
.page-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  border: 1.5px solid var(--border);
  background: var(--bg-white);
  color: var(--text-dark);
  text-decoration: none;
  transition: background .15s, border-color .15s, color .15s;
  cursor: pointer;
}
.page-num:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light, #f5e8df); }
.page-num.active { background: var(--primary); color: #fff; border-color: var(--primary); cursor: default; }
.page-num.dots { border: none; background: transparent; cursor: default; }

/* =============================================================
   RESPONSIVE — TABLET (860px and below)
   ============================================================= */
@media (max-width: 860px) {
  .calcs-layout {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .calcs-sidebar {
    position: static;
    margin-bottom: 0;
  }

  /* Horizontal pill scroll */
  .calcs-cat-list {
    flex-direction: row;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 10px;
    margin-bottom: 14px;
    gap: 0;
  }

  .calcs-cat-item {
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px 14px;
    border-bottom: none;
    border-right: 1px solid var(--border-light);
    white-space: nowrap;
    flex-shrink: 0;
    min-width: 70px;
    text-align: center;
    font-size: 12px;
  }
  .calcs-cat-item:last-child { border-right: none; }
  .cci-icon  { font-size: 18px; }
  .cci-count { font-size: 10px; }

  /* Hide desktop request box, show mobile one */
  .cant-find-box { display: none; }
  .mobile-request-btn-wrap { display: block; }

  /* 2-column tools grid */
  .calcs-grid-3 {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
}

/* =============================================================
   RESPONSIVE — MOBILE (480px and below)
   ============================================================= */
@media (max-width: 480px) {
  .page-all-calcs { padding: 14px 0 48px; }
  .page-all-calcs-header h1 { font-size: 20px; }

  .calcs-search-row { padding: 8px 12px; gap: 8px; }
  .calcs-search-row input[type="search"] { font-size: 13px; }
  .calcs-search-row .btn-sm { padding: 6px 12px; font-size: 12px; }

  .sort-select { width: 100%; }

  /* Single column on small phones */
  .calcs-grid-3 {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .tool-card { padding: 12px; }
  .tool-card-icon { width: 36px; height: 36px; font-size: 18px; }
  .tool-card-name { font-size: 13px; }
  .tool-card-desc { font-size: 11px; }

  .page-num { min-width: 32px; height: 32px; font-size: 12px; padding: 0 8px; }

  .calcs-main-header h2 { font-size: 15px; }
}
