/* ── Reset & Base ──────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --brand:       rgb(180, 46, 45);
  --brand-dark:  rgb(145, 32, 31);
  --brand-light: rgba(180, 46, 45, 0.08);
  --white:       #ffffff;
  --gray-50:     #f8f8f8;
  --gray-200:    #e5e5e5;
  --gray-400:    #9e9e9e;
  --gray-700:    #444444;
  --radius:      14px;
  --shadow:      0 4px 20px rgba(0, 0, 0, 0.09);
  --shadow-hover:0 10px 36px rgba(0, 0, 0, 0.16);
  --transition:  0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--white);
  color: var(--gray-700);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Warning Modal ────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  padding: 24px;
  animation: fadeIn 0.3s ease;
}

.modal-overlay.hidden {
  display: none;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.modal {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  max-width: 480px;
  width: 100%;
  padding: 36px 32px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  animation: modalUp 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalUp {
  from { opacity: 0; transform: translateY(32px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0)    scale(1);    }
}

.modal-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(180, 46, 45, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand);
  margin-bottom: 16px;
  flex-shrink: 0;
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--brand);
  margin-bottom: 14px;
}

.modal-text {
  font-size: 0.9rem;
  color: var(--gray-700);
  line-height: 1.7;
  margin-bottom: 28px;
}

.modal-text strong {
  color: var(--brand);
}

.modal-btn {
  background: var(--brand);
  color: var(--white);
  border: none;
  border-radius: 999px;
  padding: 12px 32px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
}

.modal-btn:hover {
  background: var(--brand-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(180, 46, 45, 0.35);
}

/* ── Header ───────────────────────────────────────────────── */
header {
  background: var(--brand);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 22px 40px;
  box-shadow: 0 3px 12px rgba(0,0,0,0.2);
  position: sticky;
  top: 0;
  z-index: 10000;
  animation: slideDown 0.5s ease both;
}

@keyframes slideDown {
  from { transform: translateY(-100%); opacity: 0; }
  to   { transform: translateY(0);     opacity: 1; }
}

.logo {
  height: 56px;
  object-fit: contain;
  filter: brightness(0) invert(1); /* keep white on red */
  transition: transform var(--transition);
}

.logo:hover { transform: scale(1.05); }

/* ── Main ─────────────────────────────────────────────────── */
main { flex: 1; }

/* ── Filter Section ───────────────────────────────────────── */
.filter-section {
  padding: 48px 40px 32px;
  background: var(--white);
  max-width: 1280px;
  margin: 0 auto;
  width: 100%;
}

.section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  opacity: 0;
  animation: fadeUp 0.6s 0.3s ease forwards;
}

.section-title {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 700;
  color: var(--brand);
}

.section-subtitle {
  font-size: 1rem;
  color: var(--gray-400);
  margin-top: 6px;
}

/* ── Filter Icon Button ───────────────────────────────────── */
.filter-section { position: relative; z-index: 300; }

.filter-wrapper {
  position: relative;
  flex-shrink: 0;
  margin-top: 4px;
}

.filter-icon-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  border: 2px solid var(--gray-200);
  border-radius: 999px;
  background: var(--white);
  color: var(--gray-700);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  position: relative;
  transition: border-color var(--transition), color var(--transition),
              box-shadow var(--transition), transform var(--transition);
}

.filter-icon-btn:hover {
  border-color: var(--brand);
  color: var(--brand);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(180,46,45,0.15);
}

.filter-icon-btn.active {
  border-color: var(--brand);
  color: var(--brand);
  background: var(--brand-light);
  box-shadow: 0 4px 14px rgba(180,46,45,0.2);
}

/* red dot indicator when filter is active */
.filter-dot {
  display: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand);
  position: absolute;
  top: -3px;
  right: -3px;
  border: 2px solid var(--white);
  animation: popIn 0.2s ease;
}

.filter-dot.visible { display: block; }

@keyframes popIn {
  from { transform: scale(0); }
  to   { transform: scale(1); }
}

/* ── Filter Dropdown ──────────────────────────────────────── */
.filter-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 220px;
  max-height: 320px;
  overflow-y: auto;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(0,0,0,0.13);
  z-index: 9999;
  display: none;
  flex-direction: column;
  padding: 6px 0;
  animation: dropDown 0.2s ease;
}

.filter-dropdown.open {
  display: flex;
}

@keyframes dropDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0);    }
}

.filter-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-700);
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: background var(--transition), color var(--transition);
}

.filter-option:hover {
  background: var(--brand-light);
  color: var(--brand);
}

.filter-option.selected {
  color: var(--brand);
  font-weight: 700;
  background: var(--brand-light);
}

.clear-option {
  color: var(--gray-400);
  font-size: 0.8rem;
}

.clear-option:hover {
  color: var(--brand);
  background: var(--brand-light);
}

.filter-divider {
  height: 1px;
  background: var(--gray-200);
  margin: 4px 0;
}

/* ── Cards Section ────────────────────────────────────────── */
.cards-section {
  padding: 12px 32px 64px;
  max-width: 1280px;
  margin: 0 auto;
  width: 100%;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 28px;
}

/* ── Worker Card ──────────────────────────────────────────── */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--gray-200);
  transition: transform var(--transition), box-shadow var(--transition);
  animation: fadeUp 0.5s ease both;
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-hover);
}

/* staggered entrance via JS inline style --delay */
.card { animation-delay: var(--delay, 0s); }

.card-top {
  background: var(--brand);
  padding: 20px 20px 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--white);
  text-align: center;
  line-height: 1.3;
}

.card-body {
  padding: 18px 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
}

/* ── Phones ───────────────────────────────────────────────── */
.card-section-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gray-400);
  margin-bottom: 4px;
}

.phones-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.phones-list li {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.9rem;
  color: var(--gray-700);
}

.phones-list li::before {
  content: '';
  display: inline-block;
  width: 14px;
  height: 14px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b42e2d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07A19.5 19.5 0 0 1 4.69 12 19.79 19.79 0 0 1 1.61 3.42 2 2 0 0 1 3.6 1.25h3a2 2 0 0 1 2 1.72c.13.96.36 1.9.7 2.81a2 2 0 0 1-.45 2.11L7.91 9a16 16 0 0 0 6 6l.91-.91a2 2 0 0 1 2.11-.45c.91.34 1.85.57 2.81.7A2 2 0 0 1 22 16.92z'/%3E%3C/svg%3E") no-repeat center / contain;
  flex-shrink: 0;
}

/* ── Specialties ──────────────────────────────────────────── */
.specialties-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.specialty-tag {
  background: var(--brand-light);
  color: var(--brand);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(180,46,45,0.2);
  transition: background var(--transition), color var(--transition), transform var(--transition);
}

.specialty-tag:hover {
  background: var(--brand);
  color: var(--white);
  transform: scale(1.05);
}

/* highlight tag when its filter is active */
.specialty-tag.highlighted {
  background: var(--brand);
  color: var(--white);
}

/* ── No Results ───────────────────────────────────────────── */
.no-results {
  display: none;
  text-align: center;
  padding: 60px 20px;
  color: var(--gray-400);
  font-size: 1.05rem;
}

.no-results.visible { display: block; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0);    }
}

/* ── Footer ───────────────────────────────────────────────── */
footer {
  text-align: center;
  padding: 22px;
  font-size: 0.82rem;
  color: var(--gray-400);
  border-top: 1px solid var(--gray-200);
  background: var(--white);
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 600px) {
  header { padding: 18px 20px; }
  .logo  { height: 44px; }
  .filter-section { padding: 32px 16px 20px; }
  .cards-section  { padding: 12px 16px 48px; }
}
