/* Page-specific styles: search */

.search-header-wrap {
  padding-bottom: 0;
  padding-top: 1.5rem;
}

.search-body-wrap {
  padding-top: 0;
  padding-bottom: 0;
}

.search-actions {
  display: flex;
  gap: 0.5rem;
  align-items: flex-end;
}

.search-wrap {
  margin-top: -2rem;
  position: relative;
  z-index: 10;
}

.search-card {
  padding: 1.75rem 2rem;
}

.search-grid {
  display: grid;
  grid-template-columns: 1fr 1fr auto auto;
  gap: 1rem;
  align-items: flex-end;
}

.presets-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
  padding-top: 1.2rem;
  margin-top: 1.2rem;
  border-top: 1px solid var(--border);
}

.preset-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--muted);
  flex-shrink: 0;
}

.status-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.25rem 0 0.5rem;
  min-height: 28px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
  flex-shrink: 0;
}

.status-dot.active {
  background: var(--accent2);
  animation: pulse 1.4s ease infinite;
}

.status-text {
  font-size: 0.85rem;
  color: var(--muted);
}

.status-count {
  font-family: 'Syne', sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent);
  background: var(--tag-bg);
  padding: 0.18rem 0.7rem;
  border-radius: 100px;
}

.loader-box {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  padding: 5rem 2rem;
  text-align: center;
}

.loader-box.show {
  display: flex;
}

.loader-ring {
  width: 52px;
  height: 52px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

.loader-title {
  font-family: 'Syne', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
}

.loader-sub {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: -0.5rem;
}

.alert {
  display: none;
  padding: 0.9rem 1.2rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  line-height: 1.55;
  margin-bottom: 1.25rem;
  gap: 0.6rem;
  align-items: flex-start;
}

.alert.show {
  display: flex;
}

.alert-warn {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #78350f;
}

.alert-info {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e3a8a;
}

.alert-icon {
  flex-shrink: 0;
  font-size: 1.05rem;
}

.alert-link {
  font-weight: 600;
  text-decoration: underline;
}

.alert-link-warn {
  color: #92400e;
}

.alert-link-info {
  color: #1e3a8a;
}

.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.results-title {
  font-family: 'Syne', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink3);
}

.sort-pills {
  display: flex;
  gap: 0.4rem;
}

.sort-pill {
  font-size: 0.78rem;
  font-weight: 500;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: white;
  color: var(--muted);
  transition: all 0.15s;
  font-family: 'DM Sans', sans-serif;
}

.sort-pill:hover,
.sort-pill.active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--tag-bg);
}

.jobs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 1rem;
}

.job-card {
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.4rem;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  position: relative;
  overflow: hidden;
}

.job-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}

.job-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-accent);
  border-color: rgba(26, 86, 255, 0.3);
}

.job-card:hover::before {
  transform: scaleX(1);
}

.card-company-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
}

.company-avatar {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 1.1rem;
  color: white;
  flex-shrink: 0;
  text-transform: uppercase;
}

