/* ========================================

   BASE STYLES

   ======================================== */







html,
body {

  height: 100%;

  margin: 0;

  padding: 0;

  overscroll-behavior: contain;

  background-color: black;

  min-width: 320px;

  font-family: 'Noto Sans KR';

}


ul,
li {

  list-style: none;

  padding: 0;

  margin: 0;

}



ul {

  font-weight: bold;

}



h1 {

  font-size: 35px;

  font-weight: bold;

  margin-top: 5px;

}



hr {

  border: 1px solid rgba(13, 13, 13, 0.047);

}





/* ========================================

   LAYOUT CONTAINERS

   ======================================== */



.bg,

.bg-list,

.bg-page {

  width: 100%;
  min-height: 100%;


  margin: 0 auto;



  background: #ffffff;

  animation: breathing-gradient 4s ease-in-out infinite alternate;

  /* border-radius: 42px; */

  padding: 16px 16px 0 16px;

  box-sizing: border-box;

  display: flex;

  flex-direction: column;

  justify-content: space-between;

  text-align: center;

      padding-top: 66px;
    padding-bottom: 50px;

}

section#home {
    height: 75vh;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.main-list {

  flex-grow: 1;

  min-height: 0;

  display: flex;

  flex-direction: column;

  overflow-y: auto;

}
/* asset/style.css 수정 (예시) */
.main-list {
  flex-grow: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  /* ⬇️ 이 부분을 제거하거나 변경합니다. */
  /* overflow-y: auto; */ 
}



#list {

  margin-top: 8px;

  flex-grow: 1;



  padding-bottom: 16px;

}





/* ========================================

   COMPONENTS

   ======================================== */



/* Notification Box */

.notibox {

  max-width: 320px;

  margin: 8px auto;

  color: #444;

  background: #fff;

  border-radius: 8px;

  overflow: hidden;

  font-size: 12px;

  padding: 8px;

  display: none;

  justify-content: space-between;

  min-height: 20px;

  align-content: center;

}



.notibox i {

  padding: 3px;

  color: #aaa;

}



.notibox b {

  color: #aaa;

}



.notibox small {

  font-weight: bold;

  color: #aaa;

  padding: 1px 4px;

}



/* Bubble */

.bubble {

  max-width: 70%;

  display: inline-block;

  padding: 12px 18px;

  margin: 10px auto;

  background: white;

  border-radius: 40px;

  border: solid 1px #ececec;

  font-size: 12px;

  font-weight: normal;

  color: #333;

  line-height: 1.4;

}



/* Callout */

.callout {

  background: #f3f4fa;

  border-radius: 8px;

  padding: 12px;

  font-size: 14px;

  color: #333;

  font-weight: normal;

}



.row .callout {

  flex: 1;

}



.row .callout b {

  display: block;

}





/* ========================================

   HEADER & NAVIGATION

   ======================================== */
header{
position: fixed;
  top: 0;
  left: 0;
  /* ⚠️ 기존 padding-top: 8px; 대신, 안전 영역 높이 + 8px을 적용합니다. */
  padding-top: calc(8px + env(safe-area-inset-top, 30px)); 
  width: 100%;
  /* header의 배경색을 검은색으로 변경하여 상단 노치 영역을 덮습니다. */
  background: black; 
  z-index: 10; /* 상태바 위에 올라오도록 z-index를 10 이상으로 설정 */
}
/* 🚨 기존 header의 흰색 배경을 다시 살리고 싶다면, 
   header의 자식 요소(예: ul 또는 다른 div)에 흰색 배경을 적용해야 합니다. */
header ul{
  /* ul만 흰색 배경을 주어 header의 검은색 배경을 가립니다. */
  background: #ffffff; 
  padding-bottom: 12px;
  margin-top: 8px;
  padding-top: 8px;
  /* (필요시) ul의 너비를 제한하여 좌우 검은색이 보이도록 조정 */
}
header .mask-top{
  display: flex;
  justify-content: space-between;
  position: absolute;
  width: 100%;
  top: 16px;
  z-index: 0;
}


header li {

  font-size: 10px;

  font-weight: bold;

  color: #36363669;

}
header ul{
  padding-bottom: 12px;
}



