@import "../general.css";
@import "../components/project-listing.css";

.project-section {
  padding-block: 8rem;
}

.menu-container {
  max-width: 1300px;
}

.project-section .top-select-menu .select-btn {
  min-width: 18.97rem;
  background-color: white;
  border: 1px solid black;
  font-size: 1.4rem;
  font-weight: 400;
  border-radius: 0.5rem;
  border: 0.1rem solid #e6e6e6;
}

.project-section .top-select-menu .select-btn.active {
  background-color: #f7f7f7;
}

.project-section .top-select-menu {
  display: flex;
  gap: 1rem;
}

.project-section .top-select-menu li {
  cursor: pointer;
}

.project-section .top-select-menu li a {
  width: 100%;
  display: inline-block;
  padding: 0.85rem 1.8rem;
  padding-inline-start: 1.8rem;
}

.project-section .mobile-select-wrapper {
  position: relative;
}

.more-button {
  padding-top: 4rem;
  display: flex;
  justify-content: center;
  align-items: center;
}

.load-more-btn {
  height: 2rem;
  width: 2rem;
  position: relative;
}

.load-more-btn img {
  position: absolute;
  height: 100%;
  width: 100%;
  top: 0;
  left: 0;
  object-fit: cover;
}

.project-wrapper .services-images {
  position: absolute;
  height: 100%;
  width: 100%;
  object-fit: cover;
}

.projects-section {
  padding-top: 4rem;
}

.dropdown-icon {
  display: none;
}

.selected-heading {
  display: none;
  padding-inline: 2rem;
  padding-block: 1.5rem;
  font-size: 2rem;
  font-weight: 400;
  position: relative;
  border: 0.05rem solid #e6e6e6;
  background-color: #f2f2f2;
}

/* ==================================================================
* Project Skeleton Loader
* Used during AJAX "Load More" requests for Projects listing
* ================================================================== */

/* --------------------------------------------------
* Skeleton Card Wrapper
* -------------------------------------------------- */
.project-skeleton {
  border-radius: 16px;
  overflow: hidden;
  animation: mdm-skeleton-pulse 1.4s ease-in-out infinite;
}

/* --------------------------------------------------
* Skeleton Image Placeholder
* -------------------------------------------------- */
.skeleton-image {
  height: 260px;
  background-color: #e6e6e6;
}

/* --------------------------------------------------
* Skeleton Content Wrapper
* -------------------------------------------------- */
.skeleton-content {
  padding: 16px;
}

/* --------------------------------------------------
* Skeleton Text Lines
* -------------------------------------------------- */
.skeleton-line {
  height: 14px;
  margin-top: 12px;
  background-color: #dddddd;
  border-radius: 6px;
}

.skeleton-line.short {
  width: 60%;
}

/* --------------------------------------------------
* Skeleton Pulse Animation
* -------------------------------------------------- */
@keyframes mdm-skeleton-pulse {
  0% {
    opacity: 0.5;
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 0.5;
  }
}

/* ==================================================================
* Load More Button – Loading State
* Prevents multiple clicks during AJAX requests
* ================================================================== */
.load-more-btn.loading {
  pointer-events: none;
  opacity: 0.6;
}

@media (max-width: 767px) {
  .project-cards .project-wrapper {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
  }
  .project-section .top-select-menu li a {
    padding: 0;
  }

  .load-more-btn {
    height: 4rem;
    width: 4rem;
  }

  .project-section {
    padding-block: 4.4rem;
  }

  .projects-section {
    padding-top: 4.4rem;
  }

  .project-section .top-select-menu {
    display: flex;
    flex-direction: column;
    position: absolute;
    z-index: 1;
    width: 100%;
    gap: 0;
    max-height: 0;
    overflow: hidden;
    border-bottom-left-radius: 1rem;
    border-bottom-right-radius: 1rem;
    transition: max-height 0.3s;
    border: 0.05rem solid transparent;
  }

  .project-section .top-select-menu li a {
    width: 100%;
    display: inline-block;
    padding: 0 !important;
  }

  .project-section .top-select-menu.active {
    border: 0.05rem solid #e6e6e6;
    border-top: none;
  }
  

  .project-section .top-select-menu .select-btn {
    border-radius: 0;
    border: none;
    font-size: 2rem;
    padding-block: 1.2rem;
    padding-inline: 2rem;
  }
  .project-section .top-select-menu .select-btn.active {
    display: none;
  }

  .dropdown-icon {
    display: block;
    position: absolute;
    top: 51%;
    transform: translateY(-50%) rotate(180deg);
    right: 2.4rem;
    padding: 0;
    width: 2rem;
    height: 2rem;
    transition: all 0.3s;
  }

  .dropdown-icon img {
    width: 100%;
    height: 100%;
  }

  .dropdown-icon.active {
    transform: translateY(-50%) rotate(360deg);
  }

  .mobile-select-toggle {
    display: flex;
    justify-content: space-between;
    width: 100%;
    font-size: 14px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
  }

  .select-btn {
    cursor: pointer;
  }

  .project-section .top-select-menu .select-btn.active {
    background-color: #f8f8f8;
  }

  .selected-heading {
    display: block;
    border-radius: 1rem;
    padding-block: 1.2rem;
    background-color: #f5f5f5;
  }

  .selected-heading.active {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
  }
  .project-section .top-select-menu .select-btn a,
  .selected-heading {
    font-size: 1.8rem;
  }
}

@media screen and (min-width: 767px) {
  .project-cards .project-wrapper {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
  }

  .project-section .top-select-menu .select-btn {
    font-size: 1.4rem;
  }
}

@media (max-width: 575px) {
  .project-cards .project-wrapper {
    grid-template-columns: 1fr;
  }
}

@media screen and (min-width: 1199px) {
  .project-cards .project-wrapper {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 380px) {
  .project-section .top-select-menu .select-btn {
    font-size: 1.9rem;
  }
}
