/* Aggiungi una variabile per l'altezza della barra degli indirizzi */
:root {
    --address-bar-height: 56px; /* Stima dell'altezza della barra degli indirizzi di Chrome su Android */
  }

:root{
    --main-container-height: 600px;
    --main-container-width: 700px;
    
    --container1-height: 50%;
    --container2-height: 50%;
    --container1-collapsed-height: 19%;
    --container1-extended-height: 70%;
    --bg-flipped: #bdb1ff;
    --bg-flipped: #495073;
    --body-bg: #dadada;
    --font-color: #807b7b; 
}
@media (min-width: 767px) {
    :root{
        --body-height:100vh;

        --main-container-height: 600px;
        --main-container-width: 700px;
    
        --container1-height: 50%;
        --container2-height: 50%;
        --container1-collapsed-height: 19%;
        --container1-extended-height: 70%;
        --bg-flipped: #bdb1ff;
        --bg-flipped: #495073;
        --body-bg: #dadada;
        --font-color: #807b7b; 

        --content-padding: 50px;
        --book-flip-animation: rotateX(91deg) translateZ(-63px) scale(0.75);
    }
}
  /* Mobile view */
  @media (max-width: 767px) {
    :root{
        --body-height:100%;

        --main-container-height: calc(100vh - 15px);
        --main-container-max-height: 900px;

        --main-container-width: calc(100% - 20px);
        --container-margin-top: 5px;
    
        --container1-height: 290px;
        --container2-height: 50%;
        --container1-collapsed-height: 100px;
        --container1-extended-height: 70%;
        --bg-flipped: #bdb1ff;
        --bg-flipped: #495073;
        --body-bg: #dadada;
        --font-color: #807b7b; 
        --content-padding: 20px;


        --book-flip-animation: rotateX(91deg) translateZ(-57px) scale(0.75);
    }
  }


body {
    
    background-color: #cbb8ff;
    /*
    background: url('../assets/bg_pattern1.jpg');
    background-repeat: repeat;
    background-size: 512px;
    */
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0px;
    height: var(--body-height);
    /*
    background-color: #f5f5f5;
    background-color: var(--body-bg);
    */
}
li{
    margin-bottom: 10px !important;
}


.perspective{
    height: 100%;
    width: 100%;
    perspective: 1000px;
}
.container {
    height: var(--main-container-height);
    max-height: var(--main-container-max-height);
    width: var(--main-container-width);
    
    overflow: hidden;
    position: relative;

    display: flex;
    flex-direction: column;
    margin: 0px 0;
    margin-top: var(--container-margin-top);
    border-radius: 25px;
    color: var(--font-color);
    box-shadow: 36px 36px 50px 15px #eed7d1 d1;
    box-shadow: 0 0px 24px #31313180;
}

.book-container {
    width: 100%;
    background-color: var(--bg-flipped);
    height: var(--container1-height);
    
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: height 0.9s;
}

.book-cover {
    width: 100%;
    height: var(--container1-height);
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: height 0.7s;

    bottom: 10px;
}



.book-top {
    position: absolute;
    width: 166px;

    width: 166px;
    position: absolute;
    top: 40px;
    border-radius: 6px;
    z-index: 5;
    transform: translateZ(32.5px) translateX(0px);
}

.book-side {
    position: absolute;
    top: 280px;
    transform: translateY(-17px) translateX(-1px) translateZ(18px) rotateX(90deg);
}

/* Aggiungi la transizione sulla proprietà height */

/* ====== STILI DEL CONTENITORE DELLE PAGINE*/
.content {
    
   
    overflow-y: scroll;
    padding: 10px;
    transition: height 0.7s; /* Aggiungi questa riga */
    color: var(--font-color);
    background: white;
    z-index:10;
    padding: var(--content-padding);
    flex: 1;
}

.content .header {
    display: flex;
    align-items: center;
}
 .content .title {
    font-family: 'Quicksand', sans-serif;
    font-size: 26px;
    margin-bottom: 10px;
}
 .content .author {
    font-family: 'Open Sans', sans-serif;
    font-style: italic;
    margin-bottom: 20px;
}
 .content .icon {
    transform-origin: top;
    transition: var(--transition);
}
 .content .body {
    font-family: 'Quicksand', sans-serif;
}
 .content .body p:first-child {
    margin-bottom: 15px;
}



