body {
  font-family: "Outfit", sans-serif;
  margin: 0;
  padding: 0;
  background: #fff;
  overflow-x: hidden;
  font-size: 16px; /* Base font size for rem calculations */
}

main {
  display: flex;
  gap: 2.5%;
  flex-wrap: wrap;
  margin: 5% 3%;
  max-width: 100%;
}

.row {
  margin-left: 0;
  margin-right: 0;
}

aside {
  background-color: #FF8C0061;
  padding: 1.5rem;
  width: min(285px, 28%);
  min-width: 280px;
  height: auto;
  min-height: 41.5rem;
  border-radius: 0.125rem;
  font-size: 1rem;
  font-weight: 600;
  user-select: none;
  box-shadow: 0.25rem 0.25rem 0.5rem rgba(0, 0, 0, 0.3);
  flex-shrink: 0;
}

aside label.search-label {
  display: block;
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 0.375rem;
}

aside input[type="search"] {
  width: 100%;
  font-size: 1rem;
  padding: 0.3125rem 0.375rem;
  border-radius: 0.625rem;
  border: 1px solid #000000;
  margin-bottom: 0.9375rem;
  font-weight: 400;
  box-sizing: border-box;
}

aside .categories-label {
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

aside .category-item {
  display: flex;
  align-items: flex-start;
  gap: 0.4375rem;
  margin-bottom: 0.4375rem;
  font-weight: 600;
  font-size: 1rem;
}

aside .category-item input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  display: flex;
  align-content: center;
  justify-content: center;
  width: 1.25rem;
  height: 1rem;
  border: 2px solid rgb(0, 0, 0);
  border-radius: 0.3125rem;
  margin-top: 0.32rem;
  margin-left: 0.4375rem;
  flex-shrink: 0;
}

aside .category-item input[type="checkbox"]::before {
  content: "";
  width: 1.25rem;
  height: 0.875rem;
  clip-path: polygon(28% 38%, 41% 53%, 75% 24%, 86% 38%, 40% 78%, 15% 50%);
  transform: scale(0);
  background-color: #4000ff;
}

aside .category-item input[type="checkbox"]:checked::before {
  transform: scale(1);
}

section.cards {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(220px, 45vw), 1fr));
  gap: 1.5rem;
  /* Removed grid-template-rows to fix card stretching */
  min-width: 0; /* Prevents grid overflow */
}

.card {
  background: #fff;
  border-radius: 1.25rem;
  box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.15);
  overflow: hidden;
  width: 100%;
  max-width: 16.25rem;
  /* Fixed height to ensure consistent card sizes */
  height: fit-content;
  min-height: 18.75rem;
  display: flex;
  flex-direction: column;
  justify-self: center;
}

.card img {
  width: 100%;
  height: 10rem;
  object-fit: cover;
  flex-shrink: 0;
}

.card-content {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  flex-grow: 1;
}

.card-title {
  font-size: 1.25rem;
  font-weight: 600;
  text-align: left;
  margin: 0;
}

.card-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.9375rem;
  color: #333;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.card-info span {
  display: flex;
  align-items: center;
  gap: 0.3125rem;
}

.join-btn {
  margin-top: auto;
  padding: 0.625rem;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 0.5rem;
  color: white;
  background: linear-gradient(to right, #ff5f06, #ff1e00);
  cursor: pointer;
  box-shadow: 0 0.125rem 0.625rem rgba(255, 81, 5, 0.4);
  transition: transform 0.2s ease;
}

.join-btn:hover {
  transform: translateY(-0.125rem);
}

/* Request Hobby Card Styles */
.request-card {
  background: linear-gradient(135deg, #ff5f06, #ff1e00);
  border-radius: 1.25rem;
  box-shadow: 0 0.25rem 0.75rem rgba(255, 95, 6, 0.3);
  overflow: hidden;
  width: 100%;
  max-width: 16.25rem;
  height: fit-content;
  min-height: 18.75rem;
  display: flex;
  flex-direction: column;
  justify-self: center;
  color: white;
  text-align: center;
}

.request-card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 10rem;
  font-size: 4rem;
  background: rgba(255, 255, 255, 0.1);
}

.request-card-content {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  flex-grow: 1;
}

.request-card-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0;
}

