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


:root {
    --clr-purple: #363062;
    --clr-purple-dark: #211e3c;
    --clr--purple-blue: #435585;
    --clr--purple-light: #818FB4;
    --clr-creme: #F5E8C7;
    --clr-red-dark: #ad1414;
    --clr-red: #ff6b6b;
}

html, body {
    font-family: "Inter", "Roboto", "Helvetica Neue", Arial, sans-serif;
    line-height: 1.5;
    color: var(--clr-purple-dark);
    background-color: var(--clr--purple-blue);

}

img {
    display: block;
    max-width: 100%;
}

input, button, textarea, select {
    font: inherit;
}

a {
    text-decoration: none;
}

ul, ol {
    list-style: none;
}


header {
    box-shadow: 0 2px 5px -5px var(--clr-creme);
}
nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4em;
    padding-bottom: .3em;
    margin: 1em 4em 2em 4em;

}

.logoImg {
    width: 10em;
}


.navLists {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.listBtn {
    display: flex;
    justify-content: center;
    align-items: center;
    background: transparent;
    border: none;
    cursor: pointer;
    gap: .3em;
   
}

.listBtn img.heartImg {
  width: 1.8rem;
  
}
.listDropdown:last-child .listBtn img {
  width: 2.3rem;
 
}

.listBtn span {
    font-weight: 500;
    color: var(--clr-creme);
    align-self: center;
}



.dropdownMenu {
  position: absolute;
  top: 100%;
  left: 0;
  background: white;
  border: 1px solid #ddd;
  border-radius: 6px;
  box-shadow: 0 6px 18px rgba(0,0,0,.1);
  padding: 0.5rem;
  width: 14em;
  z-index: 100;
}

.dropdownMenu ul {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 16em;
  overflow-y: auto;
}

.dropdownMenu li {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .4rem;
  border-radius: 6px;
}

.dropdownMenu li img {
  width: 3em;
  height: 4em;
  object-fit: cover;
  border-radius: 4px;
}

.dropdownMenu p {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--clr-purple);
}



.listDropdown {
  position: relative;
}

.main {
    display: flex;
}

.wrapper {
    display: flex;
    flex-direction: column;
    max-width: 100%;
    align-items: center;
    justify-content: center;
     
}

.loading-dots {
  font-size: 2.1rem;
  font-weight: 600;
  text-align: center;
  color: var(--clr-red);
}

.loading-dots .dots::after {
  content: "...";
  animation: dotsAnimation 1s steps(3, end) infinite;
}

@keyframes dotsAnimation {
  0%   { content: ""; }
  33%  { content: "."; }
  66%  { content: ".."; }
  100% { content: "..."; }
}


.search-cont {
    width: 100%;
    max-width: 50em;
    margin: 1em auto;
    position: relative;
}

.search-cont input {
    width: 100%;
    padding: .5em 1em;
    border: 2px solid #ccc;
    border-radius: 30px;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    color: var(--clr-purple-dark);
    text-indent: 1.5em;
}

.search-cont input::placeholder {
    color: #999;
}

.search-cont input:focus {
    border-color: #7f00ff; /* your purple-blue color */
    box-shadow: 0 4px 8px rgba(127,0,255,0.2);
}

.search-cont i {
    position: absolute;
    left: 1em;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1rem;
    color: #999;
}

