body {
  background-color: #eee;
}

.people-content {
  height: calc(100vh - 70px);
  min-height: calc(100vh - 70px);
  background-color: #eee;
  margin: 150px 10px;
}

.people-content .container {
  display: flex;
  gap: 30px;
  min-height: 100%;
  /* overflow: hidden; */
}

.people-content .filter {
  width: 200px;
  position: relative;
  left: 0;
  margin: 40px 10px;
  /* transition: 3.4s; */
  /* padding-right: 10px;
  border-right: 2px solid #ddd; */
  /* animation: hide 0.5s linear; */
}

.icon-filter {
  position: fixed;
  right: 20px;
  bottom: 20px;
  font-size: 25px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  color: #fff;
  background-color: var(--maincolor) !important;
  display: none !important;
  /* الافتراضي مخفية */
  align-items: center;
  justify-content: center;
  z-index: 101;
  box-shadow: 0 2px 8px rgba(103, 20, 117, 0.15);
  cursor: pointer;
  transition: background 0.2s;
}

.icon-filter:hover {
  background-color: #853695 !important;
}

@media (max-width: 991px) {
  .people-content .filter {
    display: none;
  }

  .people-content .filter.show {
    display: block;
    position: fixed;
    background: #ddd;
    padding: 20px;
    width: 250px;
    max-width: 100%;
    top: 0;
    z-index: 102;
    height: 100vh;
    overflow-x: hidden;
    border-radius: 0 10px 10px 0;
  }

  .filter.show::-webkit-scrollbar {
    width: 10px;
    background: #ddd;
    border-radius: 0 10px 10px 0;
  }

  .filter.show::-webkit-scrollbar-thumb {
    background: rgb(109, 106, 106);
    border-radius: 0 10px 10px 0;
  }

  .icon-filter {
    display: flex !important;
    /* تظهر فقط في الموبايل */
  }
}

.people-content .filter::after {
  position: absolute;
  content: "";
  top: 0;
  right: -15px;
  height: 100%;
  width: 2px;
  background-color: #ddd;
}

.people-content .people {
  flex: 1;
}

.filter form>h2 {
  color: rgb(95, 26, 91);
  text-transform: capitalize;
  font-size: 18px;
  margin: 20px 0 10px;
}

.filter form>.option:not(:last-child) {
  border-bottom: 1px solid #ddd;
  margin-bottom: 5px;
}

.filter .option .title {
  margin-bottom: 3px;
  text-transform: capitalize;
  font-weight: 500;
  font-size: 15px;
}

.filter .name input {
  display: block;
  width: 100%;
  border: 2px solid #ddd;
  padding: 0 10px;
  border-radius: 6px;
  height: 30px;
  font-size: 14px;
  margin-bottom: 5px;
}

.filter .option input:focus,
.filter .option select:focus {
  border: 2px solid #601a5d;
  outline: none;
}

.filter .option select {
  display: block;
  width: 100%;
  border: 2px solid #ddd;
  padding: 0 10px;
  border-radius: 6px;
  height: 30px;
  font-size: 14px;
  margin-bottom: 5px;
}

.filter .age .year,
.filter .health .health-status {
  margin-bottom: 3px;
  /* margin-bottom: 10px;
  background-color: white;
  border-radius: 8px;
  padding: 5px 10px; */
}

.filter .age .year:last-child,
.filter .health .health-status:last-child {
  margin-bottom: 5px;
}

/* //////////////////////// */
.filter .select-box {
  display: flex;
  width: 100%;
  flex-direction: column;
}

.filter .select-box .cities-container {
  background: white;
  /* color: #f5f6fa; */
  max-height: 0;
  width: 100%;
  opacity: 0;
  transition: all 0.4s;
  border-radius: 8px;
  overflow: hidden;
}

.filter .selected {
  background: white;
  border: 2px solid #ddd;
  height: 30px;
  display: flex;
  align-items: center;
  padding: 0 10px;
  border-radius: 8px;
  margin-bottom: 8px;
  position: relative;
  transition: all 0.4s;
}

.filter .selected.clicked {
  border: 2px solid #511757;
}

.filter .selected::after {
  content: "\f077";
  font-family: "Font Awesome 5 Free";
  font-weight: 900;
  position: absolute;
  right: 10px;
  transition: all 0.4s;
}

.filter .selected.rotate::after {
  transform: rotateX(180deg);
}

.filter .select-box .cities-container.active {
  max-height: 240px;
  opacity: 1;
  overflow-y: scroll;
}

.filter .select-box .cities-container::-webkit-scrollbar {
  width: 8px;
  background: #ddd;
  border-radius: 0 8px 8px 0;
}

.filter .select-box .cities-container::-webkit-scrollbar-thumb {
  background: rgb(109, 106, 106);
  border-radius: 0 8px 8px 0;
}

