/* Loading */
.loading-con {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
  width: 100%;
  height: 100%;
  background: var(--primary-subtle);
  font-size: 24px;
}
.loading-con p {
  margin-bottom: 32px;
}
.loading-con p,
.loading-con p > span {
  font-size: var(--fs-2xl);
  font-weight: vaR(--fw-sb);
}
.loading-con p > span {
  color: var(--primary);
}
.loading-con .pan-loader {
  width: 180px;
  height: 180px;
}
.loading-con .loader {
  position: relative;
  top: 10%;
  left: 0;
  z-index: -1;
  width: 60%;
  height: 45%;
  border: 8px solid transparent;
  border-bottom: 8px solid var(--primary);
  border-radius: 50%;
  animation: loader 2s infinite;
  animation-timing-function: linear;
}
.loading-con .pan-container {
  display: flex;
  width: 100%;
  animation: pan 2s infinite;
}
.loading-con .pan {
  width: 60%;
  height: 24px;
  background-color: var(--dark-1);
  border-radius: 8px 8px 160px 160px;
}
.loading-con .handle {
  width: 40%;
  height: 10px;
  background-color: var(--dark-1);
  border-radius: 8px;
}
.loading-con .shadow {
  position: relative;
  top: 15%;
  left: 15%;
  width: 30%;
  height: 8px;
  background: var(--dark-3);
  border-radius: 20px;
  animation: shadow 2s infinite;
}

/* Banner */
.banner-con {
  width: 100%;
  max-width: 1104px;
  margin: 0 auto;
  padding-top: 48px;
}
.banner {
  position: relative;
  overflow: hidden;
  width: 100%;
  padding-top: 24.28%;
  border-radius: 8px;
  cursor: pointer;
}
.banner:hover img {
  transform: scale(1.02, 1.02);
}
.banner img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Roulette game */
.roulette-con {
  display: none;
  justify-content: center;
  align-items: center;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 2000;
  width: 100%;
  height: 100%;
}
.roulette-con.open {
  display: flex;
}
.roulette-con .modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
}
.roulette-modal {
  position: relative;
  z-index: 1020;
  width: 560px;
  margin: 15% auto;
  padding: 24px;
  border-radius: 8px;
  background-color: var(--primary-subtle);
  box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.2);
  transform: scale(0.7);
  opacity: 0;
  animation: popUp 0.3s ease-out forwards;
}
.roulette-modal .close-btn {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 32px;
  height: 32px;
  margin-left: auto;
}
.roulette-modal .close-btn > i {
  color: var(--dark-2);
  font-size: 28px;
}
.roulette-modal .close-btn:hover > i {
  color: var(--primary);
}
.roulette-modal .title {
  flex: 1;
  font-size: var(--fs-2xl);
  font-weight: var(--fw-sb);
  text-align: center;
}
.roulette-box {
  position: relative;
  width: 400px;
  height: 400px;
  margin: 40px auto 24px auto;
  border: 12px solid var(--primary);
  border-radius: 50%;
  background: var(--white);
}
.roulette-box .marker {
  position: absolute;
  top: -44px;
  left: 50%;
  z-index: 1000;
  transform: translateX(-50%);
  width: 40px;
  height: 60px;
  background-color: var(--primary);
  border-radius: 50% 50% 50% 50% / 35% 35% 65% 65%;
}
.roulette-box .marker::before {
  content: '';
  position: absolute;
  top: 10px;
  left: 11px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background-color: var(--white);
}
.roulette-box .roulette {
  position: relative;
  overflow: hidden;
  width: 100%;
  height: 100%;
  border-radius: 50%;
}
.roulette-box .roulette-item {
  position: absolute;
  bottom: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border: 0 solid transparent;
  border-top-width: 400px;
  transform-origin: 0 100%;
}
.roulette-box p {
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: 0;
  left: 0;
  transform: translateX(67px) translateY(-156px) rotateZ(109deg);
  overflow: hidden;
  width: 96px;
  height: 32px;
  text-align: center;
  transform-origin: 0 0;
}
.roulette-box p .label {
  display: -webkit-box;
  overflow: hidden;
  font-size: var(--fs-s);
  font-weight: var(--fw-m);
  line-height: 1.2;
  vertical-align: middle;
  line-clamp: 2;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.roulette-box .roulette-start {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 9999;
  transform: translate(-50%, -50%);
  width: 108px;
  height: 108px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--white);
  font-size: var(--fs-2xl);
  font-weight: var(--fw-sb);
  cursor: pointer;
}
.roulette-start:hover {
  color: var(--dark-1);
  box-shadow: 0 4px 12px 0 rgb(45 47 45 / 30%);
}
.roulette-reset {
  position: absolute;
  top: 144px;
  right: 64px;
}
.roulette-reset > i {
  color: var(--primary);
  font-size: 32px;
}
.roulette-reset:hover > i {
  color: var(--dark-1);
}
.roulette-result {
  display: none;
  justify-content: space-between;
  align-items: center;
  position: relative;
  overflow: hidden;
  height: 112px;
  font-size: var(--fs-l);
  font-weight: var(--fw-m);
  border-radius: 8px;
  background-color: var(--white);
  box-shadow: 0 4px 12px 0 rgb(45 47 45 / 10%);
}
.roulette-result.visible {
  display: flex;
}
.roulette-result .result-img {
  width: 30%;
  height: 100%;
}
.result-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.roulette-result .result-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex: 1;
  height: 100%;
  padding: 16px 24px;
}
.result-content p {
  font-weight: var(--fw-m);
}
.go-to-recipe {
  flex: 0 0 auto;
  width: fit-content;
  margin-left: auto;
  padding: 8px 12px;
  border-radius: 4px;
  background-color: var(--primary);
  color: var(--white);
  font-size: var(--fs-s);
}
.go-to-recipe:hover {
  background-color: var(--primary-light);
}

