body {
    display: flex;
    flex-direction: column;
    align-items: center;
    /* justify-content: center; */
    min-height: 100vh;
    margin: 0;
    font-family: 'Arial', sans-serif;
    background-color: #a0a0a0;
    overflow: hidden;
    touch-action: none;
}

.container {
    text-align: center;
    padding: 10px;
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
}
        
.book-title {
text-align: center;
font-size: 3rem;
line-height: 1.3;
color: #e63946;
text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
max-width: 600px;
padding: 20px;
border-radius: 20px;
background: linear-gradient(145deg, #ffffff, #f0f0f0);
box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
transition: all 0.3s ease-in-out;
}

.book-title:hover {
transform: scale(1.03);
box-shadow: 0 12px 28px rgba(0, 0, 0, 0.15);
color: #d62828;
}

.book-title span {
display: block;
}

.big {
font-size: 4rem;
font-weight: bold;
color: #e6ebb8;
}

#book {
    margin: 0 auto;
    background: #fff;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    touch-action: pan-x;
}

.container {
    display: flex;
    flex-direction: column;
    min-height: 100vh; /* Ensure container fills viewport */
}

.page {
    background-color: white;
    display: flex;
    flex-direction: column; /* Stack header, content, footer vertically */
    justify-content: space-between; /* Push footer to bottom of each page */
    font-size: 16px;
    color: #333;
    border: 1px solid #ddd;
    user-select: none;
    min-height: 467px; /* Minimum height instead of fixed height */
    box-sizing: border-box; /* Ensure padding/border are included in height */
}

.div-bg-img {
    text-align: left;
    max-height: 560px;
    background: white;
    overflow: hidden; /* Ensures no overflow if image exceeds container */
}

.div-bg-img img {
    height: 100%; /* Matches the container's height */
    width: 100%; /* Ensures the image scales proportionally */
    object-fit: contain; /* Scales image to fit within the container while preserving aspect ratio */
    /* Alternatively, use object-fit: cover; to fill the container, cropping if needed */
}

.page-header {
    padding: 10px 15px 0px 15px; 
    text-align: center;
}

.page-even h2{
    font-size: 13px;
    text-align: left;
    color: #ff6b78;
}

.page-odd h2{
    font-size: 13px;
    text-align: right;
    color: #ff6b78;

}

.page-content {
    padding: 0px 15px 0px 15px; 
    /* text-align: center; */
}

.page-footer {
    text-align: center;
    position: absolute; /* Position at bottom */
    bottom: 15px; /* Distance from bottom edge */
    width: 100%; /* Ensure it spans the width for centering */
    font-size: 13px;;

}
 

.book-cover-writer{
    padding-top: 5px;
    font-size: 14px;
}        

/* .book-cover-img{
    padding: 15px;
} */
        
.page-story-title{
    color: #0052cc;
}		
        
.page-story {
                text-indent: 1em; /* Thụt đầu dòng 2 chữ */			
    text-align: justify;
}		

.page-cover {
    background-color: #1f2a44;
    color: white;
    font-size: 24px;
    font-weight: bold;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;  
    max-height: 667px;
}

.page-cover-bg-img {
    background-color: #000000;
    /* left: 0; */
}

.book-cover-title{
    padding-top: 50px;
}
.book-cover-writer {
    text-align: center;
    position: absolute; /* Position at bottom */
    bottom: 20px; /* Distance from bottom edge */
    width: 100%; /* Ensure it spans the width for centering */
}

.controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 10px;
    padding: 0 10px;
}

.btn {
    padding: 0px 12px;
    border: none;
    border-radius: 5px;
    background-color: #3498db;
    color: white;
    cursor: pointer;
    font-size: 14px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    height: 35px;
}

/* .btn-home {
    margin-top: -10px;
} */

/* Ensure btn-home matches the size and styling of other btn-sm buttons */
.btn-home {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem 0.5rem; /* Match btn-sm padding */
    font-size: 0.875rem; /* Match btn-sm font size */
    line-height: 1.5; /* Match btn-sm line height */
    border-radius: 0.2rem; /* Match btn-sm border radius */
    width: auto; /* Ensure it doesn't stretch unnecessarily */
    height: 31px; /* Approximate height for btn-sm, adjust if needed */
    text-decoration: none; /* Remove underline from link */
    vertical-align: middle; /* Align with other buttons */
  }
  
  /* Ensure icon size consistency */
  .btn-home .bi-house-fill {
    font-size: 1rem; /* Adjust icon size to fit btn-sm */
    margin-right: 0.25rem; /* Adjust margin for consistency */
  }

.btn:hover {
    background-color: #2980b9;
}

.btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.page-info {
    font-size: 14px;
    margin: 0 10px;
    display: flex;
    align-items: center;
    height: 35px;

}

.btn-orientation, .btn-zoom-in,.btn-zoom-out{
    display: none;
}

.page-current{
    margin: 0 3px;
}

.page-total{
    margin: 0 5px;
}
@media (max-width: 430px) {
    .page {
        font-size: 14px;
    }
    .page-cover {
        font-size: 20px;
                                                
    }

    .btn {
        padding: 6px 10px;
        font-size: 11px;
    }

    .btn-home {
        padding: 0.2rem 0.1rem; /* Slightly smaller padding for small screens */
        font-size: 1.2rem; /* Slightly smaller font size */
        height: 35px; /* Adjust height for small screens */
      }
      .btn-home .bi-house-fill {
        font-size: 1.2rem; /* Adjust icon size for small screens */
      }
          

    .page-info {
        font-size: 12px;
    }
    .page-content {
        padding: 10px;
    }
    .controls {
        gap: 6px;
    }
}