.menu-icon-btn {

  position: fixed;

  right: 8px;

  top: 26px;

  padding: 9px 10px;

  border-radius: 50%;

  background: none;

  color: #3e414583;

  border: none;

  font-size: 16px;

  cursor: pointer;

}



.menu-icon-btn.hide {

  display: none;

}



.back-icon-btn {

  position: fixed;

  left: 8px;

  top: 26px;

  padding: 9px 10px;

  border-radius: 50%;

  background: none;

  color: #3e414583;

  border: none;

  font-size: 16px;

}





/* ========================================

   OVERLAY MENU

   ======================================== */



.overlay {
    position: fixed;
    top: 18px;
    right: 4px;
    /* height: 0; */
    z-index: 100;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-in-out;
}

/* 새로 추가: 메뉴가 열렸을 때 적용할 클래스 */
.overlay.open {
    /* 메뉴 컨텐츠의 최대 예상 높이보다 충분히 큰 값으로 설정 */
    /* 예를 들어, 메뉴 아이템이 5개이고 각각 50px 정도라고 가정하면 300px 이상 설정 */
    max-height: 600px; 
}

.overlay .closebtn {

  position: absolute;

  top: 9px;

  right: 8px;

  font-size: 20px;

  color: #ffffff;
  border-radius: 50px;
  padding: 2px 6px;
  text-decoration: none;

   background-color: rgba(0, 0, 0, 0.172);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);

}



.overlay-content {

  position: relative;

  top: 30%;

  width: 100%;

  text-align: center;

  margin-top: 54px;
  padding: 0 12px 38px 20px;

}


.overlay-content a {
    padding: 12px 16px;
    text-decoration: none;
    font-size: 16px;
    color: #ffffff;
    border-radius: 24px;
    margin-top: 8px;
    margin-right: 30px;
    display: block;
    transition: 0.3s;
    font-family: 'Noto Sans KR', sans-serif;
    font-weight: 500;

    /* 배경 투명도 조절 → 더 유리 느낌 */
    background: rgba(0, 0, 0, 0.15);

    /* 유리 질감 핵심 */
    backdrop-filter: blur(14px) saturate(180%);
    -webkit-backdrop-filter: blur(14px) saturate(180%);

    /* 글래스모피즘 스타일 경계 */
    border: 1px solid rgba(255, 255, 255, 0.25);

    /* 은은한 빛 반사 */
    box-shadow: 
       0 4px 12px rgb(111 119 132 / 32%), inset 0 1px 1px rgb(255 255 255 / 35%), inset 0 -1px 3px rgb(246 45 45 / 0%);

    /* 라이트 하이라이트(유리의 두께 느낌) */
    position: relative;
}



.overlay-content a:hover,

.overlay-content a:focus {

  color: #ffffff;
  background: rgba(0, 0, 0, 0.5);

}



@media screen and (max-height: 450px) {

  .overlay-content {

    margin-top: 15%;

  }

  .overlay-content a {

    font-size: 20px;

  }

  .overlay .closebtn {

    font-size: 40px;

    top: 15px;

    right: 35px;

  }

}





/* ========================================

   BUTTONS

   ======================================== */



/* Filter Buttons */

#filterButtons {

  display: flex;

  flex-wrap: nowrap;

  overflow-x: auto;

  overflow-y: hidden;

  padding: 8px 16px;

  scrollbar-width: none;

  -ms-overflow-style: none;

  mask-image: linear-gradient(to right,

      rgba(0, 0, 0, 0) 0%,

      rgba(0, 0, 0, 1) 5%,

      rgba(0, 0, 0, 1) 95%,

      rgba(0, 0, 0, 0) 100%);

  -webkit-mask-image: linear-gradient(to right,

      rgba(0, 0, 0, 0) 0%,

      rgba(0, 0, 0, 1) 5%,

      rgba(0, 0, 0, 1) 95%,

      rgba(0, 0, 0, 0) 100%);

}



#filterButtons::-webkit-scrollbar {

  display: none;

  width: 0;

  height: 0;

}