/* Main */
main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 64px 80px 0 80px;
}

.search-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-bottom: 56px;
}
.search-form {
  position: relative;
}
.search-form input {
  width: 560px;
  height: 52px;
  padding: 12px 20px;
  border: 1px solid var(--dark-3);
  border-radius: 8px;
  outline: none;
  box-shadow: 0 4px 12px 0 rgb(0 0 0 / 10%);
}
.search-form input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 4px 2px var(--primary-subtle);
}
.search-form input::placeholder {
  color: var(--dark-3);
}
.search-wrap button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 52px;
  height: 52px;
  border-radius: 8px;
  background-color: var(--primary);
  box-shadow: 0 4px 12px 0 rgb(0 0 0 / 10%);
}
.search-wrap button:hover {
  background-color: var(--primary-light);
}
.search-wrap button i {
  color: var(--white);
  font-size: 22px;
}
.search-list {
  display: none;
  flex-direction: column;
  position: absolute;
  top: 64px;
  z-index: 1000;
  overflow: auto;
  width: 100%;
  max-height: 280px;
  padding: 16px;
  background-color: var(--white);
  box-shadow: 0 4px 12px 0 rgb(0 0 0 / 10%);
}
.search-list.visible {
  display: flex;
}
.search-list::-webkit-scrollbar {
  width: 12px;
  background-color: var(--primary-subtle);
}
.search-list::-webkit-scrollbar-thumb {
  border-radius: 8px;
  background: var(--primary);
}
.search-list li {
  padding: 12px 8px;
  border-radius: 4px;
  cursor: pointer;
}
.search-list li:hover {
  background-color: var(--dark-4);
}

/* Section: Category */
.category-con {
  margin-bottom: 80px;
  text-align: center;
}
.category-con h2 {
  margin-bottom: 32px;
}
.category-con ul {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 32px;
}
.category-con ul li {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 12px;
  width: 120px;
  height: 120px;
  border: 2px solid var(--primary);
  border-radius: 50%;
  background-color: var(--white);
  cursor: pointer;
}
.category-con ul li:hover {
  background-color: var(--primary-subtle);
}
.category-con ul li.active {
  background-color: var(--primary-subtle);
}
.category-con ul li img {
  width: 48px;
  height: 48px;
}
.category-con ul li img svg {
  color: var(--white);
}
.category-con ul li span {
  font-weight: var(--fw-m);
}

/* Section: card list */
.cards-con {
  position: relative;
  padding-bottom: 120px;
  min-height: 1200px;
}
.cards-con .circle-loader {
  display: none;
  justify-content: center;
  align-items: center;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1100;
  width: 100%;
  min-height: 800px;
  background-color: var(--white);
}
.cards-con .spinner {
  position: relative;
  animation: rotator 1.4s linear infinite;
}
.cards-con .path {
  stroke: var(--primary);
  stroke-dasharray: 187;
  stroke-dashoffset: 0;
  transform-origin: center;
  animation: dash 1.4s ease-in-out infinite;
}

.cards-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  width: 100%;
  margin-bottom: 32px;
}
.cards-top p,
.cards-top span {
  font-size: var(--fs-xl);
}
.cards-top p > span {
  color: var(--primary);
  font-weight: var(--fw-m);
}
.cards-top .fridge-btn {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 48px;
  height: 48px;
  border-radius: 8px;
  background-color: var(--primary);
}
.cards-top .fridge-btn:hover {
  background-color: var(--primary-light);
}