*::-webkit-scrollbar {
    width: 5px;
}

*::-webkit-scrollbar-track {
    background-color: rgba(0, 0, 0, 0.1);
}

*::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 3px;
}


/*=========== FINE STILI CONTENITORE DELLE PAGINE ============*/




/* Stile per la visualizzazione del book-side e ridimensionamento della parte superiore */
.book-container.collapsed {
    height: var(--container1-collapsed-height);
}



/* Modifica l'altezza della parte contenente il contenuto quando .collapsed viene aggiunta */
.book-container.collapsed + .content {
    height: var(--container1-extended-height);
}


/* AGGIUNTE */
.book-cover0:hover + .content .icon {
    transform: rotateX(180deg);
}

.book-cover0 {
    overflow: hidden;
    perspective: 1000px;
}


.book-cover-scrolled {
    transform: var(--book-flip-animation);

}

.book-cover0 {
    overflow: hidden;
    perspective: 1000px;
}


.book-cover {
    position: relative;
    height: 100%;
    /*height: 360px;*/
    /*width: 660px;*/
    /* left: -52.5%; */
    border-top-left-radius: 25px;
    border-top-right-radius: 25px;
    background-color: #495073;
    transform-style: preserve-3d;
    transition: transform 0.7s cubic-bezier(0.4, 0, 0.2, 1); /* Change the transition duration and easing */

    z-index: 4;


    }
    .chapter-divider {
        /*
        background: url(../assets/divider_line.png) center / contain no-repeat;
        width: 100%;
        height: 70px; 
        margin-top: 40px;
        margin-bottom: -50px;
        */

        background: url(../assets/divider_line.png) center no-repeat;
        background-size: contain;
        width: 100%;
        height: 100px;
        margin-top: 40px;
        margin-bottom: -60px;

      }
      
      .chapter-divider-flower {
        /*
        background: url(../assets/divider_flower.png) center / contain no-repeat;
        width: 100%;
        height: 70px; 
        */
        background: url(../assets/divider_flower.png) center no-repeat;
        background-size: contain;
        width: 100%;
        height: 100px;

      }

/* Stile base per gli elementi <a> */
a {
    color: #c2c2c2;
    text-decoration: none;
    /*font-weight: 600;*/
    transition: color 0.2s, background-color 0.2s;
  }
  
  /* Cambio colore al passaggio del mouse (hover) */
  a:hover {
    color: #bdb1ff;
    text-decoration: underline;
    background-color: #f1f1f1;
    border-radius: 5px;
    padding: 2px 4px;
  }
  
  /* Stile per gli elementi <a> all'interno di un <li> */
  li a {
    display: inline-block;
    padding: 8px 16px;
    margin: 4px 0;
    border-radius: 5px;
  }
  
  /* Cambio colore e sfondo al passaggio del mouse (hover) su elementi <a> all'interno di un <li> */
  li a:hover {
    color: #fff;
    background-color: #bdb1ff;
  }
  

  /**/
  .dashed-border-container {
    max-width: 100%;
    display: flex;
    justify-content: center;
    border-style: dashed;
    border-width: 2px;
  }
  
  .dashed-border-purlple {
    border-image: repeating-linear-gradient(45deg, #35047b 0, #35047b 7px, transparent 4px, transparent 15px) 1;
}
  .dashed-border-yellow {
    border-image: repeating-linear-gradient(45deg, #ffc107 0, #ffc107 7px, transparent 4px, transparent 15px) 1;
  }
  
  .dashed-border-blue {
    border-image: repeating-linear-gradient(45deg, blue 0, blue 15px, transparent 15px, transparent 30px) 1;
  }

  .prefazione-img-margin{

    margin-bottom: 20px;
  }

  .book-lines{

    background-color: #fff;
    background-image: linear-gradient(#efefef9c 0.1em, transparent 0.1em);
    background-size: 100% 2em;
  }