.cards {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.searchResults {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.resultsCont {
    display: flex;
    gap: 1.3em;
    flex-wrap: wrap;
    justify-content: center;
    overflow: hidden;
    margin-bottom: 2em;
}

.divider {
    width: 97%;
    height: 0.01rem;
    background-color: var(--clr-creme);
}

.categoryCollection { 
    text-align: center;
    margin: 1em 0;
    position: relative;
}

.title {
    display: inline-block;
    position: relative;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--clr-creme);
}


.title::before,
.title::after {
    content: "";
    position: absolute;
    top: 50%;
    width: 5em;
    height: 1px;
    background: var(--clr-creme); 
    transform: translateY(-50%);
}

 .title::before {
    left: -5.3em; /* space between line and text */
}

.title::after {
    right: -5.3em;
}

.collectionCont {
    display: flex;
    gap: 1.3em;
    flex-wrap: wrap;
    justify-content: center;
    overflow: hidden;
    padding: 1em;

}

.categoriesCont {
    display: flex;
    gap: .2em;
    margin-bottom: .4em;
    margin-top: .4em;
    
}

.bookCard {
    display: flex;
    flex-direction: column;
    gap: 20px;
    border: 1px solid #ddd;
    border-radius: 10px;
    padding: 10px;
    background-color: #fff;
    width: 24rem;
    height: 24rem;
    align-items: flex-start;
    text-align: left;
    position: relative;
}

.bookCard:hover {
    box-shadow: 2px 2px 10px var(--clr-creme),
                2px 2px 10px var(--clr-creme);
}

.bookInfo {
    display: flex;
    gap: 10px;
}

.bookCover {
    max-width: 150px;
    border-radius: 5px;
    object-fit: cover;
}

.bookMetaLeft {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.bookMetaRight {
    display: flex;
    flex-direction: column;
    overflow-wrap: break-word;

}

.titleHeart {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    max-width: 100%;
}

.titleHeart i {
    cursor: pointer;
}
  
.bookTitle {
    font-size: 1.2rem;
    font-weight: bold;
    text-wrap: wrap;    
    line-height: 1.2;
    color: var(--clr-purple);
    max-width: 18ch;
}

.favBtn {
    border: none;
    background-color: transparent;
}

.bookAuthorPublisher {
    font-size: .9rem;
    text-wrap: wrap;
    overflow: hidden;
    max-width: 30ch;
    color: gray;
    line-height: 1.3;
    margin-top: .3em;
    margin-bottom: .3em;
}

.bookCategory {
    padding: 0 .6em ;
    border: 1px solid var(--clr-purple-dark);
    border-radius: 1em;
    font-size: .7rem;
}

.bookRating {
    font-size: 1em;
    color: var(--clr-red-dark);
    margin-top: .3em;
}

.bookDescription {
    font-size: .9rem;
    line-height: 1.2;
    font-style: italic;
    margin-top: .4em;
    margin-bottom: .4em;
    max-width: 20em;
    text-align: justify;
    color: var(--clr--purple-blue);
}

.languagePagesPreview {
    display: flex;
    flex-direction: column;
    font-size: .8em;
    gap: 2px;
}

.languagePages {
    display: flex;
    gap: .5em;
}

.languagePagesPreview div {
    max-width: 20ch;
    text-wrap: wrap;
}

.languagePagesPreview div a {
    color: var(--clr-purple-dark);
    font-weight: bold;
}

.languagePagesPreview div a:hover {
    color: var(--clr-red-dark);
}


.wantToRead {
    font-size: .8em;
    font-weight: bold;
    align-self: center;
    background-color: transparent;
    border: 2px solid var(--clr--purple-blue);
    border-radius: 4em;
    width: 52%;
    padding: .5em 0;
    color: var(--clr--purple-blue);
    cursor: pointer;
    

    position: absolute;
    bottom: 5%;
}

.wantToRead:hover {
    color: var(--clr-red-dark);
    box-shadow: 1px 1px 10px var(--clr--purple-blue);
}



/* Footer */
footer {
    color: var(--clr-creme);       
    font-size: 1rem;
    text-align: center;
    box-shadow: 0 -2px 5px -5px var(--clr-creme);
   
}

footer .wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 1.5em;

}

footer p {
    padding-top: 1.5em;
}

footer a {
    color: #f0f0f0;
    align-items: center;
    gap: 5px;
    font-weight: 500;
    transition: color 0.2s ease;
}

footer a:hover {
    color: var(--clr-red); 
}

.hidden {
    display: none !important;
}