* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}


html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: "Roboto", sans-serif;
  }
  html {
    scroll-behavior: smooth;
  }
/* BGM */
.music{
  text-align: right;
}
body{
    background: url("newcelestial.jpg");
    background-color: black;
    background-size: cover;
    background-position: center bottom;
    background-attachment: fixed;
    background-repeat: no-repeat;
  }
  @media (max-width: 600px) {
    body {
      background-image: none;
      background-color: #15122D;
    }  
  }

  
  /* Menu */
  .topnav {
    background-color: transparent;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 50px;
  }
  .topnav a {
    color: #f2f2f2;
    text-align: center;
    padding: 10px 16px;
    text-decoration: none;
    font-size: 17px;
    display: inline-block;

  border: 2px solid #f2f2f2; 
  border-radius: 20px;       
  margin: 0 8px;             
  transition: background-color 0.3s ease, color 0.3s ease;
  }
  .topnav a:hover {
    background-color: #ddd;
    color: black;
  }
  .topnav a.active {
    background-color: #7b86d5;
    color: white;
  }
  .topnav .icon {
    display: none;
  }


@media (max-width: 600px) {
  .topnav {
    flex-direction: column;
    margin-top: 20px;
  }
  .topnav a {
    padding: 8px 12px;
    font-size: 14px;
    margin: 6px 0;
    width: 60%;        
    box-sizing: border-box;
  }
}


/* search  */

.search-container {
  display: flex;
  align-items: center;
}

#searchInput {
  width: 180px;
  padding: 0px 10px;
  height: 30px;
  border-radius: 20px;
  border: 2px solid #f2f2f2;
  border-right: none;
  font-size: 14px;
  color: black;
  box-sizing: border-box;

}

#searchInput::placeholder {
  color: #999;
}

.search-container button {
  box-sizing: border-box;
  padding: 5px;
  border-radius: 50px;
  border: 1.5px solid #f2f2f2;
  background-color: #7b86d5;
  color: white;
  font-size: 14px;
  cursor: pointer;
  border-left: none;
  transition: background-color 0.3s ease; 
}

.search-container button:hover {
  background-color: #5a66b3;
}
  /* Contact Us Form */
.form-container{
    font-family: arial;
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.2); 
    backdrop-filter: blur(20px);
    box-shadow: 0 0 10px rgba(39, 39, 39, 0.2);
    border-radius: 10px;
    color: #fff;
    padding: 20px;
    width: 90vw;
    max-width: 300px;
    margin-top: 0px;
    margin-right: 0px;
    margin-left: auto; 
    text-align: center;  
    position: fixed;
    bottom: 20px;
    right: 50px;
    z-index: 1000;
  }
  
  label{
    margin: 0 0 5px 0;
    color: white;
    font-weight: inherit;
  }

  .form-group{
    text-align: left;
    margin-left: 20px;
  }
  
  input{
    width: 100%;
    max-width: 255px;
    box-sizing: border-box;
    padding: 10px;
    margin-bottom: 5px;
    border-radius: 14px;
    background-color: rgba(255, 255, 255, 0.95);
    color: black;
  }
  
  textarea{
    width: 100%;
    max-width: 255px;
    box-sizing: border-box;
    padding: 10px;
    margin-bottom: 5px;
    border-radius: 10px;
  }
  
  button{
    background-color: pink;
    font-size: 17px;
    border-radius: 7px;
    padding: 5px 10px;
  }
  
  .button-wrapper{
    display: flex;
    justify-content: center;
  }
  
  button:hover{
    background-color: orange;
    cursor: grab;
  }
/* Contact form toggle button */
#contactForm.minimized > *:not(.toggle-wrapper) {
  display: none;
}

/* Smaller toggle button */
.minimize-btn {
  border: none;
  background: none;
  color: #7b86d5;       
  font-size: 28px;     
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: 10px;
  right: 10px;
  user-select: none;
  transition: color 0.3s ease;
}