.filter-btn {

  background: #f4f4f4;

  color: #66666677;

  font-weight: bold;

  border: none;

  border-radius: 20px;

  padding: 8px 12px;

  font-size: 12px;

  cursor: pointer;

  transition: background-color 0.2s, color 0.2s, transform 0.1s;

  flex-shrink: 0;

  margin-right: 4px;

  margin-bottom: 0;

}



.filter-btn.active {

  background: #4a86f7;

  color: white;

  border-color: #4a86f7;

}



/* Tag Buttons */

.tag-container {

  display: flex;
  padding: 16px 0;
  flex-wrap: wrap;

  gap: 8px;

  justify-content: center;

}



.tag-btn {

  background: #eeeeee;

  color: #66666677;

  border: none;

  border-radius: 20px;

  padding: 8px 12px;

  font-size: 12px;

  cursor: pointer;

  transition: background-color 0.2s, color 0.2s, transform 0.1s;

  flex-shrink: 0;

  font-weight: bold;

}



.tag-btn.selected {

  background: #4a86f7;

  color: white;

  border-color: #4a86f7;

}



/* Next Button */

.nextBtn {

  text-align: left;

  display: flex;

  justify-content: flex-start;

  flex-direction: column;

  opacity: 0;

  transition: opacity 0.5s;

  padding: 16px;

  width: 80%;

  font-size: 14px;

  background: white;

  box-shadow: 1px 8px 8px #eee;

  border-radius: 24px;

  border: 1px solid #ddd;

  font-weight: bold;

}



.nextBtn span {

  display: block;

  font-weight: normal;

  color: #666;

}



.nextBtn .row i {

  margin-right: 6px;

  border-radius: 50%;

  margin-bottom: 8px;

}



/* Explore & Back Buttons */

.explore-btn,

.back-btn {

  opacity: 0;

  width: 100%;

}



.explore-btn {

  margin-bottom: 32px;

  background: #4a86f7;

  color: white;

  box-shadow: 0 4px 8px rgba(74, 134, 247, 0.3);

}



.explore-btn span {

  color: white;

}



.explore-btn .oneline {

  display: flex;

  justify-content: space-around;

}



.explore-btn .oneline .row {

  width: 100%;

}



.back-btn {

  box-shadow: none;

  background: #00000009;

  border: none;

}





/* ========================================

   FILTER SECTION

   ======================================== */



.custom-filter-section {

  display: flex;

  flex-direction: column;

  gap: 16px;

  padding: 0 16px;

  max-width: 420px;

  margin: 0 auto;

}



.hidden-fade {

  opacity: 0;

  max-height: 0;

  overflow: hidden;

  transition: opacity 0.4s, max-height 0.4s;

}



.visible-fade {

  opacity: 1;

  max-height: 500px;

}



.custom-filter-section.visible-fade {

  opacity: 1;

  max-height: 500px;

  animation: slideUpFadeIn 0.5s ease-out forwards;

}





/* ========================================

   CARDS

   ======================================== */



.card-image {

  height: 60%;

  width: 100%;

  overflow: hidden;

  position: relative;

}



.card-image img {

  width: 100%;

  height: 100%;

  object-fit: cover;

  display: block;

}



.card-content {

  flex-grow: 1;

  flex-basis: 20%;

  padding: 10px;

  box-sizing: border-box;

  text-align: left;

}



.card-title small {

  display: block;

  font-size: 12px;
  font-weight: normal;
  color: #ccc;

  width: 100%;

  text-align: right;

}





/* ========================================

   ITEM LISTS

   ======================================== */



.item {

  transition: opacity 0.5s ease, max-height 0.5s ease, margin 0.5s ease, padding 0.5s ease;

  overflow: hidden;

  max-height: 500px;

}



.hidden {

  opacity: 0 !important;

  max-height: 0 !important;

  margin-top: 0 !important;

  margin-bottom: 0 !important;

  padding-top: 0 !important;

  padding-bottom: 0 !important;

  border-bottom: none;

}



/* itemList (Grid Layout) */

#itemList {

  display: flex;

  flex-wrap: wrap;

  gap: 10px;

  padding: 0;

  justify-content: center;

  max-width: 650px;

  margin: 8px auto;

}



