.flipbook-container {
    position: relative;
    width: 100%;
    max-width: 900px;
    margin: 40px auto;
    border: 1px solid #ddd;

    display: flex; /* FIX: align arrows and flipbook */
    align-items: center;
    justify-content: center;
    gap: 10px; /* space between arrows and flipbook */
     box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08); /* subtle shadow */
}
.flipbook-wrapper{
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.flipbook {  
    width: auto;
    max-width: 100%;
    aspect-ratio: 4 / 3; /* Maintain 4:3 ratio */
    max-height: 90vh;   
    transform-origin: center center !important;
    margin: 0 auto;
}

.flipbook img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}
.flipbook .page img {
  width: 100%;
  height: auto;
  object-fit: contain;
}

.flipbook .page-wrapper {
    transition: transform 0.3s ease-in-out;
}

.arrow {
    font-size: 15px;
  /*  background: rgba(255, 255, 255, 0.7);*/
    padding: 10px;
    border-radius: 50%;
    color: #ccc;
    cursor: pointer;
    z-index: 10;
    transition: background 0.3s ease;

    /* Align arrow icons to the center vertically */
    display: flex;
    align-items: center;
    justify-content: center;
}

/* REMOVE THESE (because you no longer need absolute positioning) */
.flipbook .arrow.prev,
.flipbook .arrow.next,
.flipbook .arrow {
    position: relative;
    top: 0;
    left: auto;
    right: auto;
    margin: 0 10px;
}
.arrow.disabled {
    opacity: 0.4;
    pointer-events: none;
    cursor: not-allowed;
}
.flipbook .page {
    transition: transform 1.2s ease-in-out !important;
}




/* 🔒 Prevent printing */
@media print {
    body * {
        visibility: hidden !important;
    }

    .flipbook-container,
    .flipbook-container * {
        display: none !important;
    }

    body::before {
        content: "Printing is not allowed.";
        display: block;
        text-align: center;
        font-size: 24px;
        margin-top: 200px;
        color: #cc0000;
        visibility: visible !important;
    }
}
.flipbook-toolbar {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
    background: #ffffff;
    border: 1px solid #ddd;
    padding: 5px;
    margin: 20px auto 0;
    max-width: 400px;
    box-shadow: 0 0 5px rgba(200,200,200,0.75);
    font-family: Arial, sans-serif;
    z-index:1000;
}

.flipbook-toolbar button {
    background: none;
    border: none;
    padding: 4px 8px; /* Reduced padding for tighter buttons */
    font-size: 18px;
    color: #73859f;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: color 0.2s ease;
}

.flipbook-toolbar button:hover {
    color: #000;
}

/* Page Info Container */
.page-info {
    display: flex;
    align-items: center;
    gap: 0;
    height: 26px;
    line-height: 1;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    background-color: rgba(232, 232, 232, 0.6);
    overflow: hidden;
}

/* Input Fields */
.current-page-input,
.total-pages-input {
    width: 42px;
    padding: 2px 4px;
    font-size: 13px;
    line-height: 1;
    text-align: center;
    border: none;
    background: transparent;
    height: 100%;
}

.current-page-input {
    border-right: 1px solid #ccc;
    border-top-left-radius: 4px;
    border-bottom-left-radius: 4px;
}

.total-pages-input {
    color: #666;
    border-top-right-radius: 4px;
    border-bottom-right-radius: 4px;
}

.current-page-input:focus,
.total-pages-input:focus {
    outline: none;
    background-color: #fff;
    box-shadow: inset 0 0 2px #aaa;
}


/* Mobile Responsive Styles */
@media (max-width: 768px) {
    .flipbook .arrow {
        font-size: 20px;
        padding: 8px;
    }
    .flipbook .arrow.prev {
        left: 5px;
    }
    .flipbook .arrow.next {
        right: 5px;
    }
   .flipbook-toolbar {
    max-width: 100%;
    gap: 20px;
    padding: 5px;
    margin-top: 10px;
    flex-direction: row;
}

    .flipbook-toolbar button {
        font-size: 16px;
        padding: 0px;
    }

    .page-info {
        font-size: 12px;
        height: 24px;
    }

    .current-page-input,
    .total-pages-input {
        width: 36px;
        font-size: 12px;
    }

    .zoom-level {
        font-size: 12px;
    }
}
