/* ==========================================================================
   CLIENTS SECTION
   ========================================================================== */

.clients-section {
  min-width: 100vw !important;
  min-height: 100vh;
  height: fit-content;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding-top: 30px;
  padding-bottom: 30px;
}

.client-background-image-wrapper {
  width: 100%;
  height: 100%;
  background-image: url('/assets/homepage/clients-bg-min.webp');
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 40px 0;
}

.clients-container {
  position: relative;
  z-index: 2;
  width: 90%;
  height: 90%;
  max-width: 1400px;
  margin: 0 auto;
  background-color: black;
  display: flex;
  flex-direction: column;
}

.client-section-header {
  width: 90%;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 40px;
  flex-shrink: 0; /* Don't shrink */
}

.client-section-header-text {
  display: flex;
  flex-direction: column;
}

.clients-title {
  color: #f6d764;
  font-weight: 400;
  letter-spacing: 0.05em;
  margin: 0;
  position: relative;
  font-family: 'Korbin';
  font-weight: 600;
  font-style: italic;
  overflow: hidden;
}

.clients-subtitle {
  font-size: 1.25rem;
  line-height: 1.5;
  color: #e0e0e0;
  margin: 8px 0 0 0;
  overflow: hidden;
}

.testimonials-btn {
  background: #155374;
  color: white;
  border: 2px solid white;
  border-radius: 25px;
  padding: 12px 24px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.testimonials-btn:hover {
  background: #18628a;
  color: white;
  transform: translateY(-2px);
}

/* Clients Grid */
.clients-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(4, 1fr);
  gap: 0 40px;
  align-items: center;
  justify-items: center;
  flex: 1; /* Take remaining space */
  padding: 20px 0;
}

.client-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 30%;
  max-height: 150px;
  /* transition: transform 0.3s ease, opacity 0.3s ease; */
  opacity: 0;
}

.client-logo:hover {
  transform: scale(1.1);
  opacity: 1;
}

.client-logo img {
  max-width: 80%;
  max-height: 100%;
  object-fit: contain;
  filter: brightness(0) invert(1);
  transition: filter 0.3s ease;
}

.no-filter {
  filter: unset !important;
}

.client-logo:hover img {
  filter: brightness(0) invert(1) sepia(1) saturate(2) hue-rotate(200deg);
}

/* ==========================================================================
   RESPONSIVE BREAKPOINTS
   ========================================================================== */

/* Large Desktop (1921px+) */
@media (min-width: 1921px) {
  .clients-container {
    max-width: 1600px;
  }

  .clients-grid {
    gap: 0 60px;
  }

  .clients-subtitle {
    font-size: 1.5rem;
  }
}

/* Laptop (1367px - 1920px) */
@media (min-width: 1367px) and (max-width: 1920px) {
  .clients-container {
    width: 85%;
  }

  .clients-grid {
    gap: 0 40px;
  }

  .clients-subtitle {
    font-size: 1.25rem;
  }
}

/* Large Tablet (1025px - 1366px) */
@media (min-width: 1025px) and (max-width: 1366px) {
  .clients-container {
    width: 90%;
  }

  .clients-grid {
    gap: 0 30px;
  }

  .client-section-header {
    margin-bottom: 30px;
  }

  .clients-subtitle {
    font-size: 1.125rem;
  }
}

/* Small Tablet (769px - 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
  .clients-container {
    height: 640px;
  }
  .client-section-header {
    /* flex-direction: column; */
    text-align: left;
    margin-bottom: 30px;
    gap: 20px;
  }

  .client-section-header-text {
    flex-direction: column;
  }

  .clients-title {
    text-align: left;
  }

  .clients-subtitle {
    margin: 0;
    font-size: 1rem;
    text-align: left;
  }

  .clients-grid {
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(
      6,
      1fr
    ); /* 16 items ÷ 3 columns = 6 rows (rounded up) */
    gap: 0 20px;
  }

  /* .client-logo:last-child {
    display: none;
  } */
}

/* Large Mobile (481px - 768px) */
@media (min-width: 481px) and (max-width: 768px) {
  .clients-container {
    width: 95%;
    padding: 0 15px;
  }

  .client-section-header {
    /* flex-direction: column; */
    text-align: center;
    gap: 20px;
    margin-bottom: 25px;
  }

  .client-section-header-text {
    flex-direction: column;
  }

  .clients-title {
    text-align: left;
  }

  .clients-subtitle {
    font-size: 0.95rem;
    margin: 0;
    text-align: left;
  }

  .testimonials-btn {
    padding: 10px 20px;
    font-size: 0.9rem;
  }

  .clients-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(8, 1fr); /* 16 items ÷ 2 columns = 8 rows */
    gap: 0 15px;
  }
}

/* Small Mobile (320px - 480px) */
@media (max-width: 480px) {
  .clients-section {
    min-height: 50vh;
    height: 50vh;
  }
  .clients-container {
    width: 80%;
    padding: 0 10px;
  }

  .clients-mobile {
    margin-top: 0;
  }

  .testimonials-btn-tablet-up {
    display: none;
  }

  .client-background-image-wrapper {
  }

  .client-section-header {
    /* flex-direction: column; */
    text-align: center;
    gap: 15px;
    margin-bottom: 20px;
  }

  .clients-title {
    /* font-size: 1.8rem; */
    text-align: left;
  }

  .clients-subtitle {
    font-size: 0.9rem;
    margin: 0;
    text-align: left;
  }

  .testimonials-btn {
    padding: 8px 16px;
    font-size: 0.85rem;
  }

  .clients-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(8, 1fr); /* 16 items ÷ 2 columns = 8 rows */
    gap: 0 10px;
    width: 130px;
  }
}

/* Hover effects only on devices that support hover */
@media (hover: hover) {
  .client-logo:hover {
    transform: scale(1.1);
    opacity: 1;
    transition: transform 0.3s ease;
  }

  .client-logo:hover img {
    filter: brightness(0) invert(1) sepia(1) saturate(2) hue-rotate(200deg);
  }

  .testimonials-btn:hover {
    /* background: #4a9eff; */
    color: white;
    transform: translateY(-2px);
  }
}