.filter .select-box .city,
.filter .selected {
  cursor: pointer;
}

.filter .select-box .city:hover {
  background: #ddd;
}

.filter .select-box label {
  cursor: pointer;
  padding: 12px 24px;
  display: inline-block;
  width: 100%;
}

.filter .select-box .city input[type="radio"] {
  display: none;
}

.filter .bottons {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.filter .bottons input,
.filter .bottons a {
  display: block;
  border: none;
  background-color: #4f1a56;
  color: white;
  padding: 6px 0;
  width: 50%;
  border-radius: 8px;
  flex: 1;
  text-align: center;
  cursor: pointer;
  text-transform: capitalize;
}

.people {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 28px;
  padding: 30px 0 30px 0;
  align-content: flex-start;
  justify-items: stretch;
}

.people .box {
  min-width: 0;
  max-width: 100%;
  padding: 22px 18px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  background-color: var(--altbackcolor);
  border-radius: 10px;
  position: relative;
  overflow: hidden;
  height: 100%;
  box-sizing: border-box;
}

.people .box .photo {
  margin-bottom: 15px;
  width: 100%;
  height: 180px;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
}

.people .box .photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: var(--trans);
  display: block;
}

.people .box .text h3 {
  text-transform: capitalize;
  font-size: 14px;
  margin-bottom: 5px;
  color: var(--textcolor);
  color: var(--maincolor);
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.people .box .text p {
  color: var(--textcolor);
  font-size: 12px;
}

.people .box .type {
  position: absolute;
  top: 19px;
  width: 90px;
  background-color: var(--maincolor);
  text-transform: capitalize;
  color: white;
  font-size: 14px;
  /* font-weight: bold; */
  right: -18px;
  rotate: 45deg;
  text-align: center;
}

.people .box .type.missed {
  background-color: #853695;
}

.people .box .type.found {
  background-color: var(--maincolor);
}

.empty {
  padding: 10px 20px;
  background-color: #e4efff;
  background-color: #fadbe2;
  color: #bb0a11;
  padding: 15px 20px;
  border-radius: 10px;
  margin-bottom: 10px;
  white-space: nowrap;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

@media (max-width: 466px) {
  .people .box a {
    display: flex;
    gap: 20px;
  }

  .people .box {
    padding: 10px;
  }

  .people .box .photo {
    width: 100px;
    min-width: 100px;
    height: 100px;
    object-fit: cover;
    object-position: center;
    margin: 0;
  }

  .people .box .text {
    display: flex;
    gap: 15px;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
    /* justify-content: space-between; */
  }

  .people .box .text h3 {
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin: 0;
  }

  .people .box .type {
    bottom: 10px;
    left: 130px;
    padding: 5px 15px;
    border-radius: 10px;
    rotate: unset;
    top: unset;
    width: calc(100% - 140px);
  }
}

@media (max-width: 991px) {
  .overlay {
    position: fixed;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    top: 0;
    left: 0;
    z-index: 100;
  }
}

/* إصلاح عرض الفلاتر والنتائج في الشاشات الكبيرة (ديسكتوب) */
@media (min-width: 992px) {
  .people-content {
    margin: 120px auto 0 auto;
    max-width: 1200px;
    min-height: calc(100vh - 120px);
    height: auto;
  }

  .people-content .container {
    flex-direction: row;
    align-items: flex-start;
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto;
  }

  .people-content .filter {
    display: block !important;
    width: 260px;
    min-width: 220px;
    max-width: 320px;
    margin: 40px 0 0 0;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 16px rgba(103, 20, 117, 0.06);
    padding: 24px 18px 18px 18px;
    position: sticky;
    top: 110px;
    left: 0;
    z-index: 10;
  }

  .people-content .filter::after {
    display: none;
  }

  .people-content .people {
    flex: 1 1 0%;
    min-width: 0;
    padding: 0 0 0 10px;
  }

  .icon-filter {
    display: none !important;
  }
}

/* إصلاح الشبكة في النتائج */
@media (min-width: 992px) {
  .people {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 28px;
    padding: 30px 0 30px 0;
  }

  .people .box {
    min-width: 0;
    max-width: 100%;
    padding: 22px 18px;
  }
}

/* موبايل: ترتيب الكروت عمودي وتوسيط الصورة */
@media (max-width: 991px) {
  .people {
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    padding: 18px 0 18px 0;
  }

  .people .box {
    padding: 12px 8px;
    min-width: 0;
    max-width: 100%;
    height: 100%;
  }

  .people .box .photo {
    height: 120px;
  }
}

@media (max-width: 600px) {
  .people {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 10px 0 10px 0;
  }

  .people .box .photo {
    height: 90px;
  }
}