.custom-app-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-family: Arial, Helvetica, sans-serif;
  background: #f3f4f6;
  position: relative;
  overflow: hidden;
  padding: 20px;
  gap: 2rem;
}

.custom-app-options {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  justify-content: center;
  gap: 10px;
  width: 100%;
  max-width: 1200px;
  height: 400px;
}

.custom-app-option {
  position: relative;
  flex: 1;
  background-size: auto 120%;
  background-position: center;
  background-repeat: no-repeat;
  border-radius: 20px;
  overflow: hidden;
  transition: flex 0.5s ease, background-size 0.5s ease, border-radius 0.5s ease;
  min-width: 60px;
}

.custom-app-shadow {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 100%;
  width: 100%;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0));
}

.custom-app-label {
  position: absolute;
  bottom: 20px;
  left: 20px;
  color: #fff;
  font-size: 24px;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.4s ease;
  pointer-events: none;
}

.custom-app-option:hover {
  flex: 4;
  background-size: auto 100%;
  border-radius: 30px;
}

.custom-app-option:hover .custom-app-label {
  opacity: 1;
  transform: translateY(0);
}

/* Responsive */
@media screen and (max-width: 768px) {
  .custom-app-options {
    flex-wrap: wrap;
    height: auto;
  }

  .custom-app-option {
    flex: 1 1 45%;
    height: 200px;
  }

  .custom-app-option:hover {
    flex: 1 1 90%;
  }
}

@media screen and (max-width: 480px) {
  .custom-app-option {
    flex: 1 1 100%;
  }
}

/* ========== KEY LOGIC STARTS HERE ========== */

/* Default active (first) */
.custom-app-option--default-active {
  flex: 4;
  background-size: auto 100%;
  border-radius: 30px;
}

.custom-app-option--default-active .custom-app-label {
  opacity: 1;
  transform: translateY(0);
}

/* Collapse default-active when any hover occurs */
.custom-app-options:hover .custom-app-option--default-active {
  flex: 1 !important;
  background-size: auto 120%;
  border-radius: 20px;
}

.custom-app-options:hover .custom-app-option--default-active .custom-app-label {
  opacity: 0;
  transform: translateY(10px);
}