.request-card-description {
  font-size: 0.9rem;
  opacity: 0.9;
  line-height: 1.4;
}

.request-btn {
  margin-top: auto;
  padding: 0.625rem;
  font-size: 1rem;
  font-weight: 600;
  border: 2px solid white;
  border-radius: 0.5rem;
  color: #ff5f06;
  background: white;
  cursor: pointer;
  transition: all 0.2s ease;
}

.request-btn:hover {
  background: transparent;
  color: white;
  transform: translateY(-0.125rem);
}

/* No Results Message */
.no-results {
  grid-column: 1 / -1;
  text-align: center;
  padding: 2rem;
  color: #666;
  font-size: 1.1rem;
}

/* Home Section Styles */
#home {
  margin: 5% 3%;
  margin-bottom: 10%;
}

#home .hd h2, #home .hd h1 {
  font-size: clamp(2.5rem, 8vw, 3.75rem);
  font-weight: 500;
  line-height: 1.2;
}

#home .hd h2 > span, #home .hd h1 > span {
  background-image: linear-gradient(to right, #ff5f06, #ff1e00);
  -webkit-background-clip: text;
  background-clip: text;
  background-clip: text;
  color: transparent;
}

#home p {
  font-size: clamp(1.2rem, 3vw, 1.5rem);
  line-height: 1.4;
}

#home .cs {
  background-image: linear-gradient(to right, rgb(255, 81, 5), rgb(255, 62, 5), rgb(248, 72, 5), rgb(163, 2, 2));
  backdrop-filter: blur(0.3125rem);
  color: white;
  font-weight: 500;
  border-radius: 0.5rem;
  width: 90%;
  max-width: 100%;
  margin-top: 1rem;
  padding: 1.5rem;
  box-sizing: border-box;
}

#home .cs h5 {
  font-weight: 900;
  margin-bottom: 0;
  text-shadow: 0.125rem 0.125rem 0.25rem black;
  font-size: clamp(1.2rem, 3vw, 1.5rem);
}

#home__order2 {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}

#home .cs p {
  margin-bottom: 0;
  font-size: clamp(1.2rem, 3vw, 1.5rem);
  text-shadow: 0.125rem 0.125rem 0.25rem black;
}

#home .cs > p {
  font-size: clamp(1.5rem, 4vw, 2rem);
  text-shadow: 0.125rem 0.125rem 0.25rem black;
}

#home .home-banner {
  width: 100%;
  height: auto;
}

/* Autocomplete Styles */
.autocomplete {
  position: relative;
  width: 100%;
  max-width: 21.8rem;
}

.autocomplete-items {
  position: absolute;
  border: 0.0625rem solid #d4d4d4;
  border-bottom: none;
  border-top: none;
  z-index: 99;
  top: 3.2rem;
  left: 0;
  right: 0;
  background: white;
}

.autocomplete-items div {
  padding: 1rem;
  cursor: pointer;
  background-color: #fff;
  border-bottom: 0.0625rem solid #d4d4d4;
  font-size: 0.9rem;
}

.autocomplete-items div:hover {
  background-color: #e9e9e9;
}

.autocomplete-active {
  background-color: DodgerBlue !important;
  color: #ffffff;
}

.autocomplete > i {
  position: absolute;
  left: 1.5rem;
  z-index: 9;
  top: 0.8rem;
  font-size: 1.2rem;
}

.autocomplete .form-control {
  width: 100%;
  font-size: 1rem;
  padding-left: 4rem;
  border-color: #f90d02;
  box-shadow: none;
  padding: 0.75rem 1rem 0.75rem 4rem;
}

.autocomplete + .input-group-append .btn {
  font-size: 1rem;
  background-color: #f90d02;
  color: #fff;
  font-weight: 800;
  padding: 0.75rem 1.5rem;
}

#home .Book {
  display: inline-block;
  color: black;
  background-color: transparent;
  border: 1px solid orangered;
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 800;
  padding: 0.5rem 4rem;
  border-radius: 0.5rem;
  margin-top: 2.5rem;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s ease;
}

#home .Book:hover {
  background-color: orangered;
  color: white;
}

