// Define color variables
$primary-color: #5abac6;
$accent-color: #35929e;
$dark-gray: #5e5e5e;
$white-color: #ffffff;
$hover-color: #5d959c;

// Hotels section

section.hotels {
  width: 100%;
  height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 0 10%;
  margin-top: 80px;
  gap: 40px;

  .title {
    position: relative;
    height: 40px;
    display: flex;
    justify-content: center;
    width: 100%;
    margin-top: 50px;

    &::before {
      content: "";
      width: 80%;
      height: 1px;
      background: $dark-gray;
      position: absolute;
      top: 15px;
    }

    h1 {
      font-size: 24px;
      color: $dark-gray;
      width: 320px;
      text-align: center;
      position: relative;
      background-color: $white-color;
    }

    .titleLine {
      width: 45%;
      height: 2px;
      border-radius: 3px;
      background-color: $dark-gray;
    }
  }

  .hotels {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    width: 100%;
    gap: 30px;
  }
}

// Room card styling
.roomCard {
  max-width: 400px;
  width: 100%;
  height: 235px;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  cursor: pointer;
  transition: 0.4s ease-in-out;

  img {
    width: 400px;
    height: 200px;
    transition: 0.4s ease-in-out;
    -o-object-fit: cover;
    object-fit: cover;
    transition: 0.4s ease-in-out;
  }

  .roomInfo {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 0;
    gap: 20px;
    transition: 0.4s ease-in-out;

    div {
      display: flex;
      align-items: center;
      justify-content: space-between;
      width: 100%;
      padding: 0 10px;

      span.roomName {
        color: $primary-color;
        font-weight: bold;
        font-size: 14px;
      }
    }

    button {
      transition: 0.4s ease-in-out;
      width: 100%;
      background-color: $primary-color;
      padding: 10px 0;
      border: 1px solid $accent-color;
      border-radius: 7px;
      text-shadow: 0 -1px 0 #50878e;
      color: $white-color;
      font-weight: bold;
      font-size: 16px;
      cursor: pointer;

      &:hover {
        background-color: $hover-color;
        border: 1px solid $accent-color;
      }
    }
  }

  &:hover {
    img {
      transform: translateY(-100%);
    }

    .roomInfo {
      transform: translateY(-200%);
    }

    button {
      transform: translateY(-20%);
    }
  }
}

// Media Queries
@media screen and (max-width: 900px) {
  section.hotels {
    .title h1 {
      margin: 0 5px;
    }
    .hotels {
      grid-template-columns: auto auto;
    }
  }
}

@media screen and (max-width: 768px) {
  section.hotels {
    padding: 0 5%;
  }
}

@media screen and (max-width: 650px) {
  section.hotels {
    .hotels {
      grid-template-columns: auto;
    }
  }
}

/*--------------------------------------------------------------
   Skeleton image placeholder for loading state
--------------------------------------------------------------*/
.skeleton-img {
  width: 400px;
  height: 200px;
  object-fit: cover;
  flex-shrink: 0;
}

.skeleton {
  opacity: 0.7;
  animation: skeleton-loading 1s linear infinite alternate;
  margin-bottom: 0.25rem;
  border: 0.125rem;
}

@keyframes skeleton-loading {
  0% {
    background-color: hsl(200, 20%, 70%);
  }
  100% {
    background-color: hsl(200, 20%, 95%);
  }
}
