/* 🔥 LOADER FULL SCREEN */


/* hide state */
.loader.hide {
  opacity: 0;
  visibility: hidden;
}

/* ✅ LOGO */
.logo-container {
  display: flex;
  justify-content: center;
  align-items: center;
}

.logo-container img {
  width: 180px;
  max-width: 80%;
  animation: logoFade 2s ease-in-out infinite;
}

/* 🔥 LOGO ANIMATION (FIXED) */
@keyframes logoFade {
  0% {
    opacity: 0.6;
    transform: scale(0.95);
  }
  50% {
    opacity: 1;
    transform: scale(1.05);
  }
  100% {
    opacity: 0.6;
    transform: scale(0.95);
  }
}

/* 📚 BOOK WRAPPER */
.bookshelf_wrapper {
  position: relative;
  transform: scale(1);
}

.books_list {
  margin: 0 auto;
  width: 300px;
  padding: 0;
}

/* 📚 BOOK */
.book_item {
  position: absolute;
  top: -120px;
  list-style: none;
  width: 40px;
  height: 120px;

  opacity: 0;
  background-color: #1e6cc7;
  border: 5px solid white;

  transform-origin: bottom left;
  transform: translateX(300px);

  animation: travel 2500ms linear infinite;
}

/* VARIANTS */
.first {
  top: -140px;
  height: 140px;
}

.first::before,
.first::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 5px;
  background: white;
}
.first::before { top: 10px; }
.first::after { bottom: 10px; }

.second::before,
.second::after,
.fifth::before,
.fifth::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 17px;
  border-top: 5px solid white;
  border-bottom: 5px solid white;
}
.second::before,
.fifth::before { top: 10px; }
.second::after,
.fifth::after { bottom: 10px; }

.third::before,
.third::after {
  content: '';
  position: absolute;
  left: 9px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 5px solid white;
}
.third::before { top: 10px; }
.third::after { bottom: 10px; }

.fourth {
  top: -130px;
  height: 130px;
}

.fourth::before {
  content: '';
  position: absolute;
  top: 46px;
  width: 100%;
  height: 17px;
  border-top: 5px solid white;
  border-bottom: 5px solid white;
}

.fifth {
  top: -100px;
  height: 100px;
}

.sixth {
  top: -140px;
  height: 140px;
}

.sixth::before {
  content: '';
  position: absolute;
  bottom: 31px;
  width: 100%;
  height: 5px;
  background: white;
}




.loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: #f5f6f7;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 30px;
  z-index: 999999;
  transition: opacity 0.6s ease;
}

.sixth::after {
  content: '';
  position: absolute;
  bottom: 10px;
  left: 9px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 5px solid white;
}

/* ⏱️ DELAYS */
.book_item:nth-child(2) { animation-delay: 400ms; }
.book_item:nth-child(3) { animation-delay: 800ms; }
.book_item:nth-child(4) { animation-delay: 1200ms; }
.book_item:nth-child(5) { animation-delay: 1600ms; }
.book_item:nth-child(6) { animation-delay: 2000ms; }

/* 📚 SHELF */
.shelf {
  width: 300px;
  height: 5px;
  background: white;
  margin: 5px auto;
}

/* 🔥 ANIMATION */
@keyframes travel {
  0% {
    opacity: 0;
    transform: translateX(300px) rotate(0);
  }
  10% {
    opacity: 1;
    transform: translateX(270px);
  }
  50% {
    transform: translateX(150px) rotate(-45deg);
  }
  80% {
    opacity: 1;
    transform: translateX(50px) rotate(-90deg);
  }
  100% {
    opacity: 0;
    transform: translateX(0px) rotate(-90deg);
  }
}

/* 📱 PERFECT MOBILE FIX */
@media (max-width: 600px) {

  /* Center everything properly */
  .loader {
    gap: 18px;
    padding: 20px;
  }

  /* Logo */
  .logo-container img {
    width: 130px;
    max-width: 75%;
  }

  /* Scale whole animation instead of breaking sizes */
  .bookshelf_wrapper {
    transform: scale(0.7);
    transform-origin: center;
  }

  /* Keep original proportions (IMPORTANT FIX) */
  .books_list {
    width: 300px; /* don't shrink manually */
  }

  .book_item {
    width: 40px;
    height: 120px;
    border-width: 4px;
  }

  /* Adjust positions slightly for balance */
  .first {
    height: 140px;
    top: -130px;
  }

  .fourth {
    height: 130px;
    top: -120px;
  }

  .fifth {
    height: 100px;
    top: -95px;
  }

  .sixth {
    height: 140px;
    top: -130px;
  }

  /* Shelf */
  .shelf {
    width: 300px;
    height: 4px;
  }
}