/* Reach Section */
.reach {
  display: flex;
  margin-top: 0.5rem;
  text-align: center;
  flex-direction: column;
}

.reach .reach-text {
  margin-bottom: 0;
  padding: 0.1875rem;
  margin-right: 0.625rem;
  font-size: clamp(1.5rem, 4vw, 2rem) !important;
  font-weight: 600;
  display: inline;
}

.hobby-heading {
  font-size: clamp(2.5rem, 8vw, 3.9375rem) !important;
  font-weight: 700;
  margin-top: 3.125rem;
  color: rgb(0, 0, 0);
}

.hobby-heading span {
  background: linear-gradient(to right, #ff5f06, #ff1e00);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Typewriter Effect */
.typewriter-box {
  font-size: clamp(1.2rem, 3vw, 1.5rem);
  font-weight: 600;
}

.cursor {
  display: inline-block;
  width: 1px;
  height: 2rem;
  background-color: black;
  margin-left: 0.125rem;
  animation: blink 0.7s steps(1) infinite;
  vertical-align: middle;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* Responsive Media Queries */
@media (max-width: 56.25rem) { /* 900px */
  main {
    flex-direction: column;
    padding: 2% 1.5%;
    gap: 1.5rem;
  }
  
  aside {
    width: 100%;
    min-width: unset;
    margin-bottom: 1.25rem;
    min-height: auto;
  }
  
  section.cards {
    /* grid-template-columns: repeat(auto-fill, minmax(min(200px, 45vw), 1fr)); */
    gap: 1rem;
  }
  
  .card, .request-card {
    max-width: 100%;
    min-height: 16rem;
  }
  
  .card img {
    height: 8rem;
  }
  
  .request-card-icon {
    height: 8rem;
    font-size: 3rem;
  }
  
  #home {
    margin: 3% 2%;
  }
  
  #home .cs {
    width: 95%;
    padding: 1rem;
  }
}

@media (max-width: 30rem) { /* 480px */
  main {
    padding: 2% 1%;
    gap: 1rem;
  }
  
  aside {
    font-size: 0.625rem;
    padding: 0.75rem;
    height: auto;
  }
  
  aside input[type="search"] {
    font-size: 0.925rem;
    padding: 0.25rem 0.3125rem;
  }
  
  aside .category-item {
    font-size: 1.1rem;
  }

  aside .category-item input[type="checkbox"] {
    margin-top: 0.4rem;
  }
  
  aside label.search-label,
  aside .categories-label {
    font-size: 1.3rem;
  }
  
  section.cards {
    /* grid-template-columns: repeat(auto-fill, minmax(min(160px, 40vw), 1fr)); */
    gap: 0.75rem;
  }
  
  .card, .request-card {
    min-height: 14rem;
  }
  
  .card img {
    height: 14rem;
  }
  
  .request-card-icon {
    height: 6rem;
    font-size: 2.5rem;
  }
  
  .card-title, .request-card-title {
    font-size: 1rem;
  }
  
  .card-content, .request-card-content {
    padding: 0.75rem;
  }
  
  .card-info {
    font-size: 0.75rem;
  }
  
  .join-btn, .request-btn {
    font-size: 0.875rem;
    padding: 0.5rem;
  }
  
  .request-card-description {
    font-size: 0.8rem;
  }
  
  #home {
    margin: 2% 1%;
  }
  
  #home .hd h2, #home .hd h1 {
    font-size: clamp(1.8rem, 6vw, 2.5rem);
  }
  
  #home .cs {
    width: 98%;
    padding: 0.75rem;
  }
  
  #home .Book {
    padding: 0.4rem 2rem;
    font-size: clamp(1.2rem, 5vw, 1.5rem);
  }
}

@media (max-width: 20rem) { /* 320px - very small screens */
  section.cards {
    /* grid-template-columns: 1fr; */
    gap: 0.5rem;
  }
  
  .card, .request-card {
    margin: 0 auto;
    max-width: 90%;
    min-height: 12rem;
  }
  
  .card img {
    height: 5rem;
  }
  
  .request-card-icon {
    height: 5rem;
    font-size: 2rem;
  }
  
  aside {
    padding: 0.5rem;
  }
  
  main {
    margin: 1% 0.5%;
  }
}