.search-results {
  grid-column: 1 / -1;
  margin-bottom: 24px;
  font-size: var(--fs-2xl);
  font-weight: var(--fw-m);
  text-align: center;
}
.search-results > span {
  font-size: var(--fs-2xl);
  font-weight: var(--fw-m);
  color: var(--primary);
}
.cards-con ul {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
  position: relative;
  min-height: 400px;
  margin-bottom: 64px;
}
.cards-con ul .no-cards {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: absolute;
  z-index: 900;
  width: 100%;
  min-height: 800px;
  background-color: var(--white);
}
.cards-con ul .no-cards p,
.cards-con ul .no-cards span {
  font-size: var(--fs-2xl);
  font-weight: var(--fw-m);
}
.cards-con ul .no-cards p {
  margin-bottom: 32px;
}
.cards-con ul .no-cards span {
  color: var(--primary);
}
.cards-con ul .no-cards img {
  width: 180px;
  height: 180px;
}
.recipe-card {
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  background-color: var(--white);
  box-shadow: 0 8px 16px 0 rgb(45 47 45 / 10%);
  transition: all 0.4s ease;
}
.recipe-card:hover {
  transform: scale(1.05, 1.05);
  box-shadow: 0 8px 16px 0 rgb(45 47 45 / 15%);
}
.recipe-card .bookmark-btn {
  display: flex;
  justify-content: center;
  align-items: center;
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 1000;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: rgb(255 255 255 / 70%);
  box-shadow: 0 4px 12px 0 rgb(45 47 45 / 10%);
}
.recipe-card .bookmark-btn > i {
  color: var(--dark-3);
  font-size: 20px;
}
.recipe-card .bookmark-btn.active > i {
  color: var(--primary);
  font-size: 18px;
}
.recipe-card > a {
  position: absolute;
  inset: 0;
}
.recipe-card .recipe-img {
  position: relative;
  width: 100%;
  padding-top: 66.67%;
}
.recipe-card .recipe-img img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.recipe-card .card-content {
  display: flex; /* details 아래 고정 위해 필요한 속성 */
  flex-direction: column; /* details 아래 고정 위해 필요한 속성 */
  flex-grow: 1;
  gap: 8px;
  padding: 24px;
}
.card-content p {
  overflow: hidden;
  font-size: var(--fs-xl);
  font-weight: var(--fw-sb);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.card-content .recipe-details {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto; /* 같은 row의 card title이 두 줄인 경우, details를 맨 아래 고정 */
}
.card-content .recipe-details .category-tag {
  width: fit-content;
  padding: 8px 16px;
  border-radius: 8px;
  background-color: var(--primary);
  color: var(--white);
  font-size: var(--fs-s);
}

.pagination {
  display: flex;
  gap: 16px;
  width: fit-content;
  margin: 0 auto;
}
.pagination.hidden {
  display: none;
}
.pagination button {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}
.pagination button.active {
  background-color: var(--primary);
  color: var(--white);
}
.pagination button:hover:not(.prev-btn, .next-btn, .active) {
  background-color: var(--dark-3);
}
.pagination .prev-btn,
.pagination .next-btn {
  background: none;
}
.pagination .prev-btn:hover > i,
.pagination .next-btn:hover > i {
  color: var(--primary);
}
.pagination .page-num-btns {
  display: flex;
  gap: 16px;
}

@keyframes loader {
  0% {
    width: 10%;
    transform: rotate(0deg);
  }
  10% {
    left: 0%;
    transform: rotate(0deg);
  }
  20% {
    width: 0%;
    left: 20%;
  }
  30% {
    width: 30%;
  }
  50% {
    width: 35%;
    left: 15%;
  }
  70% {
    width: 35%;
    left: 20%;
    transform: rotate(240deg);
  }
  90% {
    width: 30%;
    left: 20%;
  }
  100% {
    width: 2%;
    left: 25%;
    transform: rotate(360deg);
  }
}

@keyframes pan {
  0% {
    transform: rotate(0deg);
    transform-origin: top right;
  }
  10% {
    transform: rotate(-2deg);
    transform-origin: top right;
  }
  50% {
    transform: rotate(15deg);
  }
  100% {
    transform: rotate(0deg);
  }
}

@keyframes shadow {
  0% {
    width: 30%;
  }
  50% {
    width: 40%;
    left: 20px;
  }
  100% {
    width: 30%;
  }
}