.avatar-color-0 { background: #07070f; }
.avatar-color-1 { background: #1a56ff; }
.avatar-color-2 { background: #00c9a7; }
.avatar-color-3 { background: #7c3aed; }
.avatar-color-4 { background: #dc2626; }
.avatar-color-5 { background: #ea580c; }
.avatar-color-6 { background: #0891b2; }
.avatar-color-7 { background: #065f46; }

.company-info {
  flex: 1;
  min-width: 0;
}

.company-name {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--accent);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-title {
  font-family: 'Syne', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.3;
  letter-spacing: -0.3px;
  margin-bottom: 0.7rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.meta-tag {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.78rem;
  color: var(--muted);
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.9rem;
  border-top: 1px solid var(--border);
}

.posted-label {
  font-size: 0.76rem;
  color: var(--muted);
  font-style: italic;
}

.view-btn {
  font-family: 'Syne', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.38rem 0.9rem;
  background: var(--ink);
  color: white;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: background var(--transition);
  letter-spacing: 0.2px;
}

.view-btn:hover {
  background: var(--accent);
}

.empty-state {
  display: none;
  text-align: center;
  padding: 5rem 2rem;
}

.empty-state.show {
  display: block;
}

.empty-state-idle {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at top right, rgba(26, 86, 255, 0.09), transparent 35%),
    radial-gradient(circle at bottom left, rgba(0, 201, 167, 0.09), transparent 32%),
    #ffffff;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius-lg) + 2px);
  box-shadow: var(--shadow-sm);
}

.idle-scene {
  position: relative;
  width: min(360px, 100%);
  height: 220px;
  margin: 0 auto 1.35rem;
}

.idle-core {
  position: absolute;
  inset: 50% auto auto 50%;
  width: 94px;
  height: 94px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(26, 86, 255, 0.16), rgba(0, 201, 167, 0.16));
  border: 1px solid rgba(26, 86, 255, 0.14);
  box-shadow: 0 12px 30px rgba(26, 86, 255, 0.12);
}

.idle-core-icon {
  font-size: 2.25rem;
}

.idle-orbit,
.idle-ping {
  position: absolute;
  inset: 50% auto auto 50%;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.idle-orbit {
  border: 1px dashed rgba(26, 86, 255, 0.18);
  animation: idleRotate 16s linear infinite;
}

.idle-orbit-one {
  width: 156px;
  height: 156px;
}

.idle-orbit-two {
  width: 216px;
  height: 216px;
  animation-direction: reverse;
  animation-duration: 22s;
}

.idle-ping {
  border: 1px solid rgba(0, 201, 167, 0.18);
  animation: idlePulseRing 3s ease-out infinite;
}

.idle-ping-one {
  width: 118px;
  height: 118px;
}

.idle-ping-two {
  width: 118px;
  height: 118px;
  animation-delay: 1.2s;
}

.idle-chip {
  position: absolute;
  padding: 0.42rem 0.78rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(26, 86, 255, 0.12);
  box-shadow: 0 10px 24px rgba(7, 7, 15, 0.06);
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--ink3);
  backdrop-filter: blur(8px);
}

.idle-chip-one {
  top: 18px;
  left: 42px;
  animation: idleFloat 4.5s ease-in-out infinite;
}

.idle-chip-two {
  top: 72px;
  right: 22px;
  animation: idleFloat 5s ease-in-out infinite 0.45s;
}

.idle-chip-three {
  bottom: 14px;
  left: 92px;
  animation: idleFloat 5.4s ease-in-out infinite 0.9s;
}

.idle-actions {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1.2rem;
}

.empty-icon {
  font-size: 3.5rem;
  margin-bottom: 1rem;
}

.empty-title {
  font-family: 'Syne', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.empty-sub {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.6;
}

.error-state {
  display: none;
  background: #fff5f5;
  border: 1.5px solid #fecaca;
  border-radius: var(--radius-lg);
  padding: 2rem;
  text-align: center;
  margin: 1rem 0;
}

.error-state.show {
  display: block;
}

.error-title {
  font-family: 'Syne', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: #dc2626;
  margin-bottom: 0.5rem;
}

.error-sub {
  font-size: 0.88rem;
  color: #7f1d1d;
  line-height: 1.6;
}

.error-sub code {
  background: #fee2e2;
  padding: 0.15rem 0.5rem;
  border-radius: 5px;
  font-size: 0.82rem;
}

@keyframes idleRotate {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes idlePulseRing {
  0% {
    transform: translate(-50%, -50%) scale(0.8);
    opacity: 0.7;
  }
  100% {
    transform: translate(-50%, -50%) scale(1.55);
    opacity: 0;
  }
}

@keyframes idleFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@media (max-width: 768px) {
  .search-grid {
    grid-template-columns: 1fr;
  }

  .search-card {
    padding: 1.25rem;
  }

  .jobs-grid {
    grid-template-columns: 1fr;
  }

  .idle-scene {
    height: 200px;
  }

  .idle-chip-one {
    left: 8px;
  }

  .idle-chip-two {
    right: 6px;
  }

  .idle-chip-three {
    left: 54px;
  }
}