.minimize-btn:hover {
  color: #5a66b3;
}

  .minimize-btn::before {
    content: var(--icon-content, "\f077");
    font-family: "FontAwesome";
  }

  #toggle-label {
    display: none;
  }
  
  #contactForm.minimized #toggle-label {
    display: inline;
  }
  

 /* Books*/
 .color-grid {
  display: flex;
  flex-wrap: wrap;       
  justify-content: flex-start; 
  gap: 40px;            
  margin-top: 100px;
  padding: 0 10%;
}

@media (max-width: 600px) {
  .color-grid {
    justify-content: center; 
    padding: 0 2%;           
    gap: 15px;
  }
}
  .card-link {
    text-decoration: none;
    color: inherit;
    display: block;
    height: 100%;
    cursor: pointer;
  }
  .flip-card {
    background-color: transparent;
    width: 200px;          
    height: 300px;         
    perspective: 1000px; 
    flex-shrink: 0;        
  }
  
  
  .flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.8s;
    transform-style: preserve-3d;
  }
  

  .flip-card:hover .flip-card-inner {
    transform: rotateY(180deg);
  }

.flip-card.flipped .flip-card-inner {
  transform: rotateY(180deg);
}


  .flip-card-front, .flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 10px;
    overflow: hidden;
  }
  
  

  .flip-card-front img.color-box {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
  }
  

  .flip-card-back {
    background-color: #ebe8e8;
    color: #333;
    transform: rotateY(180deg);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1em;
    font-size: 0.9rem;
    box-sizing: border-box;
    border-radius: 10px;
  }
  


  .book-box{
    width: 200px;
    height: 300px;
    border-radius: 10px;
    object-fit: cover;
  }


  @media (max-width: 768px) {
    .page-wrapper {
      flex-direction: column;
      padding: 20px 20px 20px 20px;
      gap: 20px;
    }
  }
  @media screen and (max-width: 768px) {
    .flip-card {
      width: 150px;  
      height: 210px; 
    }
  
    .flip-card-front img.book-box {
      width: 100%;
      height: 100%;
      object-fit: contain; 
    }
  }

/* footer */
.page-footer {
  background-color: #222;
  color: #eee;
  text-align: center;
  padding: 20px 10px;
  position: relative; 
  width: 100%;
  margin-top: 50px;
  font-size: 14px;
}

/* MOBILE + LANDSCAPE RESPONSIVE DESIGN */
@media (max-width: 768px), (orientation: landscape) and (max-height: 480px) {
  /* CONTACT FORM POSITIONING & MINIMIZED STYLE */
  .form-container {
    right: 0;
    bottom: 80px;
    position: fixed;
    border-radius: 8px 0 0 8px;
  }

  .form-container.minimized {
    width: 120px;
    height: 50px;
    padding: 0 10px;
    overflow: hidden;
    cursor: pointer;
    border-radius: 8px 0 0 8px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* Toggle button and label wrapper */
  .form-container.minimized .toggle-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 100%;
  }

  /* Contact Us label */
  .form-container.minimized .toggle-wrapper span {
    font-size: 13px;
    font-weight: 600;
    color: white;
    display: inline-block;
    line-height: 1;
  }

  /* Arrow Button */
  .form-container.minimized .minimize-btn {
    font-size: 18px;
    color: #7b86d5;
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    cursor: pointer;
    display: inline-block;
    line-height: 1;
  }

  .form-container.minimized .minimize-btn::before {
    content: "<";
    line-height: 1;
  }

  /* Hide full form and header when minimized */
  .form-container.minimized form,
  .form-container.minimized h2 {
    display: none;
  }

  /* Remove background from toggle button when expanded */
  .form-container:not(.minimized) .minimize-btn {
    background: none !important;
  }

  /* Body background override */
  body {
    background-image: none;
    background-color: #15122D;
  }

  /* TOP NAVIGATION */
  .topnav {
    flex-direction: column;
    margin-top: 20px;
  }

  .topnav a {
    padding: 8px 12px;
    font-size: 14px;
    margin: 6px 0;
    width: 60%;
    box-sizing: border-box;
  }

  /* BOOK GRID & CARDS */
  .color-grid {
    justify-content: center;
    padding: 0 2%;
    gap: 15px;
  }

  .flip-card {
    width: 150px;
    height: 210px;
  }

  .flip-card-front img.book-box {
    object-fit: contain;
    width: 100%;
    height: 100%;
  }
}
