.mso-pageturner-wrapper {
    margin: 20px auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, sans-serif;
    text-align: center;
    height: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.mso-pageturner-container {
    position: relative;
    overflow: visible;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #333;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 20px;
    width: fit-content;
    max-width: 100%;
}

.mso-flipbook {
    position: relative;
    margin: 0 auto;
}

/* Controls */
.mso-flipbook-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 0;
    margin-top: 15px;
    width: 100%;
    max-width: 800px;
}

.mso-page {
    background: white;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: absolute;
}

.mso-page canvas {
    max-width: 100%;
    max-height: 100%;
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}

/* Loading state */
.mso-flipbook-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 10;
}

.mso-flipbook-loading p {
    font-size: 18px;
    color: #fff;
    margin: 0;
    padding: 20px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 4px;
}

/* Error state */
.mso-flipbook-error {
    padding: 40px 20px;
    text-align: center;
    background: #fff;
    color: #d32f2f;
    border-radius: 4px;
    margin: 20px;
}

.mso-flipbook-error p {
    margin: 0;
    font-size: 16px;
}

/* Controls */
.mso-flipbook-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 0;
    margin-top: 15px;
    border-top: 1px solid #ddd;
}

.mso-btn {
    background: #2271b1;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.mso-btn:hover:not(:disabled) {
    background: #135e96;
}

.mso-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

.mso-btn.disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

.mso-btn span {
    font-size: 20px;
    line-height: 1;
}

.mso-page-info {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

.mso-current-page,
.mso-total-pages {
    font-weight: 700;
    color: #2271b1;
}

/* Turn.js specific styles */
.mso-flipbook .turn-page {
    background-color: white;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
}

.mso-flipbook .page-wrapper {
    perspective: 2000px;
}

.mso-flipbook .even,
.mso-flipbook .odd {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

/* Ensure Turn.js container is centered */
.mso-flipbook > div {
    margin: 0 auto;
}

/* Shadow effects */
.mso-flipbook .shadow {
    transition: box-shadow 0.3s;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .mso-btn {
        width: auto;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .mso-btn {
        padding: 8px 15px;
        font-size: 13px;
    }
    
    .mso-page-info {
        font-size: 13px;
    }
}