#itemList .item {

  width: calc(48% - 5px);

  list-style: none;

  display: block;

  background: #f4f4f4;

  min-height: 200px;

  height: 100%;

  border-radius: 12px;
  opacity: 1;
  transform: scale(1);
  transition: opacity 0.4s ease, transform 0.4s ease;
}
#itemList .item.hidden{
  opacity: 0;
  transform: scale(0.95);
}



#itemList .item span {
  display: block;
  font-weight: normal;

  font-size: 12px;

  white-space: nowrap;

  overflow: hidden;

  text-overflow: ellipsis;

  padding: 0 2px;

  color: rgba(97, 97, 97, 0.381);

}



#itemList .item p {

  font-size: 14px;

}



/* itemListBlog (Horizontal Layout) */

#itemListBlog {
  padding: 8px 0;
  flex-direction: column;

}



#itemListBlog .item {

  display: flex !important;

  flex-direction: row;

  align-items: center;

  justify-content: space-between;

  width: 100%;

  max-width: 420px;

  list-style: none;

  margin: 0 auto;
  margin-bottom: 10px;

  background: #f4f4f4;

  padding: 8px;

  box-sizing: border-box;

  border-radius: 12px;

}



#itemListBlog .item .card-image {

  border: 1px solid #ddd;

  width: 52px;

  min-width: 32px;

  height: 52px;

  object-fit: cover;

  object-position: center;

  border-radius: 8px;

  margin: 8px;

  align-self: flex-start;

}



#itemListBlog .item .card-content {

  flex-direction: column;

  flex-grow: 1;

  min-width: 0;

  padding: 0 8px;

  justify-content: space-between;

}



#itemListBlog .item .card-content .card-tags {

  display: inline-block;

  min-height: 44px;

  width: fit-content;

}



#itemListBlog .item .card-content .card-tags span {

  display: block;

  font-weight: bold;

}



#itemListBlog .item .card-content .card-title {

  margin-top: auto;

  justify-content: space-between;

}



#itemListBlog .item .card-content .card-tags .card-title {

  display: block;

  margin: 0;

  font-size: 14px;

  font-weight: normal;

  white-space: normal;

  overflow-wrap: break-word;

  word-break: break-word;

  line-height: 1.4;

  padding: 4px 0;

}



#itemListBlog .item .card-content small {

  font-size: 12px;

  font-weight: normal;

  text-align: right;

  display: block;

  color: #bbb;

  min-width: fit-content;

  margin-left: auto;

  padding: 0;

}



#itemListBlog .item .card-content .card-tags .card-title small {

  display: block;

  text-align: right;

}



/* itemListAbout (Image Background) */

#itemListAbout {

  max-width: 440px;
  margin: 0 auto;
  ;

}

#itemListAbout li {

  background: var(--img) center/cover no-repeat;

  width: 100%;

  display: flex;

  flex-direction: column;

  justify-content: flex-end;

  min-height: 470px;

  position: relative;

  margin-bottom: 10px;

  border-radius: 16px;

  overflow: hidden;

}



#itemListAbout li::after {

  content: "";

  position: absolute;

  top: 0;

  left: 0;

  width: 100%;

  height: 100%;

  z-index: 1;

  pointer-events: none;

  background: linear-gradient(to bottom,

      rgba(0, 0, 0, 0) 0%,

      rgba(0, 0, 0, 0.05) 50%,

      rgba(0, 0, 0, 0.5) 75%,

      rgba(0, 0, 0, 0.8) 100%);

}



#itemListAbout .card-content {

  position: relative;

  display: flex;

  flex-direction: column;

  justify-content: flex-end;

  z-index: 3;

  background: none;

  backdrop-filter: none;

  -webkit-backdrop-filter: none;

  color: white;

  border-radius: 0;

  padding: 20px;

  overflow: hidden;

  text-align: left;

}





#itemListAbout .card-content span,

#itemListAbout .card-content small {

  color: white;
  font-weight: bold;

  display: block;

}

#itemListAbout .card-content p {

  font-weight: normal;

}





/* ========================================

   PAGES LIST

   ======================================== */



.pages-list ul,

.pages-list li {

  height: 100%;

}



.pages-list .list-top .card-image img {

  border-radius: 8px;

  overflow: hidden;

}



.pages-list .list-top .card-content .card-tags span {

  font-size: 12px;

  color: #0000006a;

  font-weight: normal;

}



.pages-list .list-top .card-content .txt {

  font-size: 15px;

  font-weight: normal;

  line-height: 1.6;

}



.list-container .endtxt {

  font-size: 12px;

  color: #666666a2;

  padding: 24px;

  display: block;

}





/* ========================================

   UTILITY CLASSES

   ======================================== */



.flex {

  display: flex;

}



.row {

  flex-direction: row;

  gap: 8px;

  display: flex;

}



.bottom_gap {

  margin-bottom: 16px;

  max-width: 420px;

  margin: 0 auto;

}



.bottom_margin {

  margin-bottom: 24px;

}



.txt-title {

  text-align: left;

}



.txtinfo {

  font-size: 12px;

}



.blue {

  background: #e3eaf1 !important;

}



.wait {

  background: #f8e4e4;

  color: #e87a7a !important;

  border-radius: 16px;

  padding: 4px !important;

  position: absolute;

  top: 30px;

  left: 50%;

  transform: translate(-50%, -50%);

}





/* ========================================

   ANIMATIONS

   ======================================== */



.anim img {

  width: 40%;

}



.gifimg {

  width: 50%;

  border-radius: 16px;

  overflow: hidden;

  box-shadow: 1px 4px 14px #96a1d57c;

}



#anim {

  width: 50%;

  max-width: 200px;

  margin: 0 auto;

  text-align: center;

}
#anim h1{
  font-size: 24px;
}


#anim span {

  background: #ffffff56;

  /* border: 1px solid #ddd; */

  font-size: 10px;

  border-radius: 16px;

  padding: 8px 10px;

  font-weight: bold;

  color: #00000071;

}



#anim span b {

  color: #00000009;

}



#anim img {

  width: 100%;

  display: block;

  margin: 0 auto;

  animation: float 3s ease-in-out infinite;

}



#home svg {

  display: block;

  margin: 0 auto;

  

}



@keyframes float {

  0% {

    transform: translateY(0) rotate(0deg);

  }

  50% {

    transform: translateY(-10px) rotate(3deg);

  }

  100% {

    transform: translateY(0) rotate(0deg);

  }

}



@keyframes breathing-gradient {

  0% {

    background-position: 0% 0%;

  }

  100% {

    background-position: 0% 25%;

  }

}



@keyframes slideUpFadeIn {

  from {

    opacity: 0;

    transform: translateY(20px);

  }

  to {

    opacity: 1;

    transform: translateY(0);

  }

}





/* ========================================

   FOOTER

   ======================================== */

footer{
  position: fixed;
  bottom: 0;
  width: 100%;
  
  z-index: 1;
}
footer .mask-bottom{
  display: flex;
  justify-content: space-between;
  background: transparent;
}


footer p {
  background: #000;
  padding: 16px;
  
  font-size: 12px;

  color: rgba(255, 255, 255, 0.479);

  text-align: center;

  display: block;

  margin: 0 auto;

}

.reordering-toast {
    position: absolute; /* list-container 기준 */
    top: 120px; /* filterButtons 아래에 위치하도록 조정 */
    left: 50%;
    transform: translateX(-50%);
    
    /* 토스트 스타일 */
       background-color: rgba(0, 0, 0, 0.484);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);

    color: rgba(255, 255, 255, 0.775);
    padding: 10px 20px;
    border-radius: 24px;
    z-index: 1000; /* 다른 요소 위에 표시 */
    opacity: 0; /* 기본적으로 숨김 */
    visibility: hidden; /* 영역도 숨김 */
    transition: opacity 0.3s, visibility 0.3s;
    font-weight: 500;
    font-size: 12px;
}

/* 표시 상태 */
.reordering-toast.visible {
    opacity: 1;
    visibility: visible;
}


@media (min-width: 617px) {
  .main-list #itemList{
    max-width: 1200px;
   
  }
  .main-list #list .list-container #itemList .item{
      width: calc(33% - 5px);
    }
}

@media (min-width: 900px) {
  .main-list #list .list-container #itemList .item{
      width: calc(24% - 5px);
    